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

# Tools Reference

> Complete reference for all MCP server tools

## Sofia

### consult\_sofia

Delegate a read-only evaluation question to Sofia. Sofia can use Coval product knowledge and inspect
the authenticated organization's runs, simulations, conversations, metrics, agents, personas,
test sets, and dashboards. It cannot create, update, run, or delete resources.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `prompt` | string | **Yes** | Question or task for Sofia, up to 12,000 characters |
| `conversation` | object\[] | No | Up to 12 prior messages needed for context |
| `session_id` | string | No | Stable, non-secret caller session identifier, up to 128 letters, numbers, `.`, `_`, `:`, or `-` characters |

> [!NOTE]
>
> In ChatGPT, `consult_sofia` takes a single standalone `prompt` of up to 4,000 characters and no
> conversation context. Include the exact facts the question needs in the prompt itself. Other MCP
> clients use the full parameters below.

Each `conversation` item must contain exactly the message content needed for the current request:

| Field | Type | Required | Limits |
| - | - | - | - |
| `role` | string | **Yes** | `user` or `assistant` |
| `content` | string | **Yes** | Non-empty text, up to 12,000 characters |

Do not include API keys, access tokens, or other secrets in conversation context or `session_id`.
For service reliability and evaluation, Coval records the `prompt`, the optional `conversation`
messages supplied to this tool, and Sofia's response. Messages elsewhere in the parent Claude,
Codex, or other client session are not sent to Coval unless the client includes them in this tool
call.

Use direct tools for deterministic reads and writes. Use `consult_sofia` when the task benefits from
evaluation expertise or synthesis across several Coval resources.

**Complete run transcript exports.** When you ask Sofia for the complete transcripts of a run,
`consult_sofia` can collect every call in the run and return an authenticated MCP `resource_link`
(`coval://run-transcripts/{run_id}/{snapshot}`) that MCP clients can read with `resources/read`.

* **Default workspace and live authorization:** Exports use the authenticated organization's Default
  workspace and re-check authorization on every read. The URI carries identifiers and fingerprints,
  not credentials or a public download token, and is reconstructed from current API reads rather
  than stored as a historical snapshot.
* **Collection bounds:** Up to 100 calls, 2 MiB of serialized content, and a 30-second collection
  deadline. Exceeding any bound fails explicitly rather than returning a partial sample.
* **Export contents:** Preserves source order, original transcript fields, timing, tool ownership,
  and explicit per-call unavailable reasons when an individual transcript is missing.

### read\_transcript\_export

Read an authenticated run transcript export in fragments when native MCP `resource_link` reads are
unavailable. Concatenate the returned `text` fragments in order—preserving whitespace—using
`next_offset` as `offset` and `version` as `expected_version` until `complete` is `true`, then
JSON-decode the assembled document. If the underlying transcript source changes between fragments,
continuation fails rather than mixing versions.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `uri` | string | **Yes** | Transcript export resource URI (`coval://run-transcripts/{run_id}/{snapshot}`, up to 60,000 chars) |
| `offset` | number | No | Starting Unicode code-point offset (`>= 0`, default: `0`) |
| `max_chars` | number | No | Maximum Unicode code points to return (`1`–`65536`, default: `4000`) |
| `expected_version` | string | No | 43-character version fingerprint returned by the first fragment. Required when `offset > 0` |

***

## Run Management

### list\_runs

List evaluation runs with filtering and pagination.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `page_size` | number | No | Results per page (1-100, default: 50) |
| `page_token` | string | No | Pagination token from previous response |
| `order_by` | string | No | Sort order (e.g., `-create_time` for newest first) |
| `filter` | string | No | Filter expression (e.g., `status="COMPLETED"`) |

### get\_run

Get detailed information about a specific run.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `run_id` | string | **Yes** | The unique run ID |

Returns run details including status, progress, and metrics (if completed).

### create\_run

Launch a new evaluation run.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `agent_id` | string | **Yes** | Agent ID from `list_agents` |
| `persona_id` | string | **Yes** | Persona ID from `list_personas` |
| `test_set_id` | string | **Yes** | Test set ID from `list_test_sets` |
| `metric_ids` | string\[] | No | Specific metrics to evaluate |
| `options.iteration_count` | number | No | Iterations per test case (1-10, default: 1) |
| `options.concurrency` | number | No | Parallel simulations (1-5, default: 1) |
| `tags` | string\[] | No | Up to 20 tags, 200 characters each |
| `metadata` | object | No | Custom metadata for tracking |

***

## Agent Management

### list\_agents

List all configured agents.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `page_size` | number | No | Results per page (1-100, default: 50) |
| `page_token` | string | No | Pagination token |
| `order_by` | string | No | Sort order |
| `filter` | string | No | Filter by `model_type`, `display_name`, etc. |

### get\_agent

Get detailed configuration for a specific agent.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `agent_id` | string | **Yes** | Agent ID from `list_agents` |

### create\_agent

Create a new agent configuration. Supply the connection field that matches the selected `model_type`.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `display_name` | string | **Yes** | Human-readable name (1-200 chars) |
| `model_type` | string | **Yes** | Agent type (see below) |
| `phone_number` | string | No | Required for `MODEL_TYPE_VOICE` (E.164 phone number or `sip:user@host` address) and `MODEL_TYPE_SMS` (E.164 phone number only); omit for other model types |
| `endpoint` | string | No | Required `http://` or `https://` URL for `MODEL_TYPE_OUTBOUND_VOICE` and `MODEL_TYPE_CHAT`, or `wss://` URL for `MODEL_TYPE_WEBSOCKET` (up to 200 chars); omit for `MODEL_TYPE_VOICE` and `MODEL_TYPE_SMS` |
| `prompt` | string | No | System prompt or instructions (1-12,000 chars) |

**Model Types:**

* `MODEL_TYPE_VOICE` - Inbound voice
* `MODEL_TYPE_OUTBOUND_VOICE` - Outbound voice
* `MODEL_TYPE_CHAT` - Chat/text
* `MODEL_TYPE_SMS` - SMS messaging
* `MODEL_TYPE_WEBSOCKET` - WebSocket

### update\_agent

Update an existing agent configuration. Only provided fields are updated, and at most one
model-specific connection field may be updated per call.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `agent_id` | string | **Yes** | Agent to update |
| `display_name` | string | No | New display name (1-200 chars) |
| `phone_number` | string | No | New E.164 phone number for a `MODEL_TYPE_VOICE` or `MODEL_TYPE_SMS` agent, or SIP address for a `MODEL_TYPE_VOICE` agent |
| `outbound_voice_endpoint` | string | No | New `http://` or `https://` webhook endpoint for a `MODEL_TYPE_OUTBOUND_VOICE` agent |
| `chat_endpoint` | string | No | New `http://` or `https://` message endpoint for a `MODEL_TYPE_CHAT` agent |
| `websocket_endpoint` | string | No | New `wss://` connection endpoint for a `MODEL_TYPE_WEBSOCKET` agent |
| `prompt` | string | No | New system prompt (1-12,000 chars) |

***

## Test Set Management

### list\_test\_sets

List all test sets available for evaluation.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `page_size` | number | No | Results per page (1-100, default: 50) |
| `page_token` | string | No | Pagination token |
| `order_by` | string | No | Sort order |
| `filter` | string | No | Filter expression |

### get\_test\_set

Get detailed information about a test set.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `test_set_id` | string | **Yes** | Test set ID from `list_test_sets` |

### create\_test\_set

Create a new test set.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `display_name` | string | **Yes** | Test set name (1-100 chars) |
| `slug` | string | No | URL-friendly ID (auto-generated if omitted) |
| `description` | string | No | Test set description |
| `test_set_type` | string | No | `DEFAULT`, `SCENARIO`, `TRANSCRIPT`, or `WORKFLOW` |
| `test_set_metadata` | object | No | Configuration metadata |
| `parameters` | object | No | Test parameterization |

***

## Test Case Management

### list\_test\_cases

List test cases with optional filtering by test set.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `page_size` | number | No | Results per page (1-100, default: 50) |
| `page_token` | string | No | Pagination token |
| `order_by` | string | No | Sort order |
| `filter` | string | No | Filter expression, for example `test_set_id="abc12345"` |

### get\_test\_case

Get detailed information about a test case.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `test_case_id` | string | **Yes** | Test case ID from `list_test_cases` |

### create\_test\_case

Create a new test case in a test set.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `test_set_id` | string | **Yes** | Eight-character test set ID |
| `input_str` | string | **Yes** | Scenario or input presented to the agent |
| `expected_behaviors` | string\[] | No | Behaviors expected from the agent |
| `description` | string | No | Test case description |
| `input_type` | string | No | `SCENARIO` (default), `TRANSCRIPT`, `IVR`, `AUDIO`, `MANUAL`, or `SCRIPT` |
| `simulation_metadata_input` | object | No | Context passed to the simulation environment. For `SCRIPT` cases, put the ordered turns in `script_turns` (see below) |
| `metric_input` | object | No | Custom metric inputs |
| `user_notes` | string | No | Internal notes |

**Scripted test cases.** With `input_type` set to `SCRIPT`, the simulated user follows an exact sequence
of turns instead of improvising from a scenario. Put the turns, in order, in
`simulation_metadata_input.script_turns`. Each entry is either a plain string the simulated user
speaks verbatim, a keypad press `{"type": "dtmf", "digits": "1"}` (digits may contain `0-9`, `*`, `#`,
and phone punctuation for full numbers), or `{"type": "skip"}` to stay silent for one turn.

```json theme={null}
{
  "test_set_id": "abc12345",
  "input_type": "SCRIPT",
  "input_str": "Navigate the billing IVR to a live agent",
  "simulation_metadata_input": {
    "script_turns": [
      "Hi, I have a question about my bill.",
      { "type": "dtmf", "digits": "2" },
      "I'd like to speak to someone about a duplicate charge."
    ]
  }
}
```

> [!WARNING]
>
> Never write a keypad press as spoken text such as `dtmf:1` or "press one": the simulated user
> would read it aloud. Use a `{"type": "dtmf", "digits": "..."}` turn. For `SCENARIO` cases against
> a phone tree, instruct the simulated user in `input_str` to press keys instead.

### update\_test\_case

Update an existing test case.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `test_case_id` | string | **Yes** | Test case to update |
| `input_str` | string | No | Updated scenario or input |
| `expected_behaviors` | string\[] | No | Updated expected behaviors |
| `description` | string | No | New description |
| `input_type` | string | No | Updated input type. Switching away from `SCRIPT` clears the stored turns |
| `script_turns` | array | No | Replacement turn list for `SCRIPT` cases, using the same entry shapes as `create_test_case`. Merged into the stored simulation metadata, so sibling keys are preserved |
| `simulation_metadata_input` | object | No | Updated simulation context. Replaces the stored object wholesale, so include every key you want to keep |
| `metric_input` | object | No | Updated metric inputs |
| `user_notes` | string | No | Updated internal notes |

To change the turns of a scripted case, prefer the top-level `script_turns` field. If you send both
`script_turns` and `simulation_metadata_input`, the object is replaced first and the turns are then
merged into the result, so `script_turns` always wins for that key.

***

## Metrics

### list\_metrics

List available evaluation metrics.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `page_size` | number | No | Results per page (1-100, default: 50) |
| `page_token` | string | No | Pagination token |
| `order_by` | string | No | Sort order |
| `filter` | string | No | Filter expression |
| `include_builtin` | boolean | No | Include built-in metrics |

### get\_metric

Get detailed configuration for a specific metric.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `metric_id` | string | **Yes** | Metric ID from `list_metrics` |

### Python Metric Draft Workflow

Python metrics follow a three-step workflow so every published metric is backed by tested code:

1. **Create an immutable draft** (`create_python_metric_draft`) with Python `source` defining
   `evaluate(conversation)` that returns a finite `number` or `boolean`. Any change to source or
   input/output settings requires creating a new draft.
2. **Preview on a conversation** (`create_python_metric_preview`, then poll
   `get_python_metric_preview`) against a historical simulation output until the preview reaches a
   terminal state.
3. **Publish the approved draft** (`publish_python_metric_draft`) by supplying 1–10 successful
   preview IDs for that exact draft together with its 64-character hex `fingerprint`.

### create\_python\_metric\_draft

Create an immutable Python metric draft.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `display_name` | string | **Yes** | Display name for the metric (1-200 chars) |
| `source` | string | **Yes** | Python source defining `evaluate(conversation)` (1-65,536 chars) |
| `output_type` | string | **Yes** | Scalar return type: `number` or `boolean` |
| `description` | string | No | What the metric measures (up to 4,000 chars) |
| `unit` | string \| null | No | Optional display unit (up to 64 chars), or `null` for unitless |
| `target_metric_id` | string \| null | No | Existing Python metric ID to revise, or `null` to create a new metric |
| `target_version_id` | string \| null | No | Expected current version ID when revising an existing metric, or `null` for a new metric |
| `requirements.audio` | boolean | No | Whether audio input is required |
| `requirements.traces` | boolean | No | Whether trace input is required |
| `requirements.frame_tables` | string\[] | No | Required frame table names (up to 32) |

### get\_python\_metric\_draft

Get an immutable Python metric draft and its 64-character hex `fingerprint`.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `draft_id` | string | **Yes** | Immutable Python metric draft ID |

### create\_python\_metric\_preview

Start an asynchronous preview of a Python metric draft against a historical simulation or uploaded
conversation. Poll `get_python_metric_preview` until the preview reaches a terminal state.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `draft_id` | string | **Yes** | Immutable Python metric draft ID |
| `simulation_output_ids` | string\[] | **Yes** | Single-element array (`[simulation_output_id]`) identifying the conversation to evaluate |

### get\_python\_metric\_preview

Get the current state and result of an asynchronous Python metric preview.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `draft_id` | string | **Yes** | Immutable Python metric draft ID |
| `preview_id` | string | **Yes** | Asynchronous preview ID from `create_python_metric_preview` |

### cancel\_python\_metric\_preview

Cancel an in-progress Python metric preview.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `draft_id` | string | **Yes** | Immutable Python metric draft ID |
| `preview_id` | string | **Yes** | Asynchronous preview ID to cancel |

### publish\_python\_metric\_draft

Publish the exact immutable Python metric draft identified by its `fingerprint` using successful
preview IDs from that draft.

> [!WARNING]
>
> Publishing a draft whose `target_metric_id` points to an existing metric revises that metric.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `draft_id` | string | **Yes** | Immutable Python metric draft ID |
| `preview_ids` | string\[] | **Yes** | 1-10 successful preview IDs for this exact draft |
| `fingerprint` | string | **Yes** | 64-character lowercase hex fingerprint from the draft |

***

## Reports

These tools work with saved run-comparison [Reports](https://docs.coval.ai/concepts/simulations/reports.md).

### list\_reports

List saved reports in the organization.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `page_size` | number | No | Reports per page (1-100, default: 50) |
| `page_token` | string | No | Pagination token from previous response |

### get\_report

Get one saved report with a bounded page of its result rows.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `report_id` | string | **Yes** | Report ID from `list_reports` |
| `page_size` | number | No | Result rows per page (1-100, default: 20) |
| `page_token` | string | No | Pagination token from previous response |
| `metric_ids` | string\[] | No | Limit row data to these metrics (up to 20) |

Row data is trimmed to fit the response budget. When the response flags that output was trimmed,
narrow it with `metric_ids` and a smaller `page_size`, then continue with `next_page_token`. Check
`scope.has_more` before treating the report as complete.

### create\_report

Save a report over a set of runs. Reports created through the connector are private to your
organization.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `name` | string | **Yes** | Report name (1-200 chars) |
| `run_ids` | string\[] | **Yes** | Runs to include (1-200) |
| `compare_by` | string | No | `none`, `run`, `agent`, `mutation`, `persona`, `test_case`, or `metadata` |
| `metadata_key` | string | No | Metadata key to compare by. Required when `compare_by` is `metadata`, and not allowed otherwise |
| `view_mode` | string | No | `rows` or `grouped` |

***

## Scheduling

### list\_run\_templates

List reusable run configurations that a schedule can execute.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `page_size` | number | No | Templates per page (1-100, default: 50) |
| `page_token` | string | No | Pagination token from previous response |

### list\_scheduled\_runs

List recurring evaluation schedules.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `page_size` | number | No | Schedules per page (1-100, default: 50) |
| `page_token` | string | No | Pagination token from previous response |
| `enabled` | boolean | No | Only enabled (`true`) or disabled (`false`) schedules |
| `template_id` | string | No | Only schedules that use this run template |

### get\_scheduled\_run

Get one schedule and a page of the runs it has triggered.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `scheduled_run_id` | string | **Yes** | Schedule ID from `list_scheduled_runs` |
| `history_size` | number | No | Triggered runs per page (1-100, default: 20) |
| `history_page_token` | string | No | Pagination token from `next_history_page_token` |

History is served from the schedule's most recent 500 runs. `history_scope.upstream_capped` is set
when older runs exist beyond that window.

### create\_scheduled\_run

Create a recurring evaluation schedule from a run template.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `display_name` | string | **Yes** | Schedule name (1-200 chars) |
| `run_template_id` | string | **Yes** | Run template from `list_run_templates` |
| `schedule_expression` | string | **Yes** | `rate(...)` or six-field `cron(...)` expression, for example `rate(1 day)` or `cron(0 9 ? * MON-FRI *)`. Five-field cron is not accepted |
| `schedule_timezone` | string | No | Timezone for cron schedules, such as `UTC` or `America/Los_Angeles`. Required when `schedule_expression` uses `cron(...)` |
| `enabled` | boolean | No | Activate the schedule immediately (default: `false`) |

> [!WARNING]
>
> New schedules are created disabled. Enabling a schedule starts recurring evaluation work, which
> consumes simulation capacity on every trigger until you disable it.

### update\_scheduled\_run

Update selected fields on an existing schedule. Provide at least one field besides the ID.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `scheduled_run_id` | string | **Yes** | Schedule to update |
| `display_name` | string | No | New name (1-200 chars) |
| `run_template_id` | string | No | Run template to execute |
| `schedule_expression` | string | No | New `rate(...)` or six-field `cron(...)` expression |
| `schedule_timezone` | string | No | Timezone for cron schedules. Required when changing to a `cron(...)` expression |
| `enabled` | boolean | No | Enable or disable the schedule |

***

## Personas

### list\_personas

List available simulated personas for testing.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `page_size` | number | No | Results per page (1-100, default: 50) |
| `page_token` | string | No | Pagination token |
| `order_by` | string | No | Sort order |
| `filter` | string | No | Filter expression |

### get\_persona

Get detailed configuration for a specific persona.

| Parameter | Type | Required | Description |
| - | - | - | - |
| `persona_id` | string | **Yes** | Persona ID from `list_personas` |

Returns persona configuration including voice settings, language, and behavior.


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