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

# Query tools

> MCP tools to run and manage queries

Run and manage natural-language queries inside the session's workspace. The tools do not take a `workspace_id`: with OAuth the workspace comes from your access token, and with an API key you pass it in the `AiQL-Workspace` header. See [Workspace scope](/mcp/overview#workspace-scope).

## list\_queries

Lists queries in the authenticated workspace.

| Parameter | Type      | Description                                                                                                              |
| --------- | --------- | ------------------------------------------------------------------------------------------------------------------------ |
| `limit`   | `integer` | Optional. Maximum number of items to return per page. Defaults to `20`, maximum `100`. See [Pagination](/pagination).    |
| `cursor`  | `string`  | Optional. Opaque cursor pointing to the page to fetch. Omit to start from the first page. See [Pagination](/pagination). |

## create\_query

Runs a natural-language query against the authenticated workspace.

| Parameter | Type     | Description                            |
| --------- | -------- | -------------------------------------- |
| `content` | `string` | Natural-language content of the query. |

## get\_query

Retrieves a single query and its result.

| Parameter | Type     | Description                  |
| --------- | -------- | ---------------------------- |
| `id`      | `string` | ID of the query to retrieve. |

## delete\_query

Deletes a query.

| Parameter | Type     | Description                |
| --------- | -------- | -------------------------- |
| `id`      | `string` | ID of the query to delete. |
