MCP tool use#
Replays small fake threads on Claude and Codex models and checks how they use T3's MCP tools: delegation, PR linking, previews, scheduling, and more. Each case reproduces a real mistake an agent made in T3 Code.
The model sees what it sees in T3 Code. A trimmed capture of a real harness turn supplies the harness prompt and native tools. T3's instructions, tool descriptions, and schemas come from this checkout. A cheap model plays the shell, so nothing runs on your machine.
Run#
cd evals
pnpm mcp-tool-use --case review-round-uses-thread-send --samples 1 --out runs/check
pnpm mcp-tool-use --model claude-opus-5-5 --out runs/opus
ANTHROPIC_API_KEYin the repo root.envpays for Claude models and the Haiku shell simulator.- Codex models (
gpt-*inMODELSinrun.ts) go through a CLIProxyAPI server, set up as thevibeproxymodel provider in~/.codex/config.toml. Keep the proxy under about 12 samples in flight across all runs. - Flags:
--case <ids>,--cases <file.ndjson>,--samples <n>(default 2, and a 3rd when the first 2 disagree),--concurrency <n>(samples in flight, default 8),--max-steps <n>,--effort <level>,--dry-run(prints request bodies, no model calls), and--context(prints the size of T3's text and schemas, no key needed). --baseline <results.jsonl> --stop-on-regressionstops as soon as a case that passed every baseline sample fails. Use it to test one copy change against a baseline run.- Cost: a full Sonnet run is about $9, and a full Opus run about $17. Codex models through the proxy cost only the shell simulator.
Add a case#
Cases are JSON lines in cases/, one file per area. The case schema in run.ts (McpToolUseCase) documents every field.
kind:badreproduces a mistake,guardprotects correct behavior,controlis ordinary work.experience: the real mistake, in a sentence.source: where it happened.setup: the fake thread, itsworld(repo, branch, files, PRs, pages),priorTurns, andmocksfor tool results.expect: the checks, such ascalls,callsMustNot,maxCalls,order,textMust, andlinked.
Check that the case builds with --dry-run --case <id>. Then run it on the text before your fix, where it must fail, and on the text after, where it must pass.
Where T3's text lives#
packages/provider-core/src/server/runtimeInstructions.tspackages/provider-core/src/server/orchestrationInstructions.tsapps/server/src/provider/CodexDeveloperInstructions.tsapps/server/src/mcp/toolkits/*/tools.ts(tool descriptions)packages/contracts/src/*Mcp.ts(parameter descriptions and result text)
Templates#
templates/ holds one trimmed capture per harness. Refresh them when a harness changes its prompt or native tools:
- Capture one T3 Code turn through CLIProxyAPI, with T3's MCP server connected.
- From
evals/, runpnpm mcp-tool-use:trim-capture <claude|codex> <capture.json> mcp-tool-use/templates/<claude|codex>.json.gz. It keeps only whatrun.tsreads, and removes user instructions, the user's own skills and agents, account ids, and home paths. - Read the output for user data before you commit it:
zcat <file> | less. - Run the full eval on the old and new templates, and compare.