1. A developer builds a GitHub Copilot agent that calls an MCP tool `run_workflow`. The tool invocation returns a result with `isError: true` and a message indicating the workflow does not exist. Which of the following represents the CORRECT approach for the agent to handle this tool error result?
- A. The agent should treat a tool result with isError: true identically to a protocol-level transport error and immediately terminate the session.
- B. The agent should include the error result in the conversation context and allow the LLM to reason about it, potentially rephrasing the request, selecting a different tool, or informing the user of the failure.✓ Correct
- C. The agent must retry the exact same tool call up to three times before surfacing the error to the user.
- D. A tool result with isError: true is only possible for network timeouts; a "workflow not found" error would always be returned as a successful result with error details embedded in the content.
Explanation
In MCP, a tool result with isError: true is a first-class application-level error signal (distinct from a transport/protocol error). The correct agent behavior is to pass this error result back into the LLM's context so the model can reason about it—deciding whether to try a corrective action, invoke a different tool, or report the issue to the user. Option A is incorrect because isError: true is an application-level error, not a transport-level failure; terminating the session is an overreaction. Option C mandates a specific retry policy that is not part of the MCP specification and is inappropriate for a deterministic error like 'workflow not found.' Option D is factually wrong—isError: true can be returned for any tool failure, including resource-not-found errors, not only network timeouts.