Skip to main content
Glama

Check pull request risk

check_pr_risk
Read-only

Runs rule-based risk checks on pull requests to flag possible secrets, sensitive files, large diffs, missing tests, CI/migration/dependency changes, and debug code. Returns a risk level and findings.

Instructions

Run rule-based risk checks on a pull request: possible secrets in added lines (masked), sensitive files, large diffs, source changes without tests, CI workflow, migration and dependency changes, and leftover debug code. Returns an overall level (none/low/medium/high) and findings with file and line where possible. These are heuristics: confirm each finding by reading the code with get_pr_diff before reporting it.

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": {
      "owner": "<owner>",
      "repo": "<repo>",
      "pullNumber": "<pullNumber>"
    },
    "name": "check_pr_risk"
  }
}

Input Schema

NameRequiredDescriptionDefault
repoYesRepository name, e.g. 'next.js'
ownerYesRepository owner (user or org), e.g. 'vercel'
pullNumberYesPull request number

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=true, so safety is covered; the description goes further by disclosing the return shape (overall level none/low/medium/high, findings with file and line where possible), that secrets are masked, and that results are heuristic rather than definitive. Minor gaps remain (no mention of cost, latency, or limits on diff size), but this is meaningful added context beyond the annotations.

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?

Three sentences, front-loaded with the action, then the return contract, then the caveat and follow-up. The check enumeration is dense but every item carries selection weight; nothing is redundant with the title or annotations.

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 carries the burden of describing returns and does so (level enum plus findings with file/line). For a read-only, three-parameter tool with full annotation coverage, an agent has everything needed to call it and interpret results without guessing.

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% and all three parameters (owner, repo, pullNumber) are documented in the schema with examples. The description adds no parameter-level meaning such as whether pullNumber accepts closed PRs or cross-fork PRs, so the baseline of 3 is appropriate.

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 ("Run rule-based risk checks on a pull request") and then enumerates the exact check categories: secrets in added lines, sensitive files, large diffs, missing tests, CI workflow, migration/dependency changes, leftover debug code. That enumeration makes it unmistakably distinct from get_pr_diff (raw diff retrieval) and summarize_pr (narrative summary).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives an explicit downstream workflow: confirm findings with get_pr_diff before reporting them. It also frames the output as heuristics, which tells the agent not to treat results as authoritative. It stops short of saying when to prefer this over summarize_pr or whether to run it before or after fetching the diff, so it is clear context but not full when/when-not guidance.

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