schema: draft structured tool-failure classification (ToolFailure) - #3312
Open
johnyzaguirre-glean wants to merge 1 commit into
Open
Conversation
Prototype for discussion modelcontextprotocol#2930 — adds an optional, additive `io.modelcontextprotocol/toolFailure` _meta key on CallToolResult carrying class ("capability" | "reliability" | "governance"), an extensible code, retryable/retryNotBefore, a required correlationId for operator debugging, and agentGuidance. Local draft only — not filed as a PR, issue, or discussion comment.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Prototype for discussion #2930 — adds an optional, additive
io.modelcontextprotocol/toolFailure_metakey onCallToolResultcarrying
class(capability/reliability/governance), an extensiblecode,retryable/retryNotBefore, a requiredcorrelationIdforoperator debugging, and
agentGuidance.CallToolResult, not the JSON-RPCErrortype, per the existingrule that tool failures must stay visible to the model
_metanamespaced-extension pattern (same one usedfor
subscriptionId) — additive, no new-320xxcode, no breaking changeclass+codesplit, mandatory
correlationId,agentGuidancekept separate fromdiagnostics
This is a discussion prototype, not a submitted SEP — posting for feedback
per the "documentation-first before a formal SEP" question raised in the
thread. Happy to move this into a proper SEP if there's interest.
AI disclosure
This PR was written primarily by Claude Code, based on my discussion with
it about consolidating the proposals raised in #2930 (and related, #3188).
I reviewed and understand the schema changes.
Test plan
npm run check:schema:tspasses (tsc, eslint, prettier)npm run generate:schemaregeneratedschema.json/schema.mdxcleanlynpm run check:schema— 259/259 example checks pass, including thenew
ToolFailure/policy-blocked.jsonexample