Skip to main content
Glama

pr_comprehension

Read-onlyIdempotent

Summarize a branch or pull request by comparing AI-written lines with the base and showing how many lines anyone understands before opening or merging it.

Instructions

Summarize a branch or pull request: the AI-written lines it adds compared with base and how many of them anyone understands.

When to use: before opening or merging a pull request, or when asked how much of a branch is AI-written. For
the whole repository use repo_status. The base ref must exist locally (run git fetch if it is missing).

Returns {"base", "merge_base", "commits", "ai", "human", "understood", "unread", "tools" (AI lines per agent),
"files": [{"path", "ai", "human", "understood", "unread", "partial"}], "markdown" (a ready-to-post PR comment)}.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "pr_comprehension"
  }
}

Input Schema

NameRequiredDescriptionDefault
baseNoBranch to compare with, e.g. 'origin/main' or 'main'.origin/main
repoNoPath inside the git repository. Defaults to the server's working directory.

Output Schema

NameRequiredDescriptionDefault
aiYesAI-written lines the branch adds.
baseYes
filesYes
humanYes
toolsYesAI agent -> lines it added on this branch.
unreadYes
commitsYes
markdownYesReady-to-post pull request comment.
merge_baseYes
understoodYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.4.0
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$defs": {
      +    "PrFile": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "ai": {
      +          "title": "Ai",
      +          "type": "integer"
      +        },
      +        "human": {
      +          "title": "Human",
      +          "type": "integer"
      +        },
      +        "partial": {
      +          "description": "Only part of the file's AI-written lines are understood.",
      +          "title": "Partial",
      +          "type": "boolean"
      +        },
      +        "path": {
      +          "title": "Path",
      +          "type": "string"
      +        },
      +        "understood": {
      +          "title": "Understood",
      +          "type": "integer"
      +        },
      +        "unread": {
      +          "title": "Unread",
      +          "type": "integer"
      +        }
      +      },
      +      "required": [
      +        "path",
      +        "ai",
      +        "human",
      +        "understood",
      +        "unread",
      +        "partial"
      +      ],
      +      "title": "PrFile",
      +      "type": "object"
      +    }
      +  },
      +  "additionalProperties": true,
      +  "properties": {
      +    "ai": {
      +      "description": "AI-written lines the branch adds.",
      +      "title": "Ai",
      +      "type": "integer"
      +    },
      +    "base": {
      +      "title": "Base",
      +      "type": "string"
      +    },
      +    "commits": {
      +      "title": "Commits",
      +      "type": "integer"
      +    },
      +    "files": {
      +      "items": {
      +        "$ref": "#/$defs/PrFile"
      +      },
      +      "title": "Files",
      +      "type": "array"
      +    },
      +    "human": {
      +      "title": "Human",
      +      "type": "integer"
      +    },
      +    "markdown": {
      +      "description": "Ready-to-post pull request comment.",
      +      "title": "Markdown",
      +      "type": "string"
      +    },
      +    "merge_base": {
      +      "title": "Merge Base",
      +      "type": "string"
      +    },
      +    "tools": {
      +      "additionalProperties": {
      +        "type": "integer"
      +      },
      +      "description": "AI agent -> lines it added on this branch.",
      +      "title": "Tools",
      +      "type": "object"
      +    },
      +    "understood": {
      +      "title": "Understood",
      +      "type": "integer"
      +    },
      +    "unread": {
      +      "title": "Unread",
      +      "type": "integer"
      +    }
      +  },
      +  "required": [
      +    "base",
      +    "merge_base",
      +    "commits",
      +    "ai",
      +    "human",
      +    "understood",
      +    "unread",
      +    "tools",
      +    "files",
      +    "markdown"
      +  ],
      +  "title": "PrComprehension",
      +  "type": "object"
      +}
  2. First observedv0.3.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive and closed-world, so the safety profile is covered. The description adds behavioral context beyond them: the local-ref prerequisite and a concrete inventory of the returned measurement categories. It stops short of noting cost or failure modes when the base ref is invalid.

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 usage, then return shape — an easy scan for an agent. The long enumeration of return keys is somewhat list-heavy, especially since an output schema exists, but each item is informative rather than filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a two-parameter read-only analysis tool, purpose, usage, alternative routing and the local-ref prerequisite are all present. The explicit return-key listing partially duplicates the existing output schema, so it is complete but not perfectly economical.

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%, with both 'base' and 'repo' fully described, so the baseline is 3. The description reinforces that base is a ref that must resolve locally, which is mild added meaning but not syntax or default-behavior detail beyond the schema.

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?

Names a specific verb (summarize) and resource (branch or pull request) and defines the exact measurement: AI-written lines added versus base, plus how many are understood. It explicitly contrasts with repo_status, so an agent can distinguish it from the 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?

Provides an explicit 'When to use' clause (before opening or merging a PR, or when asked how much of a branch is AI-written), names the alternative for the repo-wide case, and adds the prerequisite that the base ref must exist locally with the remediation (git fetch).

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