Skip to content

Remove structuredContent when isError is set - #185

Open
LionelZoubritzky-IGN wants to merge 1 commit into
refactor-selectlist-attachFeaturefrom
remove-structuredContent-when-isError
Open

Remove structuredContent when isError is set#185
LionelZoubritzky-IGN wants to merge 1 commit into
refactor-selectlist-attachFeaturefrom
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
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.

1 participant