Properly clarify content model visibility - content vs structuredContent vs _meta
There were questions from the community about the proper field to use for passing data to the UI without the passing through the model.
The spec mentions (in a somewhat hard-to-find location) that content is passed to the model, and that both structuredContent and _meta are not added to the context. This needs further clarification.
In addition - it's not clear whether content needs to be shown in addition to the UI.
As a comparison - Apps SDK spec clearly specifies that content and structuredContent are being passed to the model, while _meta isn't.
We should probably make it clearer in the spec.
We should stick to the MCP semantics (and upcoming clarification SEP 1624):
- As far as host is concerned / what it sends to the model:
- Use
contentfor model-bound information - Only pass
structuredContentifcontentwas empty
- Use
- As far as apps / tools are concerned:
- Pass data the model doesn't need to see in
_meta - Use
contentto give the model a high-level executive summary of what's going on, so it's not overwhelmed w/ data it doesn't need (and isn't tempted to talk about said content for pages and pages). Can be as simple as "A view was displayed w/ the content of item 123 (a talking car), which the user can now interact with" (Also note you can callui/update-model-context/app.updateModelContextw/ updates of whatever changes in the UI w/ a similar model-readable text) - Consistently w/ MCP spec, if passing
structuredContent, also pass a text version of it incontent(note: text doesn't mean necessarilyJSON.stringify, can be any textualization of it)
- Pass data the model doesn't need to see in
TYSM for clarifying this for host implementation!
Update: it didn't look like anyone was formally driving this to a conclusion yet, and I think this relates to another SEP that I'm picking back up again related to JSON schemas. I assigned myself to the SEP issue Olivier mentioned above and asked the submitter to create a PR in the latest SEP format.
As a side note, I saw that this blog from Block and MCPJam mentioned this:
content: Content is the info that you want to expose to the model. Gives model context. structuredContent: This data is hidden from the model context. It is used to send data over the View for hydration.
I guess https://github.com/microsoft/vscode/issues/290063 is related here too. If the spec says structuredContent isn’t shown to the model, but most major clients are still including it in the context anyway, that feels like a pretty big problem. Especially for data sensitive use cases, since people might rely on that guarantee and end up leaking stuff unintentionally.
As far as apps / tools are concerned:
- Pass data the model doesn't need to see in _meta
Worth flagging two major hosts are currently breaking the "_meta is widget-only" guarantee:
- ChatGPT strips
_metawholesale fromui/notifications/tool-result. OpenAI Support acknowledged this bug with no current fix. The workaround is to route through thewindow.openai.toolResponseMetadataglobal instead. - Cursor has the same bug: I filed a report with no workaround I can find atm.
Combined with the structuredContent drift raised above and SEP-2200, server authors have no reliable spec-sanctioned channel for widget-only data. structuredContent leaks to the model in some clients. _meta gets stripped by ChatGPT (workaround exists) and Cursor (none). There's nowhere safe to put it.