structuredContent is not private. If the model should not see a field, put that field in _meta or fetch it later through an app-only tool.
Recommended Shape
Returncontent and structuredContent from model-visible UI tools:
What Goes Where
Put summaries in content
Use content for the shortest useful text answer:
- What happened.
- Counts, statuses, totals, or selected identifiers.
- Recoverable error messages.
- A text fallback for hosts that do not render MCP Apps.
content. It makes the conversation harder for the model and the user to scan.
Put model-safe UI data in structuredContent
Use structuredContent for JSON that the View renders and the model may read:
- Cards, rows, chart series, map markers, media metadata, and form defaults.
- IDs and cursors the model may refer to later.
- State that should match an
outputSchema.
Put component-only data in _meta
Use _meta for data that should reach the iframe but not the model:
- Trace IDs, request IDs, cache keys, and feature flags.
- Large dictionaries that help the View render details on demand.
- Raw records when
structuredContentcontains a redacted or summarized shape.
_meta. The model should be able to answer the next user turn from content, structuredContent, and any later updateModelContext calls.
App-only Helper Tools
App-only tools still return normal MCP tool results. Set_meta.ui.visibility: ["app"] on the tool so the model cannot call it directly, then return the data the View needs.
Common Mistakes
Related
Tool Results and Model Context
Keep model context in sync after the View changes.
Tool and Resource Contract
Check the full server-side MCP App contract.
Add a UI to an MCP Tool
Convert a normal MCP tool into a UI-rendering app.
Tool _meta
Link tools to Views and control tool visibility.