Skip to main content
Glama

repo_file

Read-only

Reads files at a ref: one file (path) or up to 20 parts (files) - whole files, line ranges or declarations (symbol: a function, class, method or type with its leading comment, found heuristically). Up to 204800 bytes per response, so large files are read in ranges via startLine/endLine (totalLines is returned); a failed part carries its own error without affecting the others.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
refNoBranch, tag or sha; defaults to the default branch.
pathNoSingle file path from the repository root.
filesNoSeveral parts: whole files, line ranges or declarations by name.
symbolNoDeclaration name in the path file.
endLineNoLast line of the range for path, inclusive.
startLineNoFirst line of the range for path (1-based).
lineNumbersNoInclude line numbers; default true.
repositoryIDYesRepository ID.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.3/5.0
Behavior5/5

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

Goes well beyond readOnlyHint=true by disclosing the 204800-byte response cap, the resulting need to paginate large files via startLine/endLine, that totalLines is returned, that symbol lookup is heuristic, and that a failed part carries its own error without affecting siblings. These are precisely the behavioral traits an agent needs and that annotations cannot convey.

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?

A single dense sentence, but front-loaded with the core capability and the mode choice before drilling into limits and error handling. Every clause carries information; only the nested parenthetical about 'symbol' is slightly heavy.

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, the description usefully covers returns (totalLines) and partial-failure behavior, and it addresses the byte cap that governs pagination. It stops short of describing the response shape (e.g. how content and errors are structured per part), which is the main remaining gap for an 8-parameter read tool.

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 100%, so baseline is 3, but the description adds real semantic value: it explains the path-vs-files duality (one file vs up to 20 parts), clarifies that symbol means a declaration 'with its leading comment' found heuristically, and ties startLine/endLine to the byte-limit workaround. That exceeds what the schema's terse field descriptions convey.

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 files at a ref') and immediately enumerates the two modes (single 'path' vs up to 20 'files' parts) and the three part types (whole file, line range, declaration). This distinguishes it clearly from siblings like repo_search, repo_blame, and repo_history.

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?

The description implies when each mode applies (single file vs batched parts; ranges when files are large), but never explicitly says when to prefer this over file_get, repo_context, or repo_search. Usage is inferable from the mechanics rather than stated as guidance or exclusions.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources