Skip to main content
Glama

Evaluate With LLM Judge

evaluate_with_llm_judge

Score an agent output with an LLM judge using your own Anthropic or OpenAI key. Get a 0–1 score, rationale, and cost, with a worst-case cost cap checked before the call.

Instructions

Score an output with an LLM judge on your own key: a 0..1 score, a rationale, the spend.

What it does. Calls Anthropic or OpenAI with IRIS_ANTHROPIC_API_KEY or IRIS_OPENAI_API_KEY; Iris never proxies. correctness needs expected, relevance input, faithfulness source_material. Worst-case cost is checked against max_cost_usd first. Full detail: iris://capabilities.

When not to use it. For length, keyword, PII or cost checks (evaluate_output, free).

Returns. JSON: id, reference_trace_id, score, passed, verdict, pass_threshold, self_reported_pass, disagreement, rationale, dimensions, model, provider, template, input_tokens, output_tokens, cost_usd, latency_ms, raw_response_id, warnings.

Errors. IRIS_JUDGE_NOT_ENABLED (recovery has the steps); IRIS_JUDGE_UNKNOWN_MODEL; IRIS_UNKNOWN_TRACE; IRIS_BUDGET_EXCEEDED; IRIS_PROVIDER_ERROR. Failures return {"error":{code,message,recovery}} with isError; follow recovery.

Siblings. evaluate_output — the free deterministic path; verify_citations — citation grounding.

Input Schema

NameRequiredDescriptionDefault
inputNoUser question / prompt that produced the output (required for relevance; improves helpfulness and safety)
modelYesModel ID. Supported: anthropic = claude-fable-5-1 | claude-opus-5-5 | claude-sonnet-5 (and the priced 4.x line); openai = gpt-5 | gpt-5-mini | gpt-4.1-mini (and the priced 4o, o3/o4 and retired o1 ids); an unknown id is refused with the full priced list. Required — cost varies a hundredfold across models
outputYesThe agent output text to evaluate
expectedNoReference answer (required for correctness template)
providerNoAuto-detected from model when omitted
templateYesThe question the judge answers; correctness needs expected, relevance needs input, faithfulness and task_completed read source_material
trace_idNoKeep this evaluation beside a stored trace (id from log_trace / get_traces). It is listed with the trace and never replaces its verdict; an unknown id is rejected BEFORE the judge is called
timeout_msNoPer-request timeout; default 60_000
agent_modelNoThe model that produced the output, for the same-family warning, when no linked trace records it
temperatureNoSampling temperature; default 0 (deterministic)
max_cost_usdNoCost cap in USD for this call, at most the operator's IRIS_LLM_JUDGE_MAX_COST_USD_PER_EVAL (default 0.25). The worst case (two attempts, full max_output_tokens) is computed before the call and refused if it exceeds the cap
source_materialNoProvided RAG sources (required for faithfulness template)
max_output_tokensNoJudge output token cap; default 512

Output Schema

NameRequiredDescriptionDefault
idYes
modelYes
scoreYes
passedYes
verdictNo
cost_usdYes
providerYes
templateYes
warningsNo
rationaleYes
dimensionsYes
latency_msYes
disagreementNo
input_tokensYes
output_tokensYes
pass_thresholdYes
raw_response_idNo
reference_trace_idNo
self_reported_passNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed27 schema fields changedv0.10.1
    • addedInput schema / properties / agent_model
      Added value: +{
      +  "description": "The model that produced the output, for the same-family warning, when no linked trace records it",
      +  "minLength": 1,
      +  "type": "string"
      +}
    • changedInput schema / properties / input / description
      Previous value: -"User question / prompt that produced the output (improves accuracy for helpfulness/safety)"New value: +"User question / prompt that produced the output (required for relevance; improves helpfulness and safety)"
    • changedInput schema / properties / max_cost_usd / description
      Previous value: -"Cost cap in USD for this call; defaults to IRIS_LLM_JUDGE_MAX_COST_USD_PER_EVAL or 0.25. The worst case (two attempts, full max_output_tokens) is computed before the call and refused if it exceeds the cap"New value: +"Cost cap in USD for this call, at most the operator's IRIS_LLM_JUDGE_MAX_COST_USD_PER_EVAL (default 0.25). The worst case (two attempts, full max_output_tokens) is computed before the call and refused if it exceeds the cap"
    • changedInput schema / properties / model / description
      Previous value: -"Model ID. Supported: anthropic = claude-opus-4-7 | claude-sonnet-4-6 | claude-haiku-4-5 | claude-haiku-4-5-20251001; openai = gpt-4o | gpt-4o-mini | o1-mini. Required — cost varies a hundredfold across models"New value: +"Model ID. Supported: anthropic = claude-fable-5-1 | claude-opus-5-5 | claude-sonnet-5 (and the priced 4.x line); openai = gpt-5 | gpt-5-mini | gpt-4.1-mini (and the priced 4o, o3/o4 and retired o1 ids); an unknown id is refused with the full priced list. Required — cost varies a hundredfold across models"
    • changedInput schema / properties / template / description
      Previous value: -"Judge dimension: accuracy (factual correctness), helpfulness (does it address the ask), safety (harm potential), correctness (vs reference answer — requires `expected`), faithfulness (RAG grounding — requires `source_material`)."New value: +"The question the judge answers; correctness needs expected, relevance needs input, faithfulness and task_completed read source_material"
    • changedInput schema / properties / template / enum
      Previous value: -[
      -  "accuracy",
      -  "helpfulness",
      -  "safety",
      -  "correctness",
      -  "faithfulness"
      -]New value: +[
      +  "accuracy",
      +  "helpfulness",
      +  "safety",
      +  "correctness",
      +  "faithfulness",
      +  "task_completed",
      +  "relevance"
      +]
    • changedInput schema / properties / trace_id / description
      Previous value: -"Link this evaluation to a stored trace (id from log_trace / get_traces); an unknown id is rejected BEFORE the judge is called"New value: +"Keep this evaluation beside a stored trace (id from log_trace / get_traces). It is listed with the trace and never replaces its verdict; an unknown id is rejected BEFORE the judge is called"
    • removedOutput schema / properties / cost_usd / description
      Removed value: -"the exact spend from the pricing table"
    • removedOutput schema / properties / dimensions / description
      Removed value: -"per-dimension sub-scores for the template"
    • removedOutput schema / properties / disagreement / description
      Removed value: -"true when the model's own boolean disagrees with the threshold verdict — its rubric and its judgement have come apart on this output"
    • removedOutput schema / properties / id / description
      Removed value: -"the evaluation id; read it back at iris://evaluations/{id}"
    • removedOutput schema / properties / input_tokens / description
      Removed value: -"tokens sent, across both attempts when a retry ran"
    • removedOutput schema / properties / latency_ms / description
      Removed value: -"wall time of the provider call(s)"
    • removedOutput schema / properties / model / description
      Removed value: -"the model that judged"
    • removedOutput schema / properties / output_tokens / description
      Removed value: -"tokens received, across both attempts when a retry ran"
    • removedOutput schema / properties / pass_threshold / description
      Removed value: -"the threshold the score was read against, so you can check the arithmetic"
    • removedOutput schema / properties / passed / description
      Removed value: -"the verdict: the score against the template's threshold, which is pass_threshold below. Not the model's own boolean — that is self_reported_pass"
    • removedOutput schema / properties / provider / description
      Removed value: -"the provider called"
    • removedOutput schema / properties / rationale / description
      Removed value: -"the judge's reasoning, in its words"
    • removedOutput schema / properties / raw_response_id / description
      Removed value: -"the provider's response id, for your own audit"
    • addedOutput schema / properties / reference_trace_id
      Added value: +{
      +  "type": "string"
      +}
    • removedOutput schema / properties / score / description
      Removed value: -"0..1 from the judge"
    • removedOutput schema / properties / self_reported_pass / description
      Removed value: -"what the model said about passing, when it said anything. Recorded, never obeyed"
    • removedOutput schema / properties / template / description
      Removed value: -"the template used"
    • removedOutput schema / properties / trace_id
      Removed value: -{
      -  "description": "the linked trace, when one was named",
      -  "type": "string"
      -}
    • addedOutput schema / properties / verdict
      Added value: +{
      +  "additionalProperties": {},
      +  "properties": {},
      +  "type": "object"
      +}
    • addedOutput schema / properties / warnings
      Added value: +{
      +  "items": {},
      +  "type": "array"
      +}
  2. Changed5 schema fields changedv0.10.0
    • addedOutput schema / properties / disagreement
      Added value: +{
      +  "description": "true when the model's own boolean disagrees with the threshold verdict — its rubric and its judgement have come apart on this output",
      +  "type": "boolean"
      +}
    • addedOutput schema / properties / pass_threshold
      Added value: +{
      +  "description": "the threshold the score was read against, so you can check the arithmetic",
      +  "type": "number"
      +}
    • changedOutput schema / properties / passed / description
      Previous value: -"the judge's own pass verdict for the template"New value: +"the verdict: the score against the template's threshold, which is pass_threshold below. Not the model's own boolean — that is self_reported_pass"
    • addedOutput schema / properties / self_reported_pass
      Added value: +{
      +  "description": "what the model said about passing, when it said anything. Recorded, never obeyed",
      +  "type": "boolean"
      +}
    • changedOutput schema / required
      Previous value: -[
      -  "id",
      -  "score",
      -  "passed",
      -  "rationale",
      -  "dimensions",
      -  "model",
      -  "provider",
      -  "template",
      -  "input_tokens",
      -  "output_tokens",
      -  "cost_usd",
      -  "latency_ms"
      -]New value: +[
      +  "id",
      +  "score",
      +  "passed",
      +  "pass_threshold",
      +  "rationale",
      +  "dimensions",
      +  "model",
      +  "provider",
      +  "template",
      +  "input_tokens",
      +  "output_tokens",
      +  "cost_usd",
      +  "latency_ms"
      +]
  3. Changed3 schema fields changedv0.9.0
    • changedInput schema / properties / max_cost_usd / description
      Previous value: -"Cost cap in USD; defaults to IRIS_LLM_JUDGE_MAX_COST_USD_PER_EVAL or 0.25"New value: +"Cost cap in USD for this call; defaults to IRIS_LLM_JUDGE_MAX_COST_USD_PER_EVAL or 0.25. The worst case (two attempts, full max_output_tokens) is computed before the call and refused if it exceeds the cap"
    • changedInput schema / properties / model / description
      Previous value: -"Model ID. Supported: anthropic = claude-opus-4-7 | claude-sonnet-4-6 | claude-haiku-4-5 | claude-haiku-4-5-20251001; openai = gpt-4o | gpt-4o-mini | o1-mini."New value: +"Model ID. Supported: anthropic = claude-opus-4-7 | claude-sonnet-4-6 | claude-haiku-4-5 | claude-haiku-4-5-20251001; openai = gpt-4o | gpt-4o-mini | o1-mini. Required — cost varies a hundredfold across models"
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": {},
      +  "properties": {
      +    "cost_usd": {
      +      "description": "the exact spend from the pricing table",
      +      "type": [
      +        "number",
      +        "null"
      +      ]
      +    },
      +    "dimensions": {
      +      "additionalProperties": {},
      +      "description": "per-dimension sub-scores for the template",
      +      "propertyNames": {
      +        "type": "string"
      +      },
      +      "type": "object"
      +    },
      +    "id": {
      +      "description": "the evaluation id; read it back at iris://evaluations/{id}",
      +      "type": "string"
      +    },
      +    "input_tokens": {
      +      "description": "tokens sent, across both attempts when a retry ran",
      +      "type": "number"
      +    },
      +    "latency_ms": {
      +      "description": "wall time of the provider call(s)",
      +      "type": "number"
      +    },
      +    "model": {
      +      "description": "the model that judged",
      +      "type": "string"
      +    },
      +    "output_tokens": {
      +      "description": "tokens received, across both attempts when a retry ran",
      +      "type": "number"
      +    },
      +    "passed": {
      +      "description": "the judge's own pass verdict for the template",
      +      "type": "boolean"
      +    },
      +    "provider": {
      +      "description": "the provider called",
      +      "enum": [
      +        "anthropic",
      +        "openai"
      +      ],
      +      "type": "string"
      +    },
      +    "rationale": {
      +      "description": "the judge's reasoning, in its words",
      +      "type": "string"
      +    },
      +    "raw_response_id": {
      +      "description": "the provider's response id, for your own audit",
      +      "type": "string"
      +    },
      +    "score": {
      +      "description": "0..1 from the judge",
      +      "type": "number"
      +    },
      +    "template": {
      +      "description": "the template used",
      +      "type": "string"
      +    },
      +    "trace_id": {
      +      "description": "the linked trace, when one was named",
      +      "type": "string"
      +    }
      +  },
      +  "required": [
      +    "id",
      +    "score",
      +    "passed",
      +    "rationale",
      +    "dimensions",
      +    "model",
      +    "provider",
      +    "template",
      +    "input_tokens",
      +    "output_tokens",
      +    "cost_usd",
      +    "latency_ms"
      +  ],
      +  "type": "object"
      +}
  4. Changed2 schema fields changedv0.8.0
    • addedInput schema / additionalProperties
      Added value: +false
    • changedInput schema / properties / trace_id / description
      Previous value: -"Link this evaluation to a trace"New value: +"Link this evaluation to a stored trace (id from log_trace / get_traces); an unknown id is rejected BEFORE the judge is called"
  5. Changed2 schema fields changedv0.4.6
    • removedInput schema / additionalProperties
      Removed value: -false
    • addedInput schema / properties / timeout_ms / maximum
      Added value: +9007199254740991
  6. Addedv0.1.10

TDQS

A4.9/5.0
Behavior5/5

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

Goes well past the annotations (readOnly=false, openWorld=true, non-idempotent): BYO-key with no Iris proxy, the worst-case cost pre-check including 'two attempts, full max_output_tokens', enumerated error codes with a recovery contract, and confirmation that failures return isError. This is exactly the extra context the annotations cannot express.

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

Conciseness5/5

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

Front-loaded one-line summary followed by labeled sections (What it does / When not to use it / Returns / Errors / Siblings). Dense but every line carries decision-relevant content, including the pointer to iris://capabilities instead of expanding detail inline.

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 13-parameter, open-world, cost-incurring tool the description covers prerequisites (API keys), safety rails (max_cost_usd worst-case), failure modes with recovery, and sibling routing. The Returns list is partly redundant with the output schema, but the Errors contract is not, and nothing an agent needs to call it safely 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 schema already carries parameter meaning; the description adds the cross-parameter couplings in one place (correctness needs expected, relevance needs input, faithfulness needs source_material) and flags that cost 'varies a hundredfold across models'. It does not add syntax or format detail beyond the schema, so it lands just above the baseline.

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+resource+scope: 'Score an output with an LLM judge on your own key', plus the exact outputs produced (0..1 score, rationale, spend). The 'Siblings' section explicitly separates it from evaluate_output (free deterministic) and verify_citations (citation grounding), so an agent can route without opening a 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?

'When not to use it' names the exact alternative (evaluate_output) and the check types it covers (length, keyword, PII, cost). It also names the sibling relationships for verify_citations, giving both when-not and alternatives explicitly.

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