Replies: 3 comments
-
The Host application takes responsibility for converting data from the MCP Server Call Tool Result and placing it in the Context Window. If you control the Host application (e.g. written it yourself) then you may be able to usefully manipulate the JSON data prior to inference. I wouldn't normally recommend using JSON for most tasks with most LLMs (unless it is a JSON specific question e.g. If you do want to inject JSON in to the context window, you are probably better off returning it as normal |
Beta Was this translation helpful? Give feedback.
-
This is only an anecdotal report, but I've been sending large JSON objects to OpenAI's models in my context window for over 2 years now. It was reliably parsing it returning well-formed JSON results even before JSON mode, the precursor to their Structured Outputs. Those were progressive steps toward assurance that the results would be valid JSON. I doubt other modern foundation models are any less capable, but I haven't pointed my app at them recently. That said, it might be more expensive, take more tokens, have more steps to validate. |
Beta Was this translation helpful? Give feedback.
-
It's worth being aware that at least some SDKs automatically create a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Pre-submission Checklist
Discussion Topic
I noticed that the latest version supports Output Schema. During our development process, there was a dispute: whether mcp's service should directly return a piece of text or return JSON data. The viewpoint supporting the return of text is that text is more conducive to model understanding, has a lower probability of error, and requires no additional conversion. The viewpoint supporting the return of JSON data is that there are a large number of APIs in existing projects, and based on Output Schema, these interfaces can be converted in batches, reducing a lot of text translation work;
Beta Was this translation helpful? Give feedback.
All reactions