Skip to main content
Glama

get_file_at_ref

Retrieve file content at a specific branch, tag, or commit, with optional line slicing. Inspect historical code without cloning; binary files and files over 1 MB are rejected.

Instructions

Retrieves file content at a specific ref or commit, with optional line slicing. Use to inspect historical code without cloning. Rejects binary files and files exceeding 1 MB. Narrow with start_line and end_line.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoBranch, tag, or commit SHA (default: default branch / HEAD).
pathYesFile path inside repository.
repoYesRepository name.
ownerYesRepository owner (organization or user).
end_lineNoOptional 1-indexed ending line number.
start_lineNoOptional 1-indexed starting line number.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4/5.0
Behavior4/5

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

With no annotations, the description carries the full load, and it discloses hard behavioral limits the schema cannot express: binary files are rejected and files over 1 MB are rejected. It leaves the return shape and error/pagination behavior unstated, which keeps it short of a 5.

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?

Three short sentences, front-loaded with the core action, followed by usage then constraints. Every sentence adds information and nothing is repeated.

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 annotations and no output schema, the description covers purpose, when to use it, and the two failure limits that matter. The main remaining gap is what the returned content looks like (raw text? truncated?), but this is minor.

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 every parameter (owner, repo, path, ref, start_line, end_line) is already documented at the source. The description only adds a light hint to narrow with start_line/end_line and confirms the ref default, which is marginal beyond the schema.

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 ('Retrieves') and resource ('file content at a specific ref or commit') with a scope qualifier ('optional line slicing'). It implicitly separates itself from siblings like get_diff or get_blame by framing the job as reading file content, though it never names an alternative tool.

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?

'Use to inspect historical code without cloning' gives clear context for when this tool applies, and the binary/1 MB rejection plus 'Narrow with start_line and end_line' implicitly states when-not/refinement conditions. No explicit routing to sibling tools such as get_path_history or get_blame is offered.

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