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

# MCP querying tools

> Tools used to pick a model and topic, generate a query from a question, and run a query definition or a saved query.

> [!NOTE]
>
> The [Content access setting](https://docs.omni.co/ai/settings/mcp.md#content-access) must be enabled to use `listDocumentQueries` and `runSavedQuery`.

Tools used to pick a model and topic, generate a query from a question, and run a query definition or a saved query.

Tools with the  icon can run as another user with the [`X-MCP-User-ID` header](https://docs.omni.co/ai/mcp/authentication#running-tools-as-another-user).

## Read tools

> [accordion] pickModel
>
> Returns a list of models available to the calling user
>
> Returns a list of available models and their IDs, which the MCP client uses to select which model to query. You can also provide a model ID in the MCP configuration to skip this step.
>
> If you have access to only one model, [`getData`](#get-data), [`pickTopic`](#pick-topic), [`askOmni`](https://docs.omni.co/ai/mcp/tools/omni-agent#ask-omni), and [`listBranches`](https://docs.omni.co/ai/mcp/tools/modeling#list-branches) use it automatically — you don't need to call `pickModel` or pin a model with the `X-MCP-Model-ID` header.
>
> This tool is still useful when you have access to more than one model. In that case, those tools return an error listing the available models and naming the `X-MCP-Model-ID` header, so you can choose one.

> [accordion] pickTopic
>
> Returns a list of available topics in the model selected by pickModel
>
> Returns available topics in the model selected by [`pickModel`](#pick-model) and selects the most relevant topic for the query.
>
> If the AI is allowed to query any view in the model (enabled with the `X-MCP-Query-All-Views` header during setup), this step becomes optional: the AI can query any view in the model directly, not just topics.

> [accordion] getData
>
> Executes a query against the selected model and topic (or view) and returns the results
>
> Executes the query against the selected model and topic — or view, if querying outside of topics is enabled with the `X-MCP-Query-All-Views` header during setup — and returns the results.
>
> Optionally pass `requestedLlm` to generate the query with a specific LLM instead of the organization default. Your selection lasts for one call. If you select an LLM you can't use, you'll receive an error. Use [`listLlms`](#list-llms) to list the LLMs you can pick. Embed users can't use this parameter.
>
> If your organization is over its AI credit threshold, the result includes `downgradedLlm`, naming the LLM the query ran on instead of your usual one.
>
> When the query result includes a visualization, the answer can include a rendered chart image.

> [accordion] runQuery
>
> Executes a JSON query definition using the Run query API
>
> Executes a pre-built JSON query definition directly against the [Run query API](https://docs.omni.co/api/queries/run-query.md). Use this tool when the query JSON is already known. For example, you pasted a query definition in the chat, or the query definition was produced earlier in the conversation.
>
> Optionally pass `branchId` to run the query against that branch instead of the base model. Use [`listBranches`](https://docs.omni.co/ai/mcp/tools/modeling#list-branches) to get a branch's ID.
>
> When using this tool, note that:
>
> * Results default to a limit of 500 rows and cap at 10,000
> * Keys such as `userEditedSQL` that would cause the query to run raw SQL against the connection will be refused
> * If a model is provided with the `X-MCP-Model-ID` header during setup and `query.modelId` is also provided, they must match or the request will fail

> [accordion] listLlms
>
> Lists the LLMs the user can pass to askOmni or getData
>
> Lists the LLMs the user may pass as `requestedLlm` to [`askOmni`](https://docs.omni.co/ai/mcp/tools/omni-agent#ask-omni) or [`getData`](#get-data).

> [accordion] getModelTopic
>
> Retrieves one topic in a model by name
>
> Retrieves a single topic in the model selected by [`pickModel`](#pick-model) by name, using the [Retrieve a topic API](https://docs.omni.co/api/topics/retrieve-a-topic.md).
>
> Results are limited to 1,000,000 characters. A large topic can be cut off.

> [accordion] listModelTopics
>
> Lists a model's topics
>
> Lists every topic in the model selected by [`pickModel`](#pick-model), including composite topics, using the [List topics API](https://docs.omni.co/api/topics/list-topics.md).
>
> Call this tool to see the topics a model has, or before building a [`runQuery`](#run-query) payload. [`pickTopic`](#pick-topic) already selects one topic for a query and can't list them.

> [accordion] getModelViews
>
> Lists the views in a model
>
> Lists every view in the model selected by [`pickModel`](#pick-model).
>
> This tool is useful for identifying the view a field is in if a topic doesn't include the field. Pass `detail: full` to also include each view's fields. To list a single topic's views and fields, use [`getModelTopic`](#get-model-topic) instead.
>
> Results are limited to 1,000,000 characters. On a large model, a `detail: full` result can be cut off.

> [accordion] listDocumentQueries
>
> Lists saved queries in a document
>
> > [!NOTE]
> >
> > The [Content access setting](https://docs.omni.co/ai/settings/mcp.md#content-access) must be enabled to use this tool.
>
> Lists the saved queries in a document, such as a workbook or app. This tool is designed to pair with [`searchContent`](https://docs.omni.co/ai/mcp/tools/browse-content#search-content) — search finds the document; this tool shows the queries it contains.
>
> Each query's response also includes the field names it selects (`fields`) and already filters on (`filterFields`), so you can copy the exact field names a `runSavedQuery` filter override needs to target. When set on the query, the response also includes `description` and `subTitle`, so you can tell near-identical queries apart instead of guessing from their names alone.

> [accordion] runSavedQuery
>
> Runs a saved query and returns the results
>
> > [!NOTE]
> >
> > The [Content access setting](https://docs.omni.co/ai/settings/mcp.md#content-access) must be enabled to use this tool.
>
> Executes a saved query by ID and returns the current results as JSON. This tool is designed for pulling consistent, model-aware data from a known query rather than generating a new query.
>
> An optional `filters` object, keyed by field name, replaces the saved filter on each named field for that run only; the saved query itself is never changed. Use [`listDocumentQueries`](#list-document-queries) to get the field names a filter can target.
>
> If an invalid or inaccessible `queryId` is provided, the tool returns an error without listing tile names to prevent information disclosure beyond impersonation scope. Use [`listDocumentQueries`](#list-document-queries) to retrieve valid `queryId` values for a document.

> [accordion] getModelAiAgentActions
>
> Lists the sample queries and skills configured on a model
>
> Lists the sample queries and skills configured on the model selected by [`pickModel`](#pick-model) and on its topics, using the [Get model AI agent actions API](https://docs.omni.co/api/models/get-model-ai-agent-actions.md). Each one has a label, a description, and a prompt, so an AI client can show them as suggested questions.

## Related

* [MCP server tools](https://docs.omni.co/ai/mcp/tools) - See every tool group and the settings each requires
* [Omni MCP settings](https://docs.omni.co/ai/settings/mcp.md) - Turn groups of tools on or off for your organization
