Skip to content

Commit f06bcf5

Browse files
[SEP-1303] Input validation errors as tool execution errors (modelcontextprotocol#1611)
* Merge invalid arguments and input data errors under a new input validation error category in tool execution errors * Remove vague adverbes
1 parent 21cb061 commit f06bcf5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

docs/specification/draft/server/tools.mdx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,14 +396,19 @@ Tools use two error reporting mechanisms:
396396

397397
1. **Protocol Errors**: Standard JSON-RPC errors for issues like:
398398
- Unknown tools
399-
- Invalid arguments
399+
- Malformed requests (requests that fail to satisfy [CallToolRequest schema](specification/draft/schema#calltoolrequest))
400400
- Server errors
401401

402402
2. **Tool Execution Errors**: Reported in tool results with `isError: true`:
403403
- API failures
404-
- Invalid input data
404+
- Input validation errors (e.g., date in wrong format, value out of range)
405405
- Business logic errors
406406

407+
**Tool Execution Errors** contain actionable feedback that language models can use to self-correct and retry with adjusted parameters.
408+
**Protocol Errors** indicate issues with the request structure itself that models are less likely to be able to fix.
409+
Clients **SHOULD** provide tool execution errors to language models to enable self-correction.
410+
Clients **MAY** provide protocol errors to language models, though these are less likely to result in successful recovery.
411+
407412
Example protocol error:
408413

409414
```json
@@ -417,7 +422,7 @@ Example protocol error:
417422
}
418423
```
419424

420-
Example tool execution error:
425+
Example tool execution error (input validation):
421426

422427
```json
423428
{
@@ -427,7 +432,7 @@ Example tool execution error:
427432
"content": [
428433
{
429434
"type": "text",
430-
"text": "Failed to fetch weather data: API rate limit exceeded"
435+
"text": "Invalid departure date: must be in the future. Current date is 08/08/2025."
431436
}
432437
],
433438
"isError": true

0 commit comments

Comments
 (0)