Skip to main content
Glama

read_file

Read a file from a repository by specifying a path and optional line range to retrieve exact content for targeted code inspection.

Instructions

Read text content from a file inside the repository with line windowing.

Args: path: Relative path to the file inside the repository. start_line: 1-indexed starting line number (default: 1). end_line: 1-indexed ending line number (default: None, reads up to 1000 lines).

Returns: JSON string containing path, line numbers, content, and truncation status.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
end_lineNo
start_lineNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations available, the description carries the behavioral transparency burden and does a solid job: it states the default 1000-line cap, the 1-indexed line behavior, and the JSON return shape including truncation status. It does not mention error handling for missing files or invalid line ranges, but for a read operation this is a minor gap.

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?

The description is compact and well-structured, with a front-loaded purpose sentence followed by a clear Args section and a Returns section. No sentence is wasted, and every line earns its place.

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

Completeness5/5

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

Given the tool's low complexity, no annotations, and the presence of an output schema, the description covers everything an agent needs: purpose, parameter semantics, defaults, line limit, and return contents. It is complete enough for reliable selection and invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description fully compensates by explaining each parameter: path is a relative repository path, start_line is 1-indexed with default 1, and end_line is 1-indexed with default None and a 1000-line limit. This adds real meaning beyond the bare schema types.

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?

The description clearly states a specific verb and resource: 'Read text content from a file inside the repository with line windowing.' It is unambiguous and distinct from siblings like list_files or search_code, though it does not explicitly name or contrast those alternatives.

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 intended use is implied by the tool's name and first sentence, and the line-windowing parameters clarify how to read a specific range of lines. However, the description does not explicitly say when to prefer this over search_code, list_files, or get_git_diff, nor does it mention any exclusion conditions.

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