OpenAI Agents Python MCP error content: reading Sume tool errors

openai-agents-python v0.20.0 keeps MCP error content with structured output. Sume tool failures arrive as isError text with code, message and http_status.

4 min readSume
All posts

With openai-agents-python v0.20.0 or later, an MCP tool error keeps its content even when structured output is enabled. A Sume failure is a normal tool result with isError: true and one JSON text block holding code, message and, when known, http_status, so your code can branch on code.

The fix is listed in the openai-agents-python release notes; the error shape is from Sume's MCP server code and MCP OAuth docs, read 2026-10-01.

What did v0.20.0 fix?

The release list has one line: "fix(mcp): keep MCP error content when structured output is enabled". It gives no further detail, so I will not guess at the failing case.

What does a Sume tool error look like?

The server's toolErrorResult builds an envelope with code (falling back to tool_execution_error), message, optional details and http_status, plus any other fields, and returns it as one text block with isError: true.

Coded errors named in Sume code and docs, read 2026-10-01
codeWhen
insufficient_scopeA mutating tool is called on an mcp:read session; the error also carries required_scope
mcp_output_too_largeResult exceeds the output limit; message says it is not a job failure and never to resubmit a paid create
tool_execution_errorDefault when no code is set

How should my agent react?

Parse the text block as JSON and switch on code. For insufficient_scope, re-authorize with mcp:write or use an API key. For mcp_output_too_large, read a narrower or paginated result; never repeat a paid create. Gate paid calls with approvals as in require_approval for Sume write tools.

Sources

Related posts

More in Developers

All Developers posts

Written by Sume