Skip to main content
Glama

get_file

Fetch file contents from a GitHub repository to inspect code or docs; optionally return only a line range to keep context small.

Instructions

Fetch file contents from a GitHub repository. Optionally return only a line range to keep context small.

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": {
      "full_name": "<full_name>",
      "path": "<path>"
    },
    "name": "get_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
refNo
whyNoWhy this file helps the current task (stored in journal)
pathYes
task_idNo
end_lineNo
full_nameYes
start_lineNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

B3.2/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden and mostly does not. It implies a read ("Fetch") but says nothing about default branch behavior when ref is omitted, binary/large file handling or truncation, errors on missing paths, or authentication/rate-limit constraints. The only added behavior is the optimistic line-range narrowing, which is useful but thin for a zero-annotation tool.

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 front-loaded sentences with no filler; the core action comes first and the optional narrowing second. It is efficient, though one short clause naming the primary alternative would have earned its space.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema and no annotations, the description should say more about return shape (raw text? decoded? line numbering?) and about the six undocumented parameters. It covers the core call adequately for a simple read tool but leaves ref and task_id semantics for the agent to guess.

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 14% (only 'why' is documented), so the description must compensate and it only partially does. It adds genuine meaning for start_line/end_line by framing them as a pair that narrows output for context economy, but leaves ref (branch vs. tag vs. commit SHA), task_id, and path format unexplained.

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?

States a specific verb and resource: 'Fetch file contents from a GitHub repository.' That is unambiguous about what comes back, though it never distinguishes itself from siblings like list_tree or search_in_repo, which an agent could plausibly reach for when it actually needs file contents.

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 implied rather than stated: the agent learns it may request a line range 'to keep context small', which is a real selection heuristic. There is no explicit when-not guidance (e.g. use search_in_repo when the path is unknown) and no mention of prerequisites such as needing a known path or valid ref.

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