lesson 6 of 7 · wire an mcp tool — load tools from a server, not a registrywire an mcp tool — load tools from a server, not a registrylesson 6 of 7 · wire an mcp tool — load tools from a server, not a registrywire an mcp tool — load tools from a server, not a registrylesson 6 of 7 · wire an mcp tool — load tools from a server, not a registrywire an mcp tool — load tools from a server, not a registrylesson 6 of 7 · wire an mcp tool — load tools from a server, not a registrywire an mcp tool — load tools from a server, not a registrylesson 6 of 7 · wire an mcp tool — load tools from a server, not a registrywire an mcp tool — load tools from a server, not a registrylesson 6 of 7 · wire an mcp tool — load tools from a server, not a registrywire an mcp tool — load tools from a server, not a registrylesson 6 of 7 · wire an mcp tool — load tools from a server, not a registrywire an mcp tool — load tools from a server, not a registrylesson 6 of 7 · wire an mcp tool — load tools from a server, not a registrywire an mcp tool — load tools from a server, not a registrylesson 6 of 7 · wire an mcp tool — load tools from a server, not a registrywire an mcp tool — load tools from a server, not a registrylesson 6 of 7 · wire an mcp tool — load tools from a server, not a registrywire an mcp tool — load tools from a server, not a registrylesson 6 of 7 · wire an mcp tool — load tools from a server, not a registrywire an mcp tool — load tools from a server, not a registry
The MCP server returned a successful JSON-RPC response — but
result.isError is True, meaning the tool itself reported
failure. The current code ignores isError and treats the error
message as a successful tool result, which the agent will then
confidently relay to the user.
Fix the code to check isError and prefix the text with
"TOOL_ERROR: " when the flag is True, so the agent sees the
failure and can recover.
Expected output:
TOOL_ERROR: search service unavailable
The break is on line 13 — but read the whole snippet first.