Skip to main content
Glama
N0moreher0
by N0moreher0

Read file

project_read_file
Read-only

Read a single text file or a specific line range, returning file contents and a next line pointer when truncated for large files.

Instructions

Read a text file, optionally by line range (1-based). The result carries next_start_line when truncated. Use when: you need the contents of one file, or one line range of a large file. Avoid when: you need to read 2+ files (project_read_batch) or only need metadata (project_get_file_info). Speed: very fast on repeat; cache validated by mtime+size. Output: file_read: text, first_line, last_line, total_bytes, next_start_line. Batch-safe: yes

Input Schema

NameRequiredDescriptionDefault
end_lineNo
max_bytesNo
start_lineNo
line_numbersNo
relative_pathYesPath inside the workspace (relative, or absolute inside the workspace)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already establish readOnlyHint=true and openWorldHint=false, and the description adds useful behavior: truncation via next_start_line, repeat-speed caching validated by mtime+size, and batch-safety. It does not cover error behavior or encoding/binary handling, so it is strong but not exhaustive.

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 front-loaded and highly structured with labels for Use when, Avoid when, Speed, Output, and Batch-safe. Every sentence adds useful information without waste.

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 helpfully lists the output fields and explains truncation and caching. It is nearly complete for a file-read tool, though it leaves several schema parameters under-explained.

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 low at 20%, and the description compensates only partially by explaining 1-based line ranges and next_start_line truncation. It does not clarify max_bytes, line_numbers, or exact inclusive/exclusive semantics for start_line/end_line.

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?

The description states a specific verb and resource: 'Read a text file,' with optional line-range behavior. It clearly differentiates from siblings by naming project_read_batch and project_get_file_info for adjacent use cases.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives explicit 'Use when' and 'Avoid when' guidance, naming the sibling alternatives for batch reads and metadata-only needs. The remaining line-range case is also scoped to a single file or one range of a large file.

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