Skip to content

Remove structuredContent when isError is set - #185

Merged
LionelZoubritzky-IGN merged 4 commits into
mainfrom
remove-structuredContent-when-isError
Oct 1, 2026
Merged

LionelZoubritzky-IGN merged 4 commits into
mainfrom
remove-structuredContent-when-isError

Conversation

@LionelZoubritzky-IGN

Copy link
Copy Markdown
Contributor

The new version of MCP inspector surfaced a void in the MCP specification: should we return a structuredContent that does not conform to outputSchema when isError is set? The answer is, apparently, no: if we do, MCP inspector throws a validation error instead of displaying our own error. If that behaviour happens on a real LLM, they won't get the information the error is trying to convey. This is basically the same issue as the one covered by modelcontextprotocol/typescript-sdk#1945

This PR thus removes structuredContent from the payload whenever isError is set. The tests are adapted to make sure that the text error still contains all the relevant information.

@LionelZoubritzky-IGN
LionelZoubritzky-IGN force-pushed the refactor-selectlist-attachFeature branch 2 times, most recently from 68595e4 to 0c810c5 Compare July 31, 2026 14:36
Base automatically changed from refactor-selectlist-attachFeature to main August 4, 2026 15:02
@LionelZoubritzky-IGN
LionelZoubritzky-IGN force-pushed the remove-structuredContent-when-isError branch from d79384c to 14a893d Compare August 12, 2026 10:01
@LionelZoubritzky-IGN
LionelZoubritzky-IGN changed the base branch from main to 142-gpfschemastore0.2.0 August 12, 2026 10:02
@LionelZoubritzky-IGN
LionelZoubritzky-IGN force-pushed the remove-structuredContent-when-isError branch from 14a893d to 6fad23d Compare August 21, 2026 16:50
@LionelZoubritzky-IGN

Copy link
Copy Markdown
Contributor Author

Base automatically changed from 142-gpfschemastore0.2.0 to main September 21, 2026 12:19
@LionelZoubritzky-IGN
LionelZoubritzky-IGN force-pushed the remove-structuredContent-when-isError branch 2 times, most recently from f80c122 to a3da1f9 Compare September 21, 2026 12:28
@LionelZoubritzky-IGN
LionelZoubritzky-IGN force-pushed the remove-structuredContent-when-isError branch from a3da1f9 to a08795c Compare October 1, 2026 13:51
@esgn
esgn force-pushed the remove-structuredContent-when-isError branch from a08795c to 03c8134 Compare October 1, 2026 14:10
@esgn

esgn commented Oct 1, 2026

Copy link
Copy Markdown
Member

The 2026-07-28 spec is still silent on whether structuredContent must match outputSchema when isError is true, and its own tool execution error example carries content only.
The TypeScript SDK client validates it anyway (fix pending in modelcontextprotocol/typescript-sdk#1945), so dropping structuredContent from errors is the safe choice for now. We'll see if this change break a client somewhere.

Comment thread test/tools/helpers/errorAssertions.ts
@LionelZoubritzky-IGN
LionelZoubritzky-IGN force-pushed the remove-structuredContent-when-isError branch from 84ae327 to cb62908 Compare October 1, 2026 14:42
@LionelZoubritzky-IGN
LionelZoubritzky-IGN merged commit 5bc928a into main Oct 1, 2026
6 checks passed
@LionelZoubritzky-IGN
LionelZoubritzky-IGN deleted the remove-structuredContent-when-isError branch October 1, 2026 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants