# Evaluation

`mb eval` (alias: `mb evaluation`) scores an agent's output — a file of executed test cases — against one or more metrics.

```bash
# Create evaluation (upload executed benchmark + wait)
# --file must be a JSONL file (newline-delimited JSON, one object per line)
# At least one of --metrics or --custom-metrics is required
# --benchmark is optional (links eval to a benchmark); alternatively use --corpus
mb eval create "My Eval" --file executed.jsonl --metrics m1,m2 [--benchmark <id>] [--corpus <id>]

# Score with a custom (prompt-based) metric instead of, or alongside, system ones
mb eval create "My Eval" --file executed.jsonl --custom-metrics <metric-id>
mb eval create "My Eval" --file executed.jsonl --metrics ground_truth_alignment --custom-metrics <metric-id>

# Manage evaluations
mb eval list [--benchmark <id>]
mb eval get <id>
mb eval update <id> --name "Updated"
mb eval delete <id>

# Download evaluation results (single JSON file with scores and metrics)
mb eval download <id> -o results.json

# Download the original uploaded agent output file (distinct from the results above)
mb eval download-agent-output <id> -o agent-output.jsonl

# Add metrics to an existing, READY evaluation (must not already carry them)
mb eval add-metrics <id> --metrics refusal
mb eval add-metrics <id> --custom-metrics <metric-id>

# Wait for evaluation
mb eval wait <id>
```

`mb eval create` uploads the file and, unless `--no-wait` is set, polls until
the evaluation reaches `ready` or `failed` — see [Polling and Waiting](index.md#polling-and-waiting).
If the benchmark's category discovery is still running, the evaluation stays `processing` after scoring
until discovery finishes (up to 60 minutes), so the wait can outlast the default timeout; run
`mb eval wait <id>` to keep waiting.
See [List Filtering](index.md#list-filtering) for the flags shared by every
`list` command.

**Metric names.** `--metrics` takes the API metric identifiers — lower-case
`snake_case` values such as `ground_truth_alignment`, `query_relevance`,
`tool_call_correctness` — **not** the display labels shown in the web UI
("Ground Truth Alignment"). This is the intended wire format. Run `mb metrics
list` to list the exact accepted names (alongside any custom metrics); pass
several comma-separated: `--metrics ground_truth_alignment,query_relevance`.

**Custom metrics.** `--custom-metrics` takes one or more custom metric IDs
(comma-separated), not names — run `mb metrics list` to find them (they're
tagged `type: custom`). See [Metrics](metric.md) for creating and managing
custom metrics.

**`add-metrics` vs. re-running `create`.** `add-metrics` re-uses the
originally uploaded file and merges the new metric's results into the
existing evaluation record, rather than creating a second evaluation. It only
works while the evaluation is `READY` and only for metrics not already on it.

## Next steps

- Define your own scorer with [Metrics](metric.md), then pass its ID via `--custom-metrics`.
- Prefer a UI-driven workflow instead? See the [UI Guide: Evaluations](../ui-guide/evaluations.md).