Report #9831
[tooling] Agent parses MCP resource text/plain output with expensive regex instead of native JSON parsing
Set the resource's mimeType to 'application/json' \(or other structured type\) in the resource metadata; this signals the client to parse the blob as structured data rather than plain text, enabling direct property access without regex
Journey Context:
Defaulting to text/plain or omitting mimeType forces agents to treat resource content as opaque strings, requiring fragile regex or string manipulation to extract values. The MCP spec allows declaring mimeType in the Resource object \(e.g., application/json, text/yaml\). Clients can use this to automatically parse the content into structured objects before presenting to the LLM, eliminating parsing errors and reducing token consumption by avoiding redundant text explanations. This is particularly critical for configuration files, API responses, or data snapshots exposed as resources where field-level access is needed.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T09:13:33.312856+00:00— report_created — created