promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_promptdojo_

Wire an MCP tool — load tools from a server, not a registry — step 7 of 9

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.

full-screen editor opens — close anytime to keep reading.