Skip to main content
Glama

score_risk

Read-onlyIdempotent

Estimate the risk of changing a single symbol on a 0-to-100 scale so you can prioritize proposed fixes before patching.

Instructions

Estimate the risk of changing one symbol on a heuristic 0-to-100 scale. Use when: you need to prioritize a specific proposed change before patching. Don't use when: you need an overall repository health trend (use get_health_score instead).

Returns {score, breakdown, basis, referenced_by, recommendation}. Breakdown contains point contributions: inbound_refs (0-30), has_tests (0 or 20 for no referencing test), lines_changed (5/10/17/25 based on file length, not patch size), is_circular (0 or 25). basis is symbol, or file when reference sets are unavailable. referenced_by contains at most 10 sorted paths. Recommendation is safe to fix (<=30), fix with caution (<=60), or manual review recommended (>60); this is not a guarantee of correctness or coverage.

Input Schema

NameRequiredDescriptionDefault
fileYesRepository-relative file path exactly as reported by scan_repo, e.g. src/pricing.py. Use native separators or forward slashes; absolute paths do not match the scan's relative paths. Used for file size and cycles.
symbolYesExact case-sensitive unqualified symbol name, e.g. calculate_discount. Matches AST reference names across files, not fully resolved symbols; the implementation does not validate that the symbol exists.
repo_pathYesRepository directory to rescan with per-file symbol references enabled; prefer an absolute path. No source or state files are written.

Output Schema

NameRequiredDescriptionDefault
basisYes
scoreYes
breakdownYes
referenced_byYes
recommendationYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed6 schema fields changedv0.4.5
    • addedInput schema / properties / file / description
      Added value: +"Repository-relative file path exactly as reported by scan_repo, e.g. src/pricing.py. Use native separators or forward slashes; absolute paths do not match the scan's relative paths. Used for file size and cycles."
    • addedInput schema / properties / repo_path / description
      Added value: +"Repository directory to rescan with per-file symbol references enabled; prefer an absolute path. No source or state files are written."
    • addedInput schema / properties / symbol / description
      Added value: +"Exact case-sensitive unqualified symbol name, e.g. calculate_discount. Matches AST reference names across files, not fully resolved symbols; the implementation does not validate that the symbol exists."
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / properties
      Added value: +{
      +  "basis": {
      +    "type": "string"
      +  },
      +  "breakdown": {
      +    "properties": {
      +      "has_tests": {
      +        "type": "integer"
      +      },
      +      "inbound_refs": {
      +        "type": "integer"
      +      },
      +      "is_circular": {
      +        "type": "integer"
      +      },
      +      "lines_changed": {
      +        "type": "integer"
      +      }
      +    },
      +    "required": [
      +      "inbound_refs",
      +      "has_tests",
      +      "lines_changed",
      +      "is_circular"
      +    ],
      +    "type": "object"
      +  },
      +  "recommendation": {
      +    "type": "string"
      +  },
      +  "referenced_by": {
      +    "items": {
      +      "type": "string"
      +    },
      +    "type": "array"
      +  },
      +  "score": {
      +    "type": "integer"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "score",
      +  "breakdown",
      +  "basis",
      +  "referenced_by",
      +  "recommendation"
      +]
  2. Addedv0.2.9

TDQS

A4.6/5.0
Behavior5/5

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

Beyond the readOnly/idempotent annotations, the description discloses the scoring internals (inbound_refs 0-30, has_tests 0/20, lines_changed 5/10/17/25 based on file length not patch size, is_circular 0/25), the caps (at most 10 referenced paths), the basis fallback (symbol or file when references unavailable), and an explicit caveat that the score is not a guarantee. This is the kind of context annotations cannot carry.

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?

Usage guidance is front-loaded before the return explanation, and every clause carries real information. The returns block is long and partly duplicates what the output schema may already convey, which keeps it from a 5.

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 three-parameter, read-only heuristic scorer, the definition covers triggering conditions, internal weighting, output shape, interpretation thresholds, and explicit limitations. Nothing an agent needs to call it correctly or interpret the result is missing.

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%, so the schema already explains file, symbol, and repo_path semantics including the case-sensitivity and no-validation caveats. The description adds only the framing that exactly one symbol is assessed, 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 ('Estimate the risk of changing one symbol') plus the output scale (0-to-100 heuristic), which immediately separates it from the aggregate-health sibling get_health_score. An agent can distinguish it from every sibling 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?

Explicit 'Use when' gives the triggering condition (prioritizing a specific proposed change before patching) and 'Don't use when' names the alternative tool (get_health_score) with the condition that selects it. Both directions of routing are covered.

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