Skip to main content
Glama
Metrx MCP Server

Metrx MCP Server

by metrxbots

Create Model Experiment

metrx_create_model_experiment

Create a draft A/B model experiment for an agent, comparing a baseline control model against a candidate treatment model so you can plan model testing before any traffic is routed.

Instructions

Record a DRAFT A/B experiment comparing an agent's current model (control) with a candidate (treatment) model. Creating it does NOT start routing traffic: the experiment is stored with status 'draft'. If control_model is omitted, the API uses the model the agent ran most often in the last 90 days (and refuses if it cannot determine one, or if it equals the treatment). Needs an API key with the 'admin' scope (an org owner or admin mints one in Settings → Security → API Keys). Do NOT use to read results — use get_experiment_results. Requires an API key with the 'admin' scope.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "agent_id": "<agent_id>",
      "name": "<name>",
      "treatment_model": "<treatment_model>"
    },
    "name": "metrx_create_model_experiment"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYesHuman-readable experiment name
agent_idYesAgent (UUID) the experiment belongs to
descriptionNoOptional free-text description
traffic_pctNoPlanned percentage of traffic for the treatment model, 1-50 (default: 10)
control_modelNoBaseline model. Omit to use the agent's most-used model of the last 90 days.
treatment_modelYesThe candidate model to test (e.g., "gpt-4o-mini", "claude-haiku-4-5")

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed9 schema fields changedv0.5.0
    • changedInput schema / properties / agent_id / description
      Previous value: -"Agent to run the experiment on"New value: +"Agent (UUID) the experiment belongs to"
    • removedInput schema / properties / auto_promote
      Removed value: -{
      -  "default": false,
      -  "description": "Automatically apply the winning model when the experiment completes",
      -  "type": "boolean"
      -}
    • addedInput schema / properties / control_model
      Added value: +{
      +  "description": "Baseline model. Omit to use the agent's most-used model of the last 90 days.",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • addedInput schema / properties / description
      Added value: +{
      +  "description": "Optional free-text description",
      +  "maxLength": 1000,
      +  "type": "string"
      +}
    • removedInput schema / properties / max_duration_days
      Removed value: -{
      -  "default": 14,
      -  "description": "Maximum experiment duration in days (default: 14)",
      -  "maximum": 30,
      -  "minimum": 1,
      -  "type": "integer"
      -}
    • removedInput schema / properties / primary_metric
      Removed value: -{
      -  "default": "cost_per_call",
      -  "description": "The primary metric to optimize for (default: cost_per_call)",
      -  "enum": [
      -    "cost_per_call",
      -    "latency_p50",
      -    "latency_p95",
      -    "error_rate",
      -    "quality_score"
      -  ],
      -  "type": "string"
      -}
    • changedInput schema / properties / traffic_pct / description
      Previous value: -"Percentage of traffic to route to the treatment model (default: 10%)"New value: +"Planned percentage of traffic for the treatment model, 1-50 (default: 10)"
    • changedInput schema / properties / treatment_model / description
      Previous value: -"The candidate model to test (e.g., \"gpt-4o-mini\", \"claude-haiku-4-20250414\")"New value: +"The candidate model to test (e.g., \"gpt-4o-mini\", \"claude-haiku-4-5\")"
    • addedInput schema / properties / treatment_model / minLength
      Added value: +1
  2. Changed1 schema field changedv0.2.5
    • changedInput schema / properties / auto_promote / description
      Previous value: -"Automatically apply the winning model when the experiment concludes"New value: +"Automatically apply the winning model when the experiment completes"
  3. First observedv0.1.2

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already establish non-destructive, non-read-only, non-idempotent behavior; the description adds real context beyond that: the record lands in 'draft' status, no traffic is routed, and control_model fallback can fail or be rejected if it matches the treatment. The auth requirement is disclosed, though it is stated twice, which dilutes rather than extends the disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded and mostly efficient, with the draft/no-traffic caveat placed before the alternative-tool redirect. However the sentence 'Requires an API key with the "admin" scope' appears twice in near-identical form, which is pure waste in an otherwise tight definition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a six-parameter mutation tool with no output schema, the description covers the side-effect profile, the auth prerequisite, the defaulting behavior, and the failure modes. Nothing an agent needs in order to call it correctly or avoid misusing it is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning the schema does not: the 90-day most-used-model default for control_model and the two refusal conditions (undeterminable model, or control equal to treatment). That is genuinely new semantics for a required decision point rather than a restatement of the field docs.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Record a DRAFT A/B experiment') plus the exact comparison being modeled (control vs treatment model). It also names the sibling it is not ('use get_experiment_results'), so an agent can route between them without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives explicit when-to-use context ('creating it does NOT start routing traffic') and an explicit when-not with the alternative named ('Do NOT use to read results — use get_experiment_results'). The prerequisite (admin-scoped API key) is also stated, leaving nothing to inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.