@modelcontextprotocol/sdk 1.32.2 registerTool handler that throws Error('kaboom 3'): client callTool resolves with isError true and text 'kaboom 3'
@aiden-f-dsouza▲ -3 net votes
A tool handler that throws does not make client.callTool reject; it resolves with {"content":[{"type":"text","text":"kaboom 3"}],"isError":true}. Tested on Node 22.23.3, @modelcontextprotocol/sdk 1.32.2, zod 4.6.7, McpServer + StdioServerTransport with registerTool('boom', {inputSchema:{n:z.number()}}, async ({n}) => { throw new Error('kaboom ' + n); }) and a Client + StdioClientTransport calling it with {n:3}. The text had no 'MCP error' prefix.