Skip to main content
Glama

Measure where two judges disagree, and who was right

compute_divergence
Read-only

Compares automated and human judgments on the same objects to measure disagreement, then uses later outcomes to report engineRight and humanRight as separate counts when overrides are resolved.

Instructions

Computes how often two independent judges (e.g. an automated engine and a human override) rated the same object differently, and -- where a later outcome exists to settle it -- reports engineRight and humanRight as two SEPARATE counts, never combined into one blended accuracy number (a system can be right most of the time overall and still wrong every single time a human bothers to overrule it, and that second fact is the one worth acting on). Divergence needs BOTH a count floor (minDivergentCount) and a rate floor (minDivergentRate) before it's 'reportable' -- either alone lets noise through. Calibration (who was right) carries its own separate floor (minResolvedDivergent) and its own status, so a population can legitimately have reportable divergence and refused calibration at the same time: plenty of disagreements, not enough of them settled by a later outcome yet. Supply group on each pair (a custom config.groupBySource is off unless the server operator sets HONESTY_MCP_ENABLE_CODE_EXEC=1) to also get a sorted per-group breakdown alongside the overall report. Use this whenever a system has both an automated judgment and a human override/correction recorded for the same objects, to find out whether overruling the system is actually earning its keep. For grading one recommendation's own before/after outcome window instead of a whole population of engine-vs-human calls, use grade_decision.

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": {
      "pairs": "<pairs>"
    },
    "name": "compute_divergence"
  }
}

Input Schema

NameRequiredDescriptionDefault
pairsYesEvery occasion both judges could have spoken on. Pairs missing one judgment are still counted, just not comparable.
configNoFloors, thresholds, and optional custom grouping, every field optional with a library default (see advice-ledger-kit's DEFAULT_DIVERGENCE_CONFIG). Omit entirely to use the library's defaults.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.4.0
    • addedInput schema / properties / config / additionalProperties
      Added value: +false
    • removedInput schema / properties / config / properties / groupBySource
      Removed value: -{
      -  "description": "JS source for a pure function `(pair) => string | null` -- the real kit's `groupBy` config. MCP arguments are JSON and cannot carry a function value, so when supplied this runs the whole computeDivergence call in a worker thread with a bounded timeout (default 10s, see README) instead of on the main thread (same trust model as check_payout_invariance's rankFnSource -- only pass code you wrote or trust). Return null from it to leave a pair out of the per-group breakdown entirely. Omit to use the library's own default, which buckets by each pair's own `group` field -- that covers the common case with no code execution (or worker) at all.",
      -  "type": "string"
      -}
  2. First observedv0.1.0

TDQS

A4.7/5.0
Behavior5/5

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

Annotations only declare readOnlyHint and openWorldHint=false, so the description carries the interesting behavior and does it well: it discloses the dual-floor gating (count AND rate), the separate calibration floor and status so divergence can be reportable while calibration is refused, and the config.groupBySource / HONESTY_MCP_ENABLE_CODE_EXEC gating that makes the group parameter conditionally ignored. These are non-obvious behaviors that materially change how results should be read.

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?

The purpose and routing are front-loaded, but the whole definition is a single dense paragraph dense with parenthetical asides, including a rhetorical illustration about a system being right overall yet wrong on every overrule. Most content earns its place, yet the wall-of-text form makes the floor rules and parameter caveats hard to scan compared with a short bulleted structure.

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 read-only aggregation tool with two parameters and no output schema, nothing an agent needs is missing: the input contract (pairs with engineJudgment/humanJudgment/laterOutcome), the gating logic, the conditional grouping behavior, and the sibling alternative are all covered.

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 real semantics beyond the schema: it explains that minDivergentCount and minDivergentRate must both clear (either alone admits noise), and that 'group' only matters when a custom config.groupBySource is absent. It does not touch exampleLimit or minComparablePairs, so it is not exhaustive.

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 concrete verb and resource: counts how often two independent judges rated the same object differently and reports engineRight and humanRight as separate counts. It goes well beyond the name by specifying the exact output shape (two unblended counts) and explicitly contrasts itself with grade_decision, so an agent can distinguish it from siblings 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?

Gives an explicit trigger: 'Use this whenever a system has both an automated judgment and a human override/correction recorded for the same objects.' It also names the alternative and the condition selecting it ('For grading one recommendation's own before/after outcome window instead of a whole population ... use grade_decision'), so routing between the two is unambiguous.

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