File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
docs/specification/draft/server Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -396,14 +396,19 @@ Tools use two error reporting mechanisms:
396396
3973971 . ** 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
4024022 . ** 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+
407412Example 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
You can’t perform that action at this time.
0 commit comments