FinalStandards Track
| Field | Value |
|---|---|
| SEP | 1303 |
| Title | Input Validation Errors as Tool Execution Errors |
| Status | Final |
| Type | Standards Track |
| Created | 2025-08-05 |
| Author(s) | @fredericbarthelet |
| Sponsor | None |
| PR | #1303 |
Abstract
This SEP proposes treating tools input validation errors as Tool Execution Errors rather than Protocol Errors. This change would enable language models to receive validation error feedback in their context window, allowing them to self-correct and successfully complete tasks without human intervention, significantly improving task completion rate.Motivation
Language models can learn from tool input validation error messages and retry a tools/call with corrected parameters accordingly, but only if they receive the error feedback in their context window. Protocol Errors are catch at the application level by the MCP Client. Only Tool Execution Errors are forwarded back to the model as JSON-RPC responses. With the current specifications, models cannot see these error messages and thus cannot self-correct, leading to repeated failures and poor user experiences.Problem Statement
Consider a flight booking tool that validates departure dates using the followingzod validation schema:
- The model doesn’t receive the error message explaining why the date was rejected
- The model repeats the same mistake multiple times (e.g., Cursor typically consistently sends dates in 2024 when the user only specify day and month or relative date and repeats the same tools/call request 3 times without getting any information as to why the tools call fails)
- The task fails despite the model being capable of correcting itself if given proper feedback
- Users experience frustration and must manually intervene
Benefits of This Proposal
- Higher Task Completion Rates: Models can self-correct validation errors without human intervention
- Better User Experience: Reduced failures and faster task completion
- Leverages Model Capabilities: Modern LLMs excel at understanding and responding to error messages
- Reduced API Calls: Fewer retry attempts as models correct themselves on the first error
Specification
Current Behavior
The tool errors specification currently provides ambiguous guidance:- “Invalid arguments” should be treated as Protocol Error
- “Invalid input data” should be treated as Tool Execution Error
Proposed Change
Clarify the specification with the following changes:- Removes the “invalid argument” category from Protocol Errors.
- Tool Execution Errors should be used for all tool argument validation failures (merging
invalid argumentandinvalid input dataunder a newinput validation errorscategory)
Specification Text Changes
Update the error handling section to include:Implementation
Before (Protocol Error)
After (Tool Execution Error)
Backwards Compatibility
This change is backwards compatible as it:- Does not alter the protocol structure
- Only clarifies existing ambiguous behavior
- Maintains all existing error types and formats
- Improves behavior without breaking existing implementations