Skip to content

MCP Recipes

Pro

Monitor a Model for Drift Over Time

Stand up a scheduled benchmark, then have your agent reconcile each run against the baseline and tell you only when quality, cost, or latency moves.

⚠

Agentic and programmatic use. Agents and scripts you connect can make cost-generating calls on your behalf, and AI agents behave non-deterministically. You are responsible for monitoring and bounding your own automation. See Terms for details.

Run it: paste into your MCP agent

Parts in double braces (like {{recipe_id}}) are placeholders. Replace them with your own values before (or after) copying.

Using the LLM Prover MCP tools, set up (or reconcile) ongoing drift monitoring. This recipe keeps ONE standing note as the monitoring anchor. Unlike a one-shot run, the note stays “running” between cycles and is only closed when I end the series.

FIRST, work out whether we are starting a monitor or reconciling an existing one:

  1. Confirm the tools you need are available (list the tools).

  2. Read your standing notes for this recipe: get_agent_notes(recipe_id="{{recipe_id}}").

    • If an active note already exists, we are RECONCILING, so follow the Reconcile steps.
    • If none exists, we are SETTING UP, so follow the Set up steps.

Set up (first time):

  1. Ask me for the prompt and the model(s) to monitor. List the models available to my account first and respect my plan’s model-per-comparison cap; do not exceed it.

  2. Make sure the benchmark is SCORED, or drift in quality cannot be detected: ask me for a gold-standard answer (expected_output) or a saved rubric (rubric_id). If I have neither, offer to help me build a rubric first.

  3. Create a scheduled benchmark (create_benchmark) with the prompt, models, scoring, and a schedule I choose (daily / 4x_daily / hourly; tell me which my plan allows, as the server enforces the cap). Note the suite_id it returns.

  4. Optionally set alert thresholds so regressions are flagged: ask me what I care about (“warn if cost jumps 20% or quality drops 10%”) and translate it with update_benchmark_alerts. These thresholds drive the anomaly_flags you will read later.

  5. Record the standing note as the series anchor:

    put_agent_note(recipe_id="{{recipe_id}}", recipe="mcp-drift-monitor",
      intent="Drift monitor for <model(s)> on <short prompt label>", status="running",
      data={ suite_id: "<the suite_id>" }).
    

    Keep status “running”, because this note is the anchor for the whole series, not a one-shot.

  6. Trigger a first run now (trigger_benchmark_run) to establish the baseline. It returns a JOB id; poll it to completion (poll_job every 5 seconds, stop after 5 minutes). NOTE the job id and the run id are DIFFERENT values: poll_job takes the job id, but diff_runs and the run history use the RUN id. Once complete, call list_benchmark_runs(suite_id) and take the newest run’s run_id, which is your BASELINE run.

  7. Update the note so future sessions can both reconcile and diff against the original baseline: update_agent_note setting job_id= and data={ suite_id, baseline_run_id: “”, last_run_id: “” }, keep status “running”. (Persisting baseline_run_id is what lets a much-later session diff “newest vs original baseline”, not just “newest vs the immediately-prior run”.)

  8. Tell me the baseline numbers per model. Leave the note “running”.

Reconcile (every later session, or when I ask “any drift?”):

  1. From the standing note read note.data: suite_id, baseline_run_id (the original baseline), and last_run_id (the run checked last time).
  2. Pull the recent runs: list_benchmark_runs(suite_id) (newest first). Take the newest run’s run_id. Each run also carries anomaly_flags, which are server-computed regression flags vs the immediately-prior run (cost_spike, latency_regression, score_drop, model_version_change, threshold_breach). Read the newest run’s anomaly_flags FIRST and do not recompute deltas yourself. If the newest run_id equals last_run_id, no new run has happened since you last checked, so say so and stop.
  3. For exact per-model deltas, call diff_runs with run_ids (NOT job ids): by default diff the newest run against baseline_run_id (“drift vs the original baseline”); if I ask “vs last check”, use last_run_id as the baseline instead. It returns per-model deltas (prev, curr, delta, pct for cost / latency / quality / judge) plus regression flags, again server-computed, so never subtract numbers in your head.
  4. For the shape of the trend over many runs, call get_benchmark_trend(suite_id) and read the per-model run_series. (Note: the trend only populates once pass/fail thresholds are set on the benchmark; without thresholds it short-circuits, so rely on diff_runs and anomaly_flags in that case.)
  5. Report in plain language, and BE QUIET WHEN NOTHING MOVED: if there are no flags and no material deltas, say “no drift since the last check” in one line. Only when something actually moved do you lay out which model, which metric, by how much, and since when.
  6. Re-point the standing note for the next cycle: update_agent_note setting data.last_run_id to the newest run_id (and job_id to the newest job id), keep baseline_run_id unchanged, keep status “running”. Do NOT mark it completed, because a standing series stays “running” as its anchor.

Ending the series (only when I explicitly say to stop monitoring):

  • Mark the standing note “completed” (it drops out of the active list and frees a slot). Optionally delete the benchmark if I no longer want it to run.

ON ANY FAILURE or clear mismatch (at any step): tell me honestly, and do not fabricate a result or a “no drift” all-clear. Mark the standing note “failed” and stamp its data with failure telemetry: failure_stage, failure_reason, a one-line detail, and the job_id if a run was involved. Never leave the note “running” after a genuine failure, and never report “no drift” when you could not actually read the runs.

Goal

Turn a one-off “which model is best?” decision into ongoing assurance that your choice stays best. You stand up a scored benchmark on a schedule once; from then on your agent reconciles each run against the baseline and tells you, in plain language and only when it matters, if quality dropped, cost spiked, or latency crept up. Nobody watches a chart.

When to use

Reach for this after you have chosen a model or pipeline for a real task and you care whether it holds up: provider-side model updates, silent quality regressions, cost drift. It is the standing-series sibling of a one-off comparison. The same measurement, running on a cadence, reconciled across sessions so the signal finds you instead of the other way around.

How it works

  • One standing note is the anchor. Unlike a one-shot run (which the agent marks completed when done), a drift monitor keeps its note running for the life of the series. Each cycle re-points the note at the newest run; the note is only closed when you end monitoring. That is what lets any future session pick the series up by its recipe_id.
  • The server does the arithmetic. Drift detection leans on three server-computed signals so the agent never eyeballs numbers: each run’s anomaly_flags (regression vs the prior run), diff_runs (per-model deltas vs any baseline you choose), and get_benchmark_trend (the time-ordered series). The agent interprets and advises; the classical layer finds the pattern the same way every time.
  • Silence is a feature. When nothing moved, the agent says so in one line. The report is loud only when there is real movement to act on.

Verification

  • A scheduled benchmark exists and has run at least once (the baseline).
  • A standing note exists with the suite_id in its data, status running.
  • Asking “any drift?” in a fresh session finds the note, reads the latest run, and reports movement (or a one-line all-clear) without you supplying a job_id.
  • The note stays running across cycles and only becomes completed when you end the series; a genuine failure leaves it failed with a failure_reason, never a false “no drift”.

Where this leads

Natural next recipes once you are comfortable with this one.

Recipes that lead here