ext-apps icon indicating copy to clipboard operation
ext-apps copied to clipboard

Properly clarify content model visibility - content vs structuredContent vs _meta

Open liady opened this issue 10 months ago • 5 comments

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.

liady avatar Jan 27 '26 23:01 liady

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 content for model-bound information
    • Only pass structuredContent if content was empty
  • As far as apps / tools are concerned:
    • Pass data the model doesn't need to see in _meta
    • Use content to 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 call ui/update-model-context / app.updateModelContext w/ 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 in content (note: text doesn't mean necessarily JSON.stringify, can be any textualization of it)

ochafik avatar Jan 28 '26 16:01 ochafik

TYSM for clarifying this for host implementation!

aharvard avatar Jan 28 '26 19:01 aharvard

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.

olaservo avatar Feb 03 '26 12:02 olaservo

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.

tonxxd avatar Feb 24 '26 02:02 tonxxd

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:

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.

jwoods02 avatar Apr 22 '26 11:04 jwoods02