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

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. Added
  2. Removed
  3. Added
  4. Removed
  5. Added
  6. Removed
  7. Changed5 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / properties / endLine / maximum
      Removed value: -9007199254740991
    • removedInput schema / properties / files / items / properties / endLine / maximum
      Removed value: -9007199254740991
    • removedInput schema / properties / files / items / properties / startLine / maximum
      Removed value: -9007199254740991
    • removedInput schema / properties / startLine / maximum
      Removed value: -9007199254740991
  8. Added
  9. Removed
  10. First observed

TDQS

A4.1/5.0
Behavior4/5

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

Annotations already establish readOnlyHint=true, destructiveHint=false, openWorldHint=false, so safety is covered. The description adds real behavioral context beyond that: the 204800-byte response cap, the totalLines return so large files can be paged with startLine/endLine, and per-part error isolation in a multi-part read. It does not cover auth or permission expectations, but adds substantial value over the annotations.

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?

Front-loaded with the core purpose and packed with useful detail in one dense block, with no filler sentences. It is somewhat run-on, bundling limits, heuristics, and error behavior into a single breath, but every clause carries information.

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 carries the return-value burden, and it does so by naming totalLines and the per-part error behavior. Combined with the byte cap and mode enumeration, an agent has enough to invoke it correctly; only auth/permission expectations and content formatting are unstated.

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 the baseline is 3, but the description earns above it by explaining semantics the schema does not: symbol resolves a function/class/method/type declaration including its leading comment and is 'found heuristically', startLine/endLine enable range reads because of the byte cap, and files is capped at 20 parts. These add genuine meaning beyond the field descriptions.

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 precise verb (Reads) and resource (files at a ref), and immediately enumerates the two operating modes: single file via path, or up to 20 parts via files, each being whole-file, line range, or declaration. This distinguishes it cleanly from siblings like file_get, repo_search, or repo_blame.

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 through the mode descriptions (single file vs multi-part, ranges for large files), but there is no explicit when-to-use-this vs an alternative sibling, and no statement of when not to use it. The agent can infer intent but must reason about it.

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