> ## Documentation Index
> Fetch the complete documentation index at: https://getkontext.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# UI resources

> Tools that return inline, interactive views via the MCP Apps extension.

Some Kontext tools don't just return JSON — they return a **UI resource** the client can render inline. This uses the [MCP Apps](https://modelcontextprotocol.io) extension: the tool response carries a `_meta.ui.resourceUri` pointing at an HTML resource the server also serves. An MCP-Apps-aware client (Claude, for instance) fetches that resource and renders it as an inline widget that reads the tool's result.

Clients that don't support UI resources still get the underlying JSON payload — the tool call remains fully usable for headless agents, and only loses the visual layer.

## Example — `get_insights_chart`

[`get_insights_chart`](/docs/mcp/tools#get_insights_chart) takes a product, a chart type, and an optional date range:

```json theme={null}
{
  "tool": "get_insights_chart",
  "arguments": {
    "productId": "prod_abc123",
    "chartType": "detected-problems-trend",
    "granularity": "weekly",
    "dateFrom": "2026-01-01",
    "dateTo": "2026-04-01"
  }
}
```

The response includes the raw series data **and** a `_meta` block pointing at the UI resource:

```json theme={null}
{
  "content": [{ "type": "text", "text": "{ \"series\": [ ... ] }" }],
  "_meta": {
    "ui": { "resourceUri": "ui://insights/chart.html" }
  }
}
```

UI-aware clients then fetch `ui://insights/chart.html` via the MCP `resources/read` method, and render it as an interactive chart inline in the conversation. The rendered view reads the same series data shown above and draws it — so the agent can still reason about the numbers in text, while the user sees the chart.

## Future UI resources

This is the first Kontext tool to return a UI resource. More are on the roadmap — the pattern is the same: the tool's `_meta.ui.resourceUri` names the rendered view, and the server exposes that URI as a resource.
