Skip to main content
Glama
saidsef

GitHub PR Issue Analyser

by saidsef

Github Get Repository File

github_get_repository_file
Read-only

Read a file from a GitHub repository at a branch, tag, or SHA. Use offset and limit to page through large files, with next_offset to continue; pass 0 as limit to get the file size without content.

Instructions

Reads one file from a repository at ref, windowed to limit bytes from offset. bytes_total is the whole file either way and next_offset says where to carry on, so a partial read never passes for the lot. A directory belongs to github_list_repository_tree. See #409.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoBranch, tag or SHA to read at. Omit for the default branch
pathYesFile path from the repository root, e.g. src/mcp_github/auth.py
limitNoCap on the bytes returned. Pass 0 to learn the size without reading
offsetNoByte to start the window at. Pass a previous next_offset to carry on
repo_nameYes
repo_ownerYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
refYes
pathYes
binaryYes
contentYes
truncatedYes
bytes_totalYes
next_offsetYes
bytes_returnedYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv42.0.0

TDQS

A4.6/5.0
Behavior5/5

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

The description goes beyond the readOnly annotation by explaining windowing semantics: 'windowed to limit bytes from offset,' and crucially clarifies that 'bytes_total is the whole file either way and next_offset says where to carry on, so a partial read never passes for the lot.' This prevents a common misreading of truncated responses.

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 three sentences with no filler: the action is first, behavior follows, and the boundary to a sibling is last. Every sentence earns its place and the structure is easy to scan.

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?

With a rich output schema and readOnly annotations, the description covers the key behavioral nuance (partial reads) and the main usage boundary (directory vs. file). It doesn't mention error handling or encoding, but those are lower-stakes for a well-schematized read tool.

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?

Schema description coverage is 67%, but the description adds meaning for the limit and offset parameters by framing them as a byte window and introducing bytes_total and next_offset as continuation semantics. It doesn't repeat schema fields, adding real value beyond the structured data.

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 states a specific verb and resource: 'Reads one file from a repository at ref,' and clearly differentiates from a sibling by noting that 'A directory belongs to github_list_repository_tree.' An agent can immediately tell this tool reads file content, not directory listings.

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 gives a clear when-not by routing directory operations to github_list_repository_tree. It lacks explicit alternatives for other file-related tools, but the unique 'at ref' and windowed-read behavior makes the context sufficiently clear.

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