# MCP tools

> The tools of the MCP server and the assistant.

<!-- Generated by `just gen` from internal/ai/tools.go. Do not edit this file. -->

This page lists the tools of the MCP server at `/mcp`. The assistant in the web UI uses the same tools.

A tool runs with the role of the API token. A mutating tool runs at once over MCP; in the assistant it waits for your confirmation. Results of execution tools are masked: a secret value shows as `***`.

| Tool | Role | Mutating | MCP | Description |
|---|---|---|---|---|
| `list_namespaces` | viewer | no | yes | List all namespaces with their source type. |
| `list_flows` | viewer | no | yes | List the flows of a namespace and its children. An empty namespace lists all flows. |
| `get_flow` | viewer | no | yes | Read one flow with its YAML source. |
| `validate_flow` | viewer | no | yes | Validate the content of a flow or namespace file against the head version of the namespace. |
| `list_files` | viewer | no | yes | List the files of the head version of a namespace. |
| `read_file` | viewer | no | yes | Read one file of the head version of a namespace. |
| `list_executions` | viewer | no | yes | List recent executions, newest first. Filters: namespace, flow as &lt;namespace&gt;/&lt;flow_id&gt;, comma-separated states. |
| `get_execution` | viewer | no | yes | Read one execution with its task runs. |
| `get_logs` | viewer | no | yes | Read the last log lines of an execution, optionally of one task. tail is 1 to 1000, default 200. grep keeps the lines that contain the text, case-insensitive. failed_only keeps the lines of the task runs that failed or timed out. |
| `get_metrics` | viewer | no | yes | Read the metrics of an execution. |
| `get_insight` | viewer | no | yes | Read the latest failure triage of an execution. |
| `trigger_execution` | operator | yes | yes | Start a flow with inputs and labels. |
| `cancel_execution` | operator | yes | yes | Cancel a running execution. |
| `rerun_execution` | operator | yes | yes | Start a new execution with the same snapshot, definition and inputs as another execution. The other execution can still run. |
| `restart_execution` | operator | yes | yes | Start a new execution that reuses the successful task runs of an ended execution that did not succeed. Only the failed, timed out, cancelled and skipped tasks run again. |
| `get_flow_schema` | viewer | no | yes | Read the JSON Schema of flow files (*.flow.yaml). Use it to write a valid flow. |
| `propose_change` | editor | no | no | Propose file changes of a namespace. The result has the validation issues and a diff. Nothing is written. |
| `apply_change` | editor | yes | yes | Apply file changes: a new version of a managed namespace, or a new branch of a git namespace. Invalid flows are refused. |

## list_flows

| Argument | Type | Required | Description |
|---|---|---|---|
| `namespace` | string | no |  |

## get_flow

| Argument | Type | Required | Description |
|---|---|---|---|
| `flow_id` | string | yes |  |
| `namespace` | string | yes |  |

## validate_flow

| Argument | Type | Required | Description |
|---|---|---|---|
| `content` | string | yes |  |
| `namespace` | string | yes |  |
| `path` | string | yes |  |

## list_files

| Argument | Type | Required | Description |
|---|---|---|---|
| `namespace` | string | yes | Namespace name. |

## read_file

| Argument | Type | Required | Description |
|---|---|---|---|
| `namespace` | string | yes |  |
| `path` | string | yes |  |

## list_executions

| Argument | Type | Required | Description |
|---|---|---|---|
| `flow` | string | no |  |
| `limit` | integer | no |  |
| `namespace` | string | no |  |
| `state` | string | no |  |

## get_execution

| Argument | Type | Required | Description |
|---|---|---|---|
| `execution_id` | string | yes | Execution UUID. |

## get_logs

| Argument | Type | Required | Description |
|---|---|---|---|
| `execution_id` | string | yes |  |
| `failed_only` | boolean | no | Keep the lines of failed and timed out task runs. |
| `grep` | string | no | Keep the lines that contain this text, case-insensitive. |
| `tail` | integer | no |  |
| `task` | string | no |  |

## get_metrics

| Argument | Type | Required | Description |
|---|---|---|---|
| `execution_id` | string | yes | Execution UUID. |

## get_insight

| Argument | Type | Required | Description |
|---|---|---|---|
| `execution_id` | string | yes | Execution UUID. |

## trigger_execution

| Argument | Type | Required | Description |
|---|---|---|---|
| `flow_id` | string | yes |  |
| `inputs` | object | no |  |
| `labels` | object | no |  |
| `namespace` | string | yes |  |

## cancel_execution

| Argument | Type | Required | Description |
|---|---|---|---|
| `execution_id` | string | yes | Execution UUID. |

## rerun_execution

| Argument | Type | Required | Description |
|---|---|---|---|
| `execution_id` | string | yes | Execution UUID. |

## restart_execution

| Argument | Type | Required | Description |
|---|---|---|---|
| `execution_id` | string | yes | Execution UUID. |

## propose_change

| Argument | Type | Required | Description |
|---|---|---|---|
| `files` | array | yes |  |
| `message` | string | yes | Version or commit message. |
| `namespace` | string | yes |  |

## apply_change

| Argument | Type | Required | Description |
|---|---|---|---|
| `files` | array | yes |  |
| `message` | string | yes | Version or commit message. |
| `namespace` | string | yes |  |
