Foundry Agent Service: MCP tool result with isError ends the whole response (tool_user_error) on the new Responses API

Thomas Wajer 0 Reputation points
2026-10-14T09:26:51.84+00:00

Summary

In the new Foundry Agent Service (Responses API with agent_reference), a remote MCP tool call whose result has isError: true ends the entire response with tool_user_error. The model never sees the tool error, so it cannot correct its call or continue with other steps, as the MCP specification intends for tool execution errors.

The classic agents API (threads/runs) handles the same tool result correctly: the error goes back to the model and the run completes.

Steps to reproduce

  1. Use any remote MCP server with a tool that returns a tool execution error, for example {"content":[{"type":"text","text":"Unknown connector 'DOES_NOT_EXIST'"}],"isError":true}.
  2. Create a prompt agent with that MCP tool (require_approval: never) and the instruction to carry out every step, also when a step fails.
  3. Send: "Step 1: describe connector DOES_NOT_EXIST. Step 2: list the connectors. Then report the result of each step."

Expected (MCP spec, tools, error handling: tool execution errors are reported with isError: true so the model can react): the model receives the error for step 1, runs step 2 and answers.

Actual on the new API, the response ends at the first error:

  • synchronous: HTTP 400 without a response id
  • stream: true: response.failed
  • background: true: status failed, error.code = tool_user_error, no answer

Same request on both APIs (Sweden Central, October 2026)

  • gpt-4.1: classic API completed (error returned to the model, step 2 ran); new API failed with tool_user_error.
  • gpt-5.6-luna: new API failed with tool_user_error; does not run on the classic API.
  • claude-sonnet-5: new API failed with tool_user_error; does not run on the classic API.
  • claude-opus-5-5: new API failed with tool_user_error; does not run on the classic API.

The behaviour follows the API, not the model.

Impact

Agents that read business data through MCP regularly make a recoverable tool call error (a wrong field, an unknown record, a rate limit). On the new API each one ends the agent's whole task. Classic agents retire on 31 March 2027 and do not run newer models, so moving back is not an option.

Workaround

Run with background: true, store: true. When a response fails with tool_user_error, start a new response with previous_response_id set to the failed one and a short note quoting the tool error. The agent continues with its earlier tool results intact. This works, but it is undocumented

Questions

  1. Can an MCP tool result with isError: true be returned to the model as the tool output, as the classic API does, instead of ending the response? If ending is sometimes wanted, could it be a setting on the MCP tool?
  2. Is continuing from a failed response with previous_response_id supported?
  3. Could the tool's own error (isError) be kept apart from transport or authentication failures in the response, so clients can tell them apart?
Foundry Agent Service
Foundry Agent Service

A fully managed platform in Microsoft Foundry for hosting, scaling, and securing AI agents built with any supported framework or model

0 comments No comments

1 answer

Sort by: Oldest
  1. Morteza Azizi 0 Reputation points
    2026-11-23T23:09:10.6333333+00:00

    The question is whether an MCP tool result with isError set to true can be given back to the model on the new Responses API, whether previous_response_id can continue that failed response, and whether that error is kept apart from a transport or sign-in failure.

    The MCP tool article and the toolbox article do not document a setting that passes an isError result back to the model. The toolbox page uses tool_user_error for a missing Foundry User role when the connection is UserEntraToken. Your report is different. The same tool result completed on the classic API, and the model received the error. That role sentence does not answer this case. The published pages do not say the new API returns isError to the model.

    previous_response_id is documented for a later turn on the Responses API page, and for continuing after OAuth consent on the MCP authentication page. The MCP tool article says not to use it for a prompt agent on the Copilot harness. Continue in the same conversation instead. None of those pages say it is supported after a response that already failed with tool_user_error. The background and store steps in the question are your result. I have not run them.

    The toolbox page separates a top-level MCP error, such as an OAuth consent error, from text in the tool output. It does not say an isError result is stored as a different Responses error from a transport or sign-in failure. Your report shows both ending as tool_user_error on the new API.

    I have not run a tool that returns isError true.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.