Skip to main content
Glama

Read a chunk of a file

read
Read-only

Retrieve precise file chunks by symbol, line range, markdown section, or log tail/filter to avoid full-file scans; omit parameters to get the file index.

Instructions

Only a chunk of a file: the function or class symbol (PHP, TS, JS, Vue, Python; list = several in one call), the section of a .md, a range lines, or from a log the last tail or those containing contains; without anything, the file index. Use it instead of Read, cat or sed. Read-only, inside the root; does not read secrets.

Input Schema

NameRequiredDescriptionDefault
fileYespath relative to the root
tailNologs: last N lines
linesNorange «120-180»
formatNoconcise = essentials onlydetailed
symbolNofunction, class or title; list = several
containsNologs: lines containing this text
max_linesNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.5.1

TDQS

A3.8/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, and the description reinforces read-only while adding genuinely new behavioral constraints: it stays "inside the root" and "does not read secrets." That sandboxing/security context is not derivable from the annotations, though return format and size limits (max_lines default 120) are not elaborated.

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?

It is a single dense sentence with no filler, front-loading the scoping constraint ("Only a chunk of a file") and then the modes. The semicolon-chained clause style is compact but somewhat cryptic, which slightly hurts parseability.

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 7-parameter read tool with no output schema, the description covers the modes, the safety profile, and the root/secret boundaries. It is nearly complete, with only minor gaps around output shape and truncation behavior left implicit.

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 86%, so the baseline is 3, but the description adds mode-selection semantics the schema does not spell out — which parameter activates which behavior and that the file index is returned when nothing is supplied. This helps an agent choose parameters rather than just parse them.

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 names a specific verb (read) and enumerates the concrete modes — symbol extraction, .md section, line range, log tail/contains, or default file index — so the agent knows exactly what content it returns. It is clear but does not differentiate itself from the sibling `search` tool, only from external CLI tools (Read/cat/sed).

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?

"Use it instead of Read, cat or sed" gives a when-to-use directive, but the alternatives named are external tools rather than the sibling MCP tools `search` and `run`. There is no stated condition for choosing `read` over `search`, so usage is implied rather than explicit.

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

Deploy Server

Other Tools