Skip to main content
MCP Apps SDK MCP App tool results have three data channels. Pick the channel based on who should read the data. 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. Return content and structuredContent from model-visible UI tools:
The model can answer from the summary and typed fields. The View can render without parsing text. The full lookup map stays out of model context.

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.
Avoid dumping large tables or raw JSON into 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.
If the data is sensitive, too large, or not useful to the model, do not put it here.

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 structuredContent contains a redacted or summarized shape.
Do not put facts the model needs in _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.
Use this pattern when the View needs extra data after the initial render, but the model does not need that full payload.

Common Mistakes

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.