Skip to main content
Glama

comprehension_risk

Read-onlyIdempotent

Assess the risk of editing specific files or folders by measuring team understanding of their AI-written code, and return advice for cautious changes.

Instructions

Rate how risky it is to change specific files or folders, based on how much of their AI-written code anyone on the team has shown they understand.

When to use: before editing existing code in a non-trivial way. Follow the returned advice: at high or very high,
keep the diff small, explain the change, and offer a quiz afterwards. For the whole repository use repo_status;
to find a reviewer use who_understands.

Returns {"repo", "results": [...]}, one entry per path with: risk (none, low, medium, high, very high),
lines, ai, understood, skimmed, fading, unread, debt_pct, ai_pct, agents (lines per AI agent), understood_by
(person -> lines), critical_path, advice, and most_unread_files. A path that does not exist has found=false.
Lines count as AI-written when the commit that last changed them carries an AI agent's marker
(e.g. a Co-Authored-By: Claude trailer).

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "paths": "<paths>"
    },
    "name": "comprehension_risk"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoNoPath inside the git repository. Defaults to the server's working directory.
pathsYesFiles or folders you are about to change, relative to the repo root. '.' means the whole repo.

Output Schema

NameRequiredDescriptionDefault
repoYes
resultsYesOne entry per path, in the order given.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "PathRisk": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "advice": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "description": "How carefully to change this code. Follow it.",
      +          "title": "Advice"
      +        },
      +        "agents": {
      +          "anyOf": [
      +            {
      +              "additionalProperties": {
      +                "type": "integer"
      +              },
      +              "type": "object"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "title": "Agents"
      +        },
      +        "ai": {
      +          "anyOf": [
      +            {
      +              "type": "integer"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "title": "Ai"
      +        },
      +        "ai_pct": {
      +          "anyOf": [
      +            {
      +              "type": "number"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "title": "Ai Pct"
      +        },
      +        "critical_path": {
      +          "anyOf": [
      +            {
      +              "type": "boolean"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "description": "Any file under the path is on a critical path.",
      +          "title": "Critical Path"
      +        },
      +        "debt_pct": {
      +          "anyOf": [
      +            {
      +              "type": "number"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "title": "Debt Pct"
      +        },
      +        "fading": {
      +          "anyOf": [
      +            {
      +              "type": "integer"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "title": "Fading"
      +        },
      +        "files": {
      +          "anyOf": [
      +            {
      +              "type": "integer"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "description": "Tracked files under the path.",
      +          "title": "Files"
      +        },
      +        "found": {
      +          "description": "False if the path is not a tracked file or folder; then only note is set.",
      +          "title": "Found",
      +          "type": "boolean"
      +        },
      +        "lines": {
      +          "anyOf": [
      +            {
      +              "type": "integer"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "title": "Lines"
      +        },
      +        "most_unread_files": {
      +          "anyOf": [
      +            {
      +              "items": {
      +                "$ref": "#/$defs/UnreadFile"
      +              },
      +              "type": "array"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "description": "For folders: files with the most unread lines.",
      +          "title": "Most Unread Files"
      +        },
      +        "note": {
      +          "anyOf": [
      +            {
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "title": "Note"
      +        },
      +        "path": {
      +          "description": "The path as you passed it.",
      +          "title": "Path",
      +          "type": "string"
      +        },
      +        "risk": {
      +          "anyOf": [
      +            {
      +              "enum": [
      +                "none",
      +                "low",
      +                "medium",
      +                "high",
      +                "very high"
      +              ],
      +              "type": "string"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "title": "Risk"
      +        },
      +        "skimmed": {
      +          "anyOf": [
      +            {
      +              "type": "integer"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "title": "Skimmed"
      +        },
      +        "understood": {
      +          "anyOf": [
      +            {
      +              "type": "integer"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "title": "Understood"
      +        },
      +        "understood_by": {
      +          "anyOf": [
      +            {
      +              "additionalProperties": {
      +                "type": "integer"
      +              },
      +              "type": "object"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "title": "Understood By"
      +        },
      +        "unread": {
      +          "anyOf": [
      +            {
      +              "type": "integer"
      +            },
      +            {
      +              "type": "null"
      +            }
      +          ],
      +          "default": null,
      +          "title": "Unread"
      +        }
      +      },
      +      "required": [
      +        "path",
      +        "found"
      +      ],
      +      "title": "PathRisk",
      +      "type": "object"
      +    },
      +    "UnreadFile": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "path": {
      +          "title": "Path",
      +          "type": "string"
      +        },
      +        "unread": {
      +          "title": "Unread",
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "path",
      +        "unread"
      +      ],
      +      "title": "UnreadFile",
      +      "type": "object"
      +    }
      +  },
      +  "additionalProperties": true,
      +  "properties": {
      +    "repo": {
      +      "title": "Repo",
      +      "type": "string"
      +    },
      +    "results": {
      +      "description": "One entry per path, in the order given.",
      +      "items": {
      +        "$ref": "#/$defs/PathRisk"
      +      },
      +      "title": "Results",
      +      "type": "array"
      +    }
      +  },
      +  "required": [
      +    "repo",
      +    "results"
      +  ],
      +  "title": "ComprehensionRisk",
      +  "type": "object"
      +}
  2. First observedv0.3.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare readOnly/idempotent/non-destructive, but the description goes well beyond them: it explains the scoring vocabulary, how AI-written lines are attributed (commit trailer markers such as Co-Authored-By: Claude), the per-path field set, and the edge case that a nonexistent path returns found=false. That is exactly the kind of domain semantics 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?

Front-loaded with the purpose, then a labeled "When to use" clause and a labeled returns block — easy to scan and nothing is buried. The field-by-field enumeration of the return object is somewhat long given an output schema already exists, which keeps it just short of 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 read-only, two-parameter analytic tool, the definition covers purpose, trigger conditions, sibling routing, the attribution rule that makes the numbers meaningful, the response shape, and the missing-path edge case. Nothing an agent needs in order to call it correctly or interpret the result is absent.

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 coverage is 100%, and both parameters already document defaults, relativity to the repo root, and the '.' shorthand, so the schema does the heavy lifting. The description only adds framing that paths should be ones you are about to change; it contributes little beyond the structured field text, so the baseline 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 ("Rate how risky it is to change specific files or folders") plus the basis of the rating (how much of their AI-written code the team has demonstrated understanding of). It also names the two sibling tools it is not (repo_status for the whole repo, who_understands to find a reviewer), so an agent can route without opening another 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 trigger: "before editing existing code in a non-trivial way," which sets both timing and a scope exclusion (trivial edits). It also routes to alternatives by condition — repo_status for whole-repository scope and who_understands for reviewer lookup — and tells the agent to follow the returned advice at high/very-high risk.

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