Skip to main content
Glama

get_risk

Assess risk for file changes by fusing git history, dependency graph reach, and security findings. Identifies blast radius, missing test coverage, and co-change gaps for PRs.

Instructions

What history says about touching these files — bug fixes, churn, owners.

Fuses git temporal signals (``hotspot_score``/``owner_pct`` are 0-1; trend;
bus factor) with graph topology. ``dependents`` are directed structural
reach (source depends on target), ``consumers`` require typed contract links,
and ``co_change_partners`` are historical correlation only. Those counts
are a floor over the indexed graph. Structural reach is not proof of
runtime breakage. The response also includes security
findings. Pass changed_files for PR mode: the response leads with a
directive block (may_break, missing_cochanges, missing_tests,
tests_to_run) — read it first. Each test_recommendations row carries a
measured or inferred basis, and coverage availability is explicit. To
score a commit or ``base..head`` range instead, use ``get_change_risk``.

In PR mode ``structural_impact_score`` is an uncalibrated 0-10 structural
heuristic, never a runtime-breakage probability; ``overall_risk_score`` is
its deprecated exact alias.

Default responses fit 24,000 serialized chars; nonempty ``include`` uses
32,000. Reductions carry counts and ``_meta.omitted`` recovery refs;
``_meta.recovery_unavailable`` names a storage failure.
Include-gated blocks are projections, not omissions.

Args:
    targets: file paths to assess; defaults to changed_files.
    repo: usually omitted.
    changed_files: PR-changed files for blast-radius mode.
    include: opt-in blocks - "graph", "churn", "scales" (units and
        calibration for every scalar; identical per call, so ask once).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoNo
includeNo
targetsNo
changed_filesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv0.55.0
    • addedInput schema / properties / targets / anyOf
      Added value: +[
      +  {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / targets / default
      Added value: +null
    • removedInput schema / properties / targets / items
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / targets / type
      Removed value: -"array"
    • removedInput schema / required
      Removed value: -[
      -  "targets"
      -]
  2. Changed1 schema field changedv0.48.0
    • addedInput schema / properties / include
      Added value: +{
      +  "anyOf": [
      +    {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "title": "Include"
      +}
  3. First observedv0.1.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations, the description carries the full behavioral burden and does so richly: hotspot_score/owner_pct are 0-1, structural_impact_score is an uncalibrated 0-10 heuristic 'never a runtime-breakage probability', overall_risk_score is a deprecated alias, structural reach is not proof of runtime breakage, default responses cap at 24,000 chars (32,000 with include), and _meta.omitted/_meta.recovery_unavailable explain truncation and storage failures. This is unusually candid about calibration limits and failure modes.

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?

Dense but almost every sentence carries operational payload (calibration caveats, limits, recovery refs, mode switching), so the length is justified by the tool's complexity. The weakness is front-loading: the lead sentence is atmospheric rather than functional, and the structural_impact_score/deprecated-alias sentence is packed with two distinct facts. Minor RST artifacts (double backticks) add noise.

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?

Despite an output schema existing (which relieves it of return-value duties), the description still explains the shape of results, mode-specific leading blocks, score semantics, truncation behavior, and include-gated projections. Combined with full parameter coverage and sibling routing, an agent has everything needed to call and interpret this tool.

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

Parameters5/5

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

Schema description coverage is 0%, so the description must compensate, and it fully does: targets (defaults to changed_files), repo ('usually omitted'), changed_files (PR blast-radius mode), and include with its three enumerated block names ('graph', 'churn', 'scales') plus their semantics and unit/calibration intent. Every parameter is documented with meaning the schema does not supply.

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

Purpose4/5

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

The tool is clearly a file-level risk assessor: the Args section states 'targets: file paths to assess' and the body frames output as git temporal signals fused with graph topology. It explicitly distinguishes itself from the sibling get_change_risk ('To score a commit or base..head range instead, use get_change_risk'), so an agent can route without opening schemas. The opening sentence is more evocative than definitional, which keeps this from a 5.

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 concrete when-to-use conditions: pass changed_files for PR blast-radius mode, read the directive block first, and use get_change_risk for commits or ranges. It also advises 'ask once' for the include block since scales are identical per call. It offers no exclusions relative to the other siblings (get_health, get_dead_code, get_context), so the routing guidance is good but incomplete.

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