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.
JSON Values and Protocol Versions
The allowedstructuredContent shape depends on the protocol surface:
For an app that must work across both core MCP revisions, keep tool result data object-shaped. If a modern-only server returns an array, scalar, or null, declare an
outputSchema with that exact root type and make sure every client and Host supports core MCP 2026-07-28.
Current sunpeak HTTP server wrappers use the SDK 2.0 legacy compatibility transport. They wrap
non-object tool result values as
{ result: value } on a 2025-11-25 connection. sunpeak’s
file-based outputSchema export is also an object shape. Return an object when you want the same
View data shape on legacy and modern connections.updateModelContext(). Its structuredContent field remains an object in the MCP Apps 2026-01-26 protocol.
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.
structuredContent, validate its shape or check whether the field exists. Do not use a truthy check because false, 0, an empty string, and null can be valid modern results.
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
For schema library requirements, runtime validation behavior, and examples for server and
app-side tools, see MCP App inputSchema and outputSchema
Validation.