Skip to main content
Glama

get_change_risk

Assess pre-merge change risk by scoring a commit or base..head range from its diff, providing risk percentile ranking, review priority, and line-precise impacted tests.

Instructions

Score a live commit or base..head range from its diff shape.

Use this for a pre-merge score of a commit or PR range. It is distinct from
``get_risk``, which assesses indexed files and PR blast radius. Both filters
below also apply to the baseline used for the repository percentile.

Prefer ``risk_percentile`` as the indicator of change risk: it ranks this
change against sampled recent commits in the same repository. Summarize it
with ``review_priority`` and ``classification``. ``score``, ``probability``,
and ``level`` are secondary corpus-calibrated context, the fallback only
when ``risk_percentile`` is unavailable.

``impacted_tests`` names the tests the per-test coverage map proves execute
the change's changed *lines* (line-precise, narrower than get_risk's
file-level ``tests_to_run``), with ``missing_tests`` buckets for changed
lines no test covers. Its ``status`` is ``no_map`` (unknown, run the full
suite), never "untested", when no map is ingested.

``prior_fixes`` appears only when the changed files carry counted bug fixes:
per-file counts, never a commit name.

Args:
    revspec: Commit or ``base..head`` range to score. Defaults to ``HEAD``.
    repo: Repository alias in workspace mode; omit for the default repository.
    extensions: File suffixes to count, for example ``[".py", ".ts"]``.
    exclude_patterns: Gitignore-style paths to omit, for example ``["tests/", "*.md"]``.
    baseline: Recent commits to sample for percentile ranking; 0 disables it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoNo
revspecNoHEAD
baselineNo
extensionsNo
exclude_patternsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description bears full responsibility for disclosing behavior. It goes beyond the basics by explaining the semantics of output fields (risk_percentile vs score, impacted_tests line-precision, status='no_map' semantics), what filters affect the baseline, and the conditional appearance of prior_fixes. This is rich behavioral detail that aids correct interpretation.

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?

The description is long but densely packed with necessary information. It is structured in paragraphs: purpose, usage, output guidance, output details, and then parameter definitions. Each sentence adds value, and it is front-loaded with the core purpose. The length is justified by the tool's complexity.

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?

Given the tool's complexity (5 parameters, multiple output fields, an output schema), the description is exceptionally complete. It covers usage context, output field interpretation, fallback logic, edge cases (no_map), and parameter semantics. It does not restate the output schema, which is appropriate since an output schema exists. The description stands alone as a thorough guide.

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%, but the description compensates by explaining every parameter: revspec (commit or range, default HEAD), repo (workspace alias, omit for default), extensions (file suffixes), exclude_patterns (gitignore-style paths), and baseline (sampling count, 0 disables). It adds examples and default values, making the parameters fully understood.

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?

The description opens with a specific verb and resource: 'Score a live commit or base..head range from its diff shape.' It immediately and clearly states the tool's function, and explicitly distinguishes it from sibling tool get_risk, making the purpose unambiguous.

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?

It provides explicit usage context: 'Use this for a pre-merge score of a commit or PR range.' It also names an alternative (get_risk) and explains when to prefer this tool over it. Additionally, it gives guidance on which output fields to prioritize ('Prefer risk_percentile'), which is practical and actionable.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/repowise-dev/repowise'

If you have feedback or need assistance with the MCP directory API, please join our Discord server