Skip to main content
Glama

sumo_qa_analyze_diff_impact

Map changed files to a repository map to find likely tests, flag sources without mapped tests, and detect stale mappings.

Instructions

Map a set of changed files onto the repo-map to report which tests likely exercise them, which changed sources have no mapped test (the risk surface), one-hop affected nodes, unmapped files, and whether the map is stale relative to HEAD.

Common natural-language phrasings that map to this tool: "what does this diff affect", "which tests cover my changes", "what's the risk surface of this branch", "what should I re-test after these edits", "analyse the impact of the changes against main".

root is the repository. Supply changed_files (repo-relative paths) OR base_ref (any git ref; changed files are the diff against the merge-base of base_ref and HEAD, so changes that landed on the base after the branch diverged don't leak in). The repo-map is read from artifact_path when present and falls back to a live scan otherwise; an artifact for a different project root is ignored. On the first run of an unmapped repo the live scan is persisted to artifact_path (reported as persisted_map_path) unless artifact_path is None. write_overlay writes .sumo-qa/diff-impact.json under root. When test files exist but the map has no likely_tests edges, probable_mapping_gap flags the risk surface as a missed-convention gap rather than true zero coverage.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
rootYes
base_refNo
artifact_pathNo.sumo-qa/repo-map.json
changed_filesNo
write_overlayNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.42.0

TDQS

A5/5.0
Behavior5/5

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

Annotations mark this as non-read-only and non-idempotent but non-destructive; the description explains why by disclosing the write side effects: first-run live-scan persistence to artifact_path (surfaced as persisted_map_path) and write_overlay emitting .sumo-qa/diff-impact.json. It also covers staleness detection, merge-base diffing semantics, ignored cross-root artifacts, and probable_mapping_gap as a false-negative signal.

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?

Front-loads the purpose, then a compact routing-phrase list, then parameter behavior in reading order. The length is earned: each clause either aids selection or supplies semantics the 0%-coverage schema omits.

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?

With no output schema, the description enumerates the report contents (likely tests, risk surface, one-hop nodes, unmapped files, staleness flag, probable_mapping_gap, persisted_map_path), which is exactly what an agent needs to interpret the return. Nothing material is missing for a 5-param analysis 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 coverage is 0%, so the description carries the full burden and does so for all five params: root (the repository), changed_files (repo-relative paths), base_ref (any git ref, diffed against merge-base with HEAD so post-divergence base changes don't leak), artifact_path (read source with live-scan fallback and first-run persistence), and write_overlay (writes the overlay file under root).

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+resource: maps changed files onto the repo-map and reports likely exercising tests, unmapped risk surface, one-hop affected nodes, and map staleness. This is clearly distinguishable from siblings like sumo_qa_query_repo_map (read the map) and sumo_qa_scan_repo (build it).

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?

Provides concrete natural-language phrasings that should route to this tool ('which tests cover my changes', 'what should I re-test'), and explains the changed_files-vs-base_ref choice plus the artifact_path fallback. An agent knows both when to pick this and how to drive it.

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