Skip to main content
Glama

read_content

Read-only

Read specific portions of large files by line range, tail, head, or semantic chunks. Use after search to examine content efficiently.

Instructions

Read specific portions of large files efficiently.

Use after search_content locates content, or directly with tail/head modes
for logs. Modes: 'lines' (read by offset/limit), 'semantic' (complete
functions/classes via Tree-sitter), 'tail' (last N lines - ideal for logs),
'head' (first N lines). Does NOT search - use search_content first to find
line numbers, then read_content to examine. For files over 500MB, tail/head
modes are most efficient.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
absolute_file_pathYesAbsolute path to target file
offsetNoStarting line number, 1-indexed (default: 1). Ignored in tail/head modes.
limitNoLines to return (default 100). Reduce for files with long lines (check get_overview).
patternNoPattern to position read (finds match, then reads around it). Overrides offset.
modeNoReading mode: 'lines' (by range), 'semantic' (tree-sitter chunks), 'tail' (last N), 'head' (first N)lines
Behavior5/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false. The description goes beyond these by explaining the tool's behavior in detail: it reads files efficiently, supports multiple modes (lines, semantic, tail, head), and notes that pattern overrides offset. It also explicitly states it does not search, reinforcing its non-destructive nature. No contradictions with annotations.

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 concise at 4 sentences with no filler. It is front-loaded with the main purpose, then provides usage guidance, then mode details, and ends with a performance tip for large files. Every sentence earns its place, and the structure is logical and easy to parse.

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?

Given the tool has 5 parameters, no output schema, and no enums or nested objects, the description is fairly complete. It explains all modes, behavior for each, usage order, and a performance consideration. However, it does not describe the return format (e.g., raw text lines or structured data) or error handling (e.g., file not found). While the core clarity is high, a brief note on what the output looks like would improve completeness.

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 coverage is 100% for all 5 parameters, so the schema already describes them. However, the description adds essential meaning: it explains that offset is 1-indexed, that pattern overrides offset, and that tail/head modes ignore offset. It also clarifies the purpose of each mode ('semantic' for tree-sitter, 'tail' for logs). These details are not in the schema's parameter descriptions, thus adding significant value.

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 clearly states the tool reads specific portions of large files efficiently, using a specific verb 'read' and resource 'portions of large files'. It distinguishes itself from sibling tools like search_content by explicitly stating it does NOT search, and from edit_content by implication (read vs edit). The description also names the four modes, providing a clear picture of its functionality.

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?

The description provides explicit guidance on when to use this tool: 'Use after search_content locates content, or directly with tail/head modes for logs.' It also tells the agent what not to do: 'Does NOT search - use search_content first to find line numbers, then read_content to examine.' This clearly differentiates from the sibling search_content tool.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/peteretelej/largefile'

If you have feedback or need assistance with the MCP directory API, please join our Discord server