Returning JSON in the MCP client #695
Impuls2003
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hi!
I’m working with mcp-go and have a question about tool results formatting.
On the server side I return a JSON string as text:
But in LM Studio the LLM receives it as:
So the JSON is always wrapped as a text content block, even when the payload is valid JSON.
Using mcp.NewToolResultJSON(...) produces the same visible result in LM Studio.
My question:
Is there a recommended way to return structured JSON data so the client/LLM can reliably treat it as an object rather than plain text?
Thanks!
All reactions