Skip to main content
Glama
github-fetcher

github-fetcher

by KurvCygnus

GitHub file

github_file
Read-onlyIdempotent

Read a single file from a GitHub repository at a branch, tag, or commit, returning UTF-8 text with SHA, size, and truncation details; use line ranges and byte limits for large files.

Instructions

Read one file at a ref. Returns UTF-8 text when possible, never binary bytes, and reports sha, size, and truncation. Returns {repo, path, ref, sha, size, encoding, content, binary, truncated, start_line, end_line, total_lines}.

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": "<repo>",
      "path": "<path>"
    },
    "name": "github_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNoBranch, tag, or commit; defaults to the repository default branch
pathYesFile path inside the repository
repoYesRepository in owner/name form
freshNoBypass the local cache
end_lineNoLast line to return, inclusive; defaults to the file end
max_bytesNoPer-call byte budget for the returned text; defaults to GITHUB_MCP_MAX_FILE_BYTES
start_lineNoFirst line to return, 1-based; defaults to 1

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changedv0.3.0
    • addedInput schema / properties / max_bytes
      Added value: +{
      +  "description": "Per-call byte budget for the returned text; defaults to GITHUB_MCP_MAX_FILE_BYTES",
      +  "maximum": 9007199254740991,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  2. Changed2 schema fields changedv0.2.1
    • addedInput schema / properties / end_line
      Added value: +{
      +  "description": "Last line to return, inclusive; defaults to the file end",
      +  "maximum": 9007199254740991,
      +  "minimum": 1,
      +  "type": "integer"
      +}
    • addedInput schema / properties / start_line
      Added value: +{
      +  "description": "First line to return, 1-based; defaults to 1",
      +  "maximum": 9007199254740991,
      +  "minimum": 1,
      +  "type": "integer"
      +}
  3. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnly, idempotent, non-destructive, open-world, so the safety profile is covered. The description adds real value beyond that: UTF-8-only output, binary bytes never returned, and the presence of sha/size/truncation metadata, which tells the agent how to handle large or binary files. It omits the interaction between truncation and the byte budget, and says nothing about auth or rate limits.

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?

Two sentences, front-loaded with the operation and followed by the return contract; no filler or hedging. The second sentence is a dense field enumeration, which is slightly list-like but earns its place because no output schema exists.

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 no output schema and seven parameters, the description correctly spends its budget on the return shape and the binary/truncation semantics an agent needs to interpret results. It is slightly incomplete on how truncated=true should be remedied (smaller line range vs. larger max_bytes) and on encoding behavior for non-UTF-8 files.

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 coverage is 100%, so every parameter (ref, path, repo, fresh, start_line, end_line, max_bytes) is already documented in the schema. The description's mention of truncation and line ranges gestures at start_line/end_line/max_bytes but adds no syntax or precedence detail beyond what the schema states. Baseline 3 is appropriate.

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?

"Read one file at a ref" gives a specific verb (read), a bounded resource (one file), and a locating mechanism (a ref), so an agent can distinguish this from tree/search/readme siblings without opening the schema. It stops short of naming an explicit sibling to contrast with, which keeps it out of 5 territory.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is only implied by "Read one file at a ref" plus the binary/truncation caveats; there is no explicit when-to-use or when-not-to-use statement. Nothing routes the agent away from github_readme or github_tree when the intent is ambiguous, so the agent must infer the boundary.

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