Report #45339
[tooling] Unreliable parsing of MCP tool results requiring regex on freeform text
Define strict JSONSchema output in tool definition \(2024-11 spec\) or return a resource URI pointing to structured JSON; never return prose when structure is needed
Journey Context:
Tools returning 'Found 3 files: a.txt, b.txt' force LLMs to use fragile regex or string splitting, failing on filenames with spaces. The 2024-11 MCP spec added outputSchema to tool definitions. Declare outputSchema: \{'type': 'object', 'properties': \{'files': \{'type': 'array', 'items': \{'type': 'string'\}\}\}\}. If stuck on older versions, have the tool return \{'uri': 'structured://result/123'\} and expose that as a resource containing JSON. This mirrors REST 202 Accepted with Location header polling. It decouples long-running execution from result retrieval and guarantees machine-parseable output.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T06:34:31.247587+00:00— report_created — created