Errors that occur during the execution of a tool (including "expected" errors from the tool, like from a third-party API) could be reported in one of two ways to the client:
- As an MCP error
- In the result object, adding some sort of
error key or annotation
The problem with 1 is that the LLM will be expecting a tool result, and will probably benefit from knowing if it failed—and treating it like a protocol error might preclude that.
We should document whatever we decide as a recommendation in the spec.
Errors that occur during the execution of a tool (including "expected" errors from the tool, like from a third-party API) could be reported in one of two ways to the client:
errorkey or annotationThe problem with 1 is that the LLM will be expecting a tool result, and will probably benefit from knowing if it failed—and treating it like a protocol error might preclude that.
We should document whatever we decide as a recommendation in the spec.