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

# MCP tools reference

> Reference for the 11 Kubit MCP server tools: what each one does, its inputs, the report types it builds and its limits.

This page covers the tools the Kubit MCP server exposes, their inputs, the report types `create_report` builds, workspace context, cached results and limits. Your assistant calls these tools for you. The parameter names matter when you build your own MCP client or read a tool call in your assistant's log.

## When to use

| Use case | Example |
| - | - |
| Check what a tool can do before you prompt | Can the MCP server build a Data Table report? |
| Read a tool call in your assistant's log | Why did `get_report` return the cached result? |
| Build your own MCP client or agent on Kubit | Which tools need `wsctx`? |

## Tools

The Kubit MCP server has 11 tools. Every tool except `init` and `switch` needs a `wsctx` workspace token. [Workspace context](#workspace-context) explains it.

| Tool | What it does | Inputs |
| - | - | - |
| `init` | Starts a session. Returns your organization, workspace, schema and the available trace names, plus a `wsctx` token. Call it first. | None |
| `switch` | Changes the organization and workspace. Returns a new `wsctx` token that replaces the old one. | `orgId` (**Required**), `workspaceId` (**Required**) |
| `create_report` | Builds a report from a plain-language request, runs it and returns the results with a link to the report in Kubit | `query` (**Required**) |
| `get_report` | Opens a report by ID, searches reports by name, or lists your 10 most recent reports. With `refresh`, runs the report again on current data. | `reportId`, `searchTerm`, `refresh` (all optional). `reportId` and `searchTerm` can't be used together. `refresh` works only with `reportId`. |
| `inspect` | Builds and runs a grid of the events, traces or spans that match a plain-language request. Returns links to the report and a CSV export. | `query` (**Required**) |
| `explain_field` | Describes a field (type, description and its most frequent values), or finds the field that holds a value. The value search tolerates typos. | `field`, `term` (at least one) |
| `publish_component` | Publishes part of a report that already ran as a reusable component | `reportId` (**Required**), `kind` (**Required**), `name` (**Required**), `selector`, `description` |
| `import_dashboard` | Creates a new Kubit dashboard from a dashboard built in Claude, one tile per Kubit report | `name` (**Required**), `tiles` (**Required**), `description` |
| `workspace_create` | Creates a workspace in the current organization, sets up its storage and mints an API key. Returns a `wsctx` token for the new workspace. | `name` (**Required**), `description`, `timezone`, `pipelineType` |
| `workspace_mint_key` | Mints a new API key for sending traces to the current workspace | `note` (**Required**) |
| `help` | Sends a bug report, feedback or question to Kubit support, with your conversation as context, and waits briefly for a reply | `requestType` (**Required**), `text` (**Required**), `isUrgent` |

### Tool inputs

| Input | Tool | Values |
| - | - | - |
| `kind` | `publish_component` | `FILTER`, `MEASURE`, `VIRTUAL_EVENT`, `BINNING` or `COHORT` |
| `selector` | `publish_component` | Which candidate to publish when the report has several: a measure variable such as `A`, a binning's field name, a cohort segment's name, or `FILTER` for the report's cohort filter |
| `name` | `publish_component` | A new name creates a component. A name that holds the same definition returns that component unchanged. A name that holds a different definition adds a new version to it. |
| `pipelineType` | `workspace_create` | `AGENT` (default) for agent traces, or `BEHAVIOR` for product events. Set at creation and can't be changed. `BEHAVIOR` has to be turned on for your organization. |
| `requestType` | `help` | `BUG`, `FEEDBACK` or `QUESTION`. `isUrgent` applies to `BUG` only. |
| `tiles` | `import_dashboard` | 1 to 20 tiles in display order, each a `reportId` and an optional `title` |

### MCP prompt examples

> "Which field holds the value gpt-4o-mini?"

> "Publish this report's filter as Production Traffic"

## Report types

`create_report` reads your request and picks the report type. It builds 6 types:

| Report type | Builds when you ask for | Variants |
| - | - | - |
| [Query](https://learn.kubit.ai/product-analytics/reports/query.md) | A count, rate, latency or cost over time, with optional breakdowns. This includes counts over agent data. | Line, area, bar, stacked, combo, pie, treemap, waterfall, heatmap, KPI, scatter, impact, histogram |
| [Funnel](https://learn.kubit.ai/product-analytics/reports/funnel.md) | Conversion through an ordered sequence of steps | Conversion, frequency, time to convert |
| [Path](https://learn.kubit.ai/product-analytics/reports/path.md) | The sequence of product events a user or session performed | Sankey, top paths |
| [Retention](https://learn.kubit.ai/product-analytics/reports/retention.md) | The share of users that come back over time | Retention, retention over time, usage interval, usage interval over time |
| Inspection | The members of a [cohort](https://learn.kubit.ai/product-analytics/reports/cohorts.md) for a time period | |
| Agent flow | Span labels, tool calls and model calls inside agent traces, drawn over whole traces | |

`create_report` can't build Data Table or Significance reports. For rows of event or trace data, ask for them and the assistant uses `inspect`. A request that doesn't fit any report type gets an explanation instead of a report.

If the generated report fails validation, `create_report` corrects it and tries again, up to **3** times. After that it returns the validation error. A request for a report the conversation already built returns that report instead of building a duplicate.

### MCP prompt examples

> "Build a funnel from user prompt to tool call to response, broken down by model, with a 1-hour conversion window, last 14 days"

> "Show the agent flow across our traces over the last 14 days"

## Workspace context

Every Kubit MCP session works in one organization and workspace. `init` picks your last-used workspace and returns a `wsctx` token for it. The assistant passes the token on every later tool call.

| Behavior | Details |
| - | - |
| Where the token comes from | `init`, `switch` or `workspace_create` |
| Changing workspace | `switch` returns a new token. Use it on every later call. |
| Expiry | The token doesn't expire |
| Lost access | Kubit checks your access on every call. If you lose access to the workspace, calls fail until the assistant runs `init` or `switch`. |
| Malformed or unknown token | `Invalid session token. Call init to obtain a new one.` |

### MCP prompt examples

> "Which Kubit workspace am I connected to?"

> "Switch to the staging workspace"

## Cached results

`get_report` returns a report's last results when they're cached. The response says the data came from cache and gives the time it was cached. To get current data, ask the assistant to refresh the report. It calls `get_report` with `refresh` set, which runs the report again.

A refresh waits up to **50** seconds. If the report is still running after that, the response says so and asks you to check again in about a minute.

### MCP prompt examples

> "Refresh the latency report"

> "Open the Weekly Performance report with today's data"

## Limits

| Constraint | Value |
| - | - |
| Reports returned by a `get_report` search or recent list | **10** |
| Rows shown in an `inspect` response | **5**. The full result is in the CSV export link. |
| `create_report` validation retries | **3** |
| `get_report` refresh wait | **50** seconds |
| `help` wait for a support reply | About **20** seconds. After that, the reply goes to your email. |
| `import_dashboard` tiles | **1** to **20** |
| `import_dashboard` dashboard name | **50** characters |
| `import_dashboard` tile title | **80** characters |
| `publish_component` description | **2,048** characters |
| `workspace_mint_key` note | **1** to **255** characters |
| `workspace_mint_key` on an example workspace | **Not supported** |
| Deleting a published component | **Not supported** through the MCP server. A published component is visible to everyone in the workspace. |

## Related

* [Kubit MCP server](https://learn.kubit.ai/ai-assistant/overview.md): what the server does and what it can't do.
* [Connect your AI assistant](https://learn.kubit.ai/ai-assistant/connect.md): setup for each client.
* [Import a dashboard from Claude](https://learn.kubit.ai/product-analytics/dashboards.md#import-a-dashboard-from-claude): what `import_dashboard` skips.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.