Skip to main content
Glama
GitHub PR Issue Analyser

GitHub PR Issue Analyser

by saidsef

Github Get Repository File

github_get_repository_file
Read-only

Reads a single repository file at a chosen ref, using byte limits and offsets to return partial content with a next offset for continuation.

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 is listed through github_api_read instead. See #409.

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

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "repo_owner": "<repo_owner>",
      "repo_name": "<repo_name>",
      "path": "<path>"
    },
    "name": "github_get_repository_file"
  }
}

Input 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

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

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

Annotations already cover read-only/safety, and the description adds real behavior: bytes_total always reflects the whole file and next_offset carries on, so a truncated read is never mistaken for the full file. The 'See #409' reference is opaque noise and there is no mention of auth or binary-file handling.

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 windowing guarantee is front-loaded and explained in two tight sentences before the sibling pointer and workflow note. 'See #409' is an unresolvable artifact that costs a little clarity, but nothing else is wasted.

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?

For a six-parameter read tool with annotations and an output schema, the description covers scope, the truncation contract, and the directory alternative. Remaining gaps (repo_owner/repo_name semantics, error behavior on missing paths) are minor.

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 coverage is 67% and the description adds meaning beyond it by explaining the limit/offset window contract and that a partial read is explicitly signposted via next_offset. repo_owner and repo_name remain undocumented in both places, but the described semantics are richer than the schema alone.

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?

States a specific verb and resource ('Reads one file from a repository at ref') plus the windowing scope, and explicitly routes directory cases to github_api_read, which cleanly separates it from the closest sibling.

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?

Gives an explicit when-not ('A directory is listed through github_api_read instead') and explains the continue-with-next_offset workflow. It doesn't address adjacent read tools like github_get_pr_content, but the guidance is concrete rather than implied.

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