Skip to main content
Glama

Score diff risk

score_diff
Read-only

Compute the opendrs Diff Risk Score (0-1) for changes between two git refs to decide whether to open a pull request, split a change, or require human review.

Instructions

Compute the opendrs Diff Risk Score (0-1, calibrated probability that the change causes an incident) for the changes between two git refs. Returns the score, tier (green/yellow/red), the gate decision and its reasons, the top contributing signals with evidence, signals that could not be computed (unknowns), suggested reviewers, and the LLM judge's rationale when enabled. Use it before opening a pull request, or to decide whether a change should be split.

Input Schema

NameRequiredDescriptionDefault
baseNoBase ref to diff against. Defaults to "origin/HEAD", or "main" when that is not set.
headNoHead ref to score. Defaults to "HEAD".
repoDirYesAbsolute path to the git repository (any directory inside the work tree).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.5

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already establish readOnlyHint=true, so safety is covered. The description adds real behavioral context beyond that: the tool emits a gate decision with reasons, flags signals it could not compute as unknowns, and optionally invokes an LLM judge, implying an external, potentially slow/non-deterministic step. It falls short of stating latency, auth, or empty-diff behavior, but adds clear value over the annotation.

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

Conciseness4/5

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

Two sentences, front-loaded with the purpose before the usage note. The second sentence is a long enumeration of return fields, which is justified because no output schema exists, but it reads as a dense run-on rather than a tight sentence.

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

Completeness4/5

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

With no output schema, the description rightly enumerates what comes back (score, tier, gate decision and reasons, contributing signals, unknowns, suggested reviewers, judge rationale), and all three parameters are schema-documented. Gaps remain around empty/no-diff cases, failure modes, and the cost of the optional LLM judge, but it is nearly complete for a read-only scoring tool.

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

Parameters3/5

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

Schema description coverage is 100%: base, head, and repoDir each document their meaning and default values. The description frames base/head as a diff range ('between two git refs') but adds no syntax, precedence, or edge-case detail beyond the schema, so the baseline 3 applies.

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: compute the opendrs Diff Risk Score (0-1) for changes between two git refs. The scoped artifact (a calibrated incident-probability score over a ref range) is distinct from explain_file_risk, list_hotspots, and suggest_reviewers, so an agent can route correctly without opening the schema.

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

Usage Guidelines4/5

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

Gives explicit usage timing: 'Use it before opening a pull request, or to decide whether a change should be split.' No alternatives or exclusions are named (e.g., when to prefer explain_file_risk or suggest_reviewers), so it is clear context without routing.

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