# Apify MCP agent evaluation tool

> Builds tests that check an AI agent uses Apify tools correctly.

- **What it does:** Helps you build a small set of automated tests that check whether an AI agent uses the Apify MCP server's tools correctly. When tests fail, it helps you decide whether the test, the tool, or its description needs fixing.
- **Agents:** Claude Code and Codex (through orbit-connect), Claude and ChatGPT (through the Orbit connector)
- **Install:** `npx -y --loglevel=error orbit-connect@0.3.33 install skl_c2bb86fcaf6a27baabfee961`
- **Creator:** Mariah Brunner (@itsmariahbrunner) on Instagram
- **Reach:** Creators' posts about it have 15,154 views
- **Safety:** Checked by Orbit: nothing risky found in what it runs or reads
- **Last updated:** 2026-11-14
- **Page:** https://orbitinbox.app/s/apify-mcp-agent-evaluation-guide

## What you'll need

- Langfuse: stores the eval datasets, traces and scores
- Apify: the MCP server being tested runs real Apify tools and Actors against your account

## Skill

---
name: creating-mcp-agent-evals
description: Use when writing Langfuse evals for an MCP tool family, or diagnosing failing eval cases to decide if the case, tool, or description is at fault.
---

# Creating MCP agent evals

## What this does
Builds a small, calibrated Langfuse eval suite for one MCP tool family, then uses its failures to fix the tools. Core principle: **evals are designed from user intent, never from tool descriptions**. Descriptions get fixed afterward so naive agents pass.

## When to use
- Adding evals for a tool family (tasks, storage, runs, ...).
- Eval cases fail and you must decide whether the case, the tool or its description is at fault.
- Eval runs show tool errors in Langfuse traces.

## How to run it
1. **Inventory the tools.** Every tool and argument group needs at least one case.
2. **Probe the platform first.** Verify API behavior (required fields, uniqueness, limits, errors) with a throwaway script against the real API before writing any case that depends on it.
3. **Two datasets, one per CI gate.** `mcp-server-evals-pr` holds `kind: "tool-call"` items (single-turn, only the first tool call asserted, no judge). `mcp-server-evals-merge` holds `kind: "agent"` items (multi-turn, scored by an LLM judge). Tool-call cases set `expectedTools` and optionally `expectedArgs` (flat object; listed keys must deep-equal). Agent cases that provoke an error on purpose set `metadata.expectedErrors` to the tool names allowed to fail. Item ids: `pr/<tool>/<slug>` or `merge/<family>/<slug>`.
4. **Write cases in waves:** 2-3 easy, 1-2 medium (chains), 2-3 hard (vague language, error recovery, collisions). Run and review each wave before the next.
5. **Calibrate on the strongest model first.** A failure there is a case defect or product gap, not a description problem.
6. **Ladder down** (Sonnet, then Haiku). Pass on strong and fail on weak means the description or output doesn't carry a naive agent.
7. **Fix tools via outputs before descriptions.** A steering sentence in the tool response reaches every agent on every call.

Diagnose a failed case in this order (read the transcript first; the judge's one-liner is only a hint):
- **Case:** query needs context the agent can't get, or input violates the schema. Rewrite self-contained.
- **Judge/reference:** reference demands what the judge can't observe. Reword `expectedOutput`.
- **Product:** tool can't satisfy a natural request. Surface as a decision.
- **Description/output:** model stalls, guesses, or misreads a field. Output nudge first, then description.
- **World:** live target is down or empty. Use stable hosts; make references outage-tolerant.
- **Model:** policy-shaped refusal or stubborn habit. Scope the deliverable down, or document the residual and stop tuning.

Rules:
- References are judge-checkable contracts: "PASS only if `<tool>` was called with `<arg>` and the final answer states `<fact>`. FAIL if ...".
- Write queries in user language; hard cases never name a tool.
- Never downgrade span levels to hide errors; use `metadata.expectedErrors`. The gate is zero tool errors on MCP calls except named ones.
- The judge never sees tool results; write references that pre-empt misreadings.
- Fail false claims, not etiquette.
- Tool-call cases must accept every defensible tool: list both in `expectedTools`.
- Probe live-web targets at authoring time.
- State is account-global: use `eval-` prefixes and `{{uniq}}` in every created name, in the query and the reference. Make each conversation self-contained.
- Dataset item ids are project-unique forever.

Red flags: writing a case while reading the tool description; an error-provoking agent case with no `expectedErrors`; a rerun that "fixed" an undiagnosed failure; editing a tool after one model failed once; fake URLs like `example.com` in queries; demanding long verbatim reproduction; `maxTurns` too low for chain cases.

## Output
- Eval dataset items for the tool family, plus a coverage matrix showing every tool and argument group is covered.
- Per-model pass results and, for each failure, a diagnosis (case, judge, product, description, world or model) with the fix applied.

## Credit
Based on public content by apify, packaged by Orbit.

Shared by Mariah Brunner, credited on Orbit.