Proposal: standardize operator-friendly tool failure metadata for common MCP cases #2930
Replies: 6 comments 1 reply
|
I like the direction of keeping this lightweight rather than introducing a new error framework one thing I would suggest is separating machine-readable classification from the human-readable error message. For example, a tool could return a stable error code like:
alongside a descriptive message and optional metadata (retry delay, required capability, login URL, etc.) that would let clients implement consistent behavior (retry, prompt for authentication, disable UI actions, etc.) without relying on parsing free-form text while still giving operators useful debugging information. I also think starting as a best-practice recommendation is the right approach. If multiple MCP servers converge on the same conventions it would provide real implementation experience before considering a formal SEP. one additional category that may be worth considering is something like overall having a small recommended set of standardized classifications seems like it would improve interoperability without adding much complexity |
|
Agree on keeping this best-practice-first and separating machine classification from the human message. One thing I'd add: the codes in @Mohataseem89's list actually span three groups that call for different client behavior, and a single flat list hides that. It may help to carry a small
I'd argue governance is the one worth making explicit, because it's the current gap. It isn't the same as Concretely: keep the granular |
|
Ganerate Proposal based [2025 05 12 Green Paper on Establishing a Somaliland Bar Association Law.docx](https://github.com/user-attachments/files/29873698/2025.05.12. into: advocacy grants: |
|
Ganerate proposal |
|
On your question about existing implementations: yes. I've been building this as a transparent proxy called mcp-fuse, and the metadata it converged on overlaps heavily with this thread. Agree with @Mohataseem89 on separating machine classification from the human message, and with @HarperZ9 that the codes imply different client behaviors. In my schema that ended up as three fields doing distinct jobs: category: a small closed enum (transient, rate_limit, timeout, auth, permission, invalid_input, not_found, resource_exhausted, permanent, unknown). Roughly your list plus the retry-relevant cases. retryable plus an optional retry directive (strategy, "not before" timing, max attempts). This is where this thread meets #3188, which is asking about the timing half of the same problem; the two probably belong together. agentGuidance: one short imperative sentence intended for the model, capped in length, never a stack trace. Raw diagnostics go in a separate detail field that clients shouldn't forward to the model at all. In agent contexts this split matters as much as the codes, because the error text itself is what burns context. One implementation lesson worth folding into the convention: whether a client may auto-retry has to depend on the tool's declared idempotency (readOnlyHint / idempotentHint), not only on the error class. An ambiguous failure on a tool with side effects should never be silently replayed. A nice side effect of making that normative is that servers finally get a real incentive to annotate their tools correctly. Schema draft with JSON Schema and examples: https://github.com/YoadElkayam/mcp-fuse/tree/main/spec. It runs in the wild as a proxy, so there's measured data as well (benchmarks show it keeping roughly 96 to 98 percent of error payload tokens out of model context). Happy to reshape any of it toward whatever convention this group lands on. Starting as documentation guidance before an SEP sounds right to me. |
|
@YoadElkayam Happy to close this one as a duplicate if the maintainers prefer a single venue. Either way I'd rather help ship one proposal than seed a third convention. I can also contribute the enterprise operator perspective on what a support-facing failure signal has to include to actually shorten a ticket, which is the requirement I'm closest to. One thing I want to flag as at risk. The thread has developed three consumers of this payload: the model reads agentGuidance, the client switches on category and retryability, and the operator reads the granular code. The first two have gotten most of the attention here, and the third is the one that motivated my original post. Faster troubleshooting needs one more field that the other two consumers don't care about: a server-generated correlation id that a user can paste into a support ticket and an operator can grep for in server logs. Today that reconciliation is done by matching timestamps, which fails exactly when you need it most, on a busy multi-tenant server. It costs one optional string and it's the difference between "a tool call failed sometime around 10:04" and a specific request. I'd put it in the same payload rather than leaving it to convention, since a field only operators use is precisely the field that never gets adopted if it's merely suggested. On next steps, I'd like to join the effort @YoadElkayam and @aurumflux20 described in #3188 rather than run this thread in parallel. Concretely, I'd take two pieces: the classification vocabulary, meaning the code set, the code-to-class mapping, and the governance case with its client-behavior rules; and the docs-first guidance page that lands before the SEP. |
Uh oh!
There was an error while loading. Please reload this page.
I'd like to propose a small interoperability improvement that could help both client and server implementers:
A recommended convention for surfacing common tool failure cases in a more consistent way.
Examples of cases that seem common across implementations:
I'm not proposing a large new error framework. I'm thinking of something lighter-weight first: guidance or a recommended convention so clients can respond more predictably and operators can troubleshoot faster.
Why this seems useful:
Questions for the group:
I'd be happy to help gather examples from real implementations and synthesize a small first draft.
All reactions