Skip to main content
Glama
kmandana
by kmandana

get_pr_context

Retrieve diff and commits between branches to generate pull request descriptions.

Instructions

Get diff and commits between branches for PR description.

IMPORTANT: After calling this tool, you should:

  1. Check if .devnarrate/pr-templates/ directory exists (use ls or Bash)

  2. If templates exist, list them and ask user which template to use

  3. Read the chosen template file (use Read tool)

  4. If no templates exist, use git_operations.DEFAULT_PR_TEMPLATE

  5. Analyze the diff and commits to fill the template

Args: base_branch: Base branch to compare against (e.g., "main", "dev") head_branch: Head branch (defaults to current branch) cursor: Pagination cursor for large diffs (optional, returned as next_cursor) max_diff_tokens: Maximum tokens per diff chunk (default: 12000, leaves room for commits/files in 25k limit) repo_path: Path to git repository (optional, defaults to Claude's working directory)

Returns: JSON string with commits, files, diff chunk, and pagination info

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cursorNo
repo_pathNo
base_branchYes
head_branchNo
max_diff_tokensNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior3/5

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

No annotations exist, so the description bears full responsibility. It reveals that the tool returns a JSON string with commits, files, diff chunk, and pagination info, and explains the max_diff_tokens parameter. However, it does not state whether the tool is read-only or discuss side effects, authentication, or rate limits.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose, but the IMPORTANT section includes workflow instructions that go beyond tool behavior, adding length. While useful, it could be more concise. The parameter descriptions are clear and structured.

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?

Given the tool's complexity (branches, diffs, pagination, token limits) and that an output schema exists, the description covers the main aspects: branch specification, pagination via cursor, token limit rationale, and return type. Missing details on error handling or prerequisites but adequate for the complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description compensates by explaining all five parameters: base_branch, head_branch, cursor, max_diff_tokens, repo_path. It provides defaults, purpose (e.g., pagination cursor, token limit), and context (e.g., 'leaves room for commits/files in 25k limit').

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?

The description explicitly states 'Get diff and commits between branches for PR description,' clearly identifying the tool's action and target. It distinguishes from siblings like get_commit_context and review_changes, which serve different purposes.

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?

The IMPORTANT section provides a step-by-step workflow for using the tool's output, guiding the agent on when to call it (for PR description generation) and how to proceed. It lacks explicit exclusions but offers clear context.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kmandana/DevNarrate'

If you have feedback or need assistance with the MCP directory API, please join our Discord server