Skip to main content
Glama

Get pull request snapshot

gh_get_pr
Read-onlyIdempotent

Retrieves metadata and exact base/head commit SHAs for a single GitHub pull request, performing a read-only GET request without modifying state.

Instructions

Read-only: return bounded metadata and exact base/head commit SHAs for one GitHub pull request. Performs one noninteractive GET request and cannot create comments, submit reviews, merge the pull request, request approval, or modify GitHub state.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
repoYesCanonical GitHub repository name without path separators.
ownerYesCanonical GitHub repository owner.
numberYesPositive pull request number.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYes
bodyNo
stateYes
titleYes
authorNo
labelsNo
numberYes
isDraftNo
closedAtNo
commentsNo
additionsNo
createdAtNo
deletionsNo
updatedAtNo
baseRefOidYes
headRefOidYes
baseRefNameNo
headRefNameNo
changedFilesNo
Behavior5/5

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

Annotations already declare readOnlyHint and idempotentHint, but the description adds concrete context: 'one noninteractive GET request' and a clear list of prohibited actions. This goes beyond annotations, addressing what the agent can safely expect. No contradiction found.

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?

Two sentences, front-loaded with purpose. No filler, every word contributes. First sentence states the core functionality, second clarifies boundaries. Highly concise and structured.

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 simple read-only GET with 3 parameters and an output schema, the description fully covers the behavior. It includes all necessary constraints and emphasizes read-only nature. Given the output schema exists, no return format explanation is needed.

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%, with clear descriptions for each parameter. The description adds no new detail about parameters beyond confirming the PR number reference. Baseline of 3 is appropriate since schema handles the semantics fully.

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 clearly states the tool's function: returns bounded metadata and exact base/head commit SHAs for a single pull request. The verb 'return' with specific resources ('metadata', 'SHAs') distinguishes it from siblings like gh_get_pr_diff or gh_get_pr_reviews, which focus on other aspects.

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 description implies usage for read-only snapshot retrieval and explicitly lists what the tool cannot do (create comments, submit reviews, merge, request approval, modify state). It does not name alternative tools for specific needs (e.g., diff, reviews), but the exclusions provide guidance on when not to use it.

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/fvanevski/gh_mcp'

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