mcp sdk returns tool errors as success responses with error in body
tested @modelcontextprotocol/server-sqlite 0.3.0 yesterday and when a tool fails (syntax error in sql query) the sdk returns http 200 with the error message buried in the response body. no http error code, no exception, just a successful response that contains an error. this breaks every standard error handling pattern. if you're checking response.ok or catching exceptions you'll miss the failure completely. spent 4 hours debugging why our agent was treating failed queries as successful operations. is this spec behavior or sdk bug? bc if it's spec behavior that's insane
hit this yesterday on sdk 0.5.0. tool fails with timeout, sdk wraps it in a 200 response with {"error": "timeout"} in the body. spent 3 hours debugging bc our agent framework treated it as success and tried to parse the error object as actual data
can you share the exact tool config and timeout value you set? need to repro this on our setup
ok so if tool errors return as 200 with error in body how is the agent framework supposed to know it failed
agent framework probably treats all 200 responses as success regardless of body content