Skip to main content
Glama
github-fetcher

github-fetcher

by KurvCygnus

GitHub file

github_file
Read-onlyIdempotent

Read one file from a GitHub repository at a branch, tag, or commit, returning UTF-8 text plus SHA, size, and truncation details.

Instructions

Read one file at a ref. Returns UTF-8 text when possible, never binary bytes, and reports sha, size, and truncation.

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
start_lineNoFirst line to return, 1-based; defaults to 1

Schema Changelog

Changes observed during successful MCP inspections.

  1. 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"
      +}
  2. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With readOnlyHint/idempotentHint already declaring the safety profile, the description earns credit for adding behavior the annotations cannot: encoding handling (UTF-8 text when possible), an explicit guarantee that binary bytes are never returned, and disclosure that results are truncated and reported via sha/size. It does not cover auth requirements or rate-limit behavior for an openWorld tool.

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?

A single sentence, front-loaded with the action and resource, then the return contract. Every clause carries distinct information (text encoding, binary exclusion, metadata fields) with no redundancy.

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 no output schema, the description adequately explains what comes back: text when possible, no binary, plus sha, size, and truncation signals. Remaining gaps are minor — no mention of cache behavior (the `fresh` flag) or auth/rate-limit constraints, though the openWorld annotation hints at network dependence.

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 description coverage is 100%, so all six parameters including ref, start_line, end_line, and fresh are already documented inline. The description adds only "at a ref" and the truncation notion, which is consistent with but not richer than the schema, so the baseline 3 applies.

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) and a bounded resource (a single file at a git ref), which implicitly separates it from bulk siblings like github_tree and github_search_code. It stops short of naming any sibling explicitly, so an agent must infer the boundary.

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: the singular "one file" suggests it is for targeted single-file reads rather than listing or searching. There is no explicit when-to-use statement, no exclusion of alternatives, and no guidance on how to discover a path (e.g., via github_tree) before calling.

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