Skip to main content
Glama
saidsef

GitHub PR Issue Analyser

by saidsef

Github Get Repository File

github_get_repository_file
Read-only

Reads a file from a GitHub repository at a given ref, supporting byte-offset windows and continuation for partial reads, enabling efficient analysis of large files.

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.

Workflow and conventions: github_get_skill('pr-analysis').

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.1/5.0
Behavior4/5

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

Annotations already declare readOnlyHint and destructiveHint, but the description adds valuable behavior: windowed reads, bytes_total representing the whole file, next_offset for continuation, and the guarantee that a partial read is not mistaken for the full file. This is meaningful beyond what the annotations alone communicate.

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?

The description is compact and front-loaded, with the core behavior in the first sentence and the directory exclusion immediately after. The references to '#409' and 'github_get_skill('pr-analysis')' are terse and slightly cryptic, but they do not add bloat.

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 an output schema present, the description does not need to explain return values, yet it still highlights the key continuation semantics (bytes_total and next_offset) and provides a routing rule for directories plus a workflow convention. The brief '#409' reference is the only noticeably under-specified element.

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 schema already documents ref, path, limit, and offset clearly, and the description reinforces the limit/offset windowing concept. However, repo_owner and repo_name have no schema descriptions and the description does not clarify them, so at 67% schema coverage the description does not fully compensate for the gap.

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 operation — reading one file from a repository at a ref — and distinguishes it from directory handling by explicitly routing directories to github_list_repository_tree. This clears up the main ambiguity against sibling tools like github_get_pr_content and github_get_pr_diff.

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 an explicit when-not: directories belong to github_list_repository_tree. It also points the agent to a workflow skill via github_get_skill('pr-analysis'), though it does not enumerate all alternatives or edge cases like when to prefer PR-specific content tools.

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