Skip to main content
Glama
piyushgIITian

GitHub Enterprise MCP Server

get-pull-request-files

Retrieve the list of files modified in a GitHub pull request to review changes, track modifications, and assess code impact.

Instructions

Get the list of files changed in a pull request

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
ownerYesRepository owner (username or organization)
pull_numberYesPull request number
repoYesRepository name

Implementation Reference

  • Implements the core logic of the 'get-pull-request-files' tool by calling GitHub's pulls.listFiles API and mapping the response.
    export async function getPullRequestFiles(args: unknown): Promise<any> {
      const { owner, repo, pull_number } = args as { owner: string; repo: string; pull_number: number };
      const github = getGitHubApi();
    
      return tryCatchAsync(async () => {
        const { data } = await github.getOctokit().pulls.listFiles({
          owner,
          repo,
          pull_number,
        });
    
        return data.map((file) => ({
          sha: file.sha,
          filename: file.filename,
          status: file.status,
          additions: file.additions,
          deletions: file.deletions,
          changes: file.changes,
          blob_url: file.blob_url,
          raw_url: file.raw_url,
          contents_url: file.contents_url,
          patch: file.patch,
        }));
      }, 'Failed to get pull request files');
    }
  • Defines the input schema and metadata for the 'get-pull-request-files' tool in the list of available tools.
      name: 'get-pull-request-files',
      description: 'Get the list of files changed in a pull request',
      inputSchema: {
        type: 'object',
        properties: {
          owner: {
            type: 'string',
            description: 'Repository owner (username or organization)',
          },
          repo: {
            type: 'string',
            description: 'Repository name',
          },
          pull_number: {
            type: 'number',
            description: 'Pull request number',
          },
        },
        required: ['owner', 'repo', 'pull_number'],
        additionalProperties: false,
      },
    },
  • Registers the 'get-pull-request-files' tool handler in the switch statement for CallToolRequestSchema.
    case 'get-pull-request-files':
      result = await getPullRequestFiles(parsedArgs);
      break;
  • src/server.ts:25-32 (registration)
    Imports the getPullRequestFiles handler function from './tools/files.js'.
    import {
      createOrUpdateFile,
      pushFiles,
      getFileContents,
      forkRepository,
      getPullRequestFiles,
    } from './tools/files.js';
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states a read operation ('Get'), implying it's non-destructive, but doesn't mention authentication requirements, rate limits, pagination, error conditions, or what the returned file list includes (e.g., patch details, status). For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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?

The description is a single, efficient sentence that directly states the tool's purpose with zero wasted words. It's appropriately sized for a straightforward read operation and front-loads the essential information without unnecessary elaboration.

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

Completeness3/5

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

Given the tool's moderate complexity (3 required parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on behavior, output format, and usage context. Without annotations or output schema, the agent must infer these aspects, making the description incomplete for confident tool selection and invocation.

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?

The input schema has 100% description coverage, thoroughly documenting all three parameters (owner, repo, pull_number). The description adds no additional parameter information beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting without compensating for any gaps.

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?

The description clearly states the verb 'Get' and the resource 'list of files changed in a pull request', making the purpose unambiguous. However, it doesn't explicitly differentiate from sibling tools like 'get-pull-request' or 'get-pull-request-comments', which would require more specific scope definition for a perfect score.

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?

The description provides no guidance on when to use this tool versus alternatives like 'get-pull-request' (which might include file info) or 'list-commits' (which could show file changes). There's no mention of prerequisites, context, or exclusions, leaving usage decisions entirely to the agent's inference.

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/piyushgIITian/github-enterprice-mcp'

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