Skip to main content
Glama
GitHub PR Review MCP Server

GitHub PR Review MCP Server

analyze_code_diff

Analyze Git diff content to detect code issues and security vulnerabilities, with optional language-specific security checks.

Instructions

Analyze specific code changes for issues and security vulnerabilities

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": {
      "diff_content": "<diff_content>",
      "file_path": "<file_path>"
    },
    "name": "analyze_code_diff"
  }
}

Input Schema

NameRequiredDescriptionDefault
languageNoProgramming language (auto-detected if not provided)
file_pathYesPath of the file being analyzed
diff_contentYesGit diff content to analyze
include_securityNoInclude security analysis (default: true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

C2.9/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full disclosure burden and does not meet it. It does not say whether the operation is read-only, whether analysis is local or sent to an external model, how long it may take, or how include_security alters behavior beyond the default.

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?

A single front-loaded sentence with no filler or redundancy. It is efficient, though its brevity borders on under-specification for a tool with four parameters and no annotations.

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

Completeness2/5

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

With no annotations and no output schema, the description is the only source for behavioral and return-value expectations, and it says nothing about the shape of the analysis results. For a 4-parameter analysis tool it leaves the agent guessing about output and about how it relates to the sibling review tools.

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 all four parameters are already documented, including the auto-detection behavior for language and the default for include_security. The description adds no format or constraint detail beyond the schema, so the baseline 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb ('Analyze') and resource ('specific code changes') plus the analysis targets ('issues and security vulnerabilities'). The scope is clear enough to distinguish it from the PR-fetching siblings, though it never explicitly contrasts itself with review_pull_request.

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

Usage Guidelines2/5

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

There is no guidance on when to use this versus review_pull_request or the get_* siblings, and no stated prerequisites (e.g., whether a diff must come from an existing PR). The only implied usage is that the agent must already have diff content in hand.

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