Describe the bug
Since the introduction of #194 the error behaviour of the MCP server has changed. Now missing tools and violations of the input schema do not cause a protocol error (JSON RPC error) anymore, but a tool execution error (i.e. successful JSON RPC response, with MCP isError flag set to true).
At least the former seems to be in violation of the MCP spec: https://modelcontextprotocol.io/specification/2025-06-18/server/tools#error-handling
Tools use two error reporting mechanisms:
- Protocol Errors: Standard JSON-RPC errors for issues like:
- Unknown tools
- Invalid arguments
- Server errors
(highlighting mine)
To Reproduce
Steps to reproduce the behavior:
- Create an MCP server that has an empty array of tools (
MCP::Server.new(tools: []))
- Try to call a tool
Expected behavior
A JSON RPC error response (e.g. root-level element error)
References
Describe the bug
Since the introduction of #194 the error behaviour of the MCP server has changed. Now missing tools and violations of the input schema do not cause a protocol error (JSON RPC error) anymore, but a tool execution error (i.e. successful JSON RPC response, with MCP
isErrorflag set to true).At least the former seems to be in violation of the MCP spec: https://modelcontextprotocol.io/specification/2025-06-18/server/tools#error-handling
(highlighting mine)
To Reproduce
Steps to reproduce the behavior:
MCP::Server.new(tools: []))Expected behavior
A JSON RPC error response (e.g. root-level element
error)References