Skip to main content
Glama

read_file_lines

Retrieve a specific line range from a file to inspect stack-trace regions or chunks of large files without loading the entire content. Read-only and safe.

Instructions

Return a 1-indexed inclusive line slice of a file. Out-of-range bounds clamp silently to the file's actual length; to < from throws. Read-only; no side effects, auth, or rate limits. Returns the snippet plus its size_bytes and est_tokens. Use to inspect a stack-trace region or a chunk of a large file without pulling the whole body. Prefer read_section if you know the heading, grep_in_file if you know a pattern but not the line number.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesFile ID
toYesLast line (1-indexed, inclusive)
fromYesFirst line (1-indexed, inclusive)
Behavior5/5

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

With no annotations provided, the description carries the full burden. It discloses read-only nature, no side effects/auth/rate limits, silent clamping for out-of-range bounds, throws on to<from, and return contents (snippet plus size_bytes and est_tokens). This is exemplary transparency for an unannotated tool.

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?

Six sentences, each earning its place: core action, edge cases, side-effect declaration, return shape, use case, and sibling alternatives. Front-loaded with the primary verb and resource. No filler or repetition.

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?

For a simple read tool with 3 required params and no output schema, the description fully covers purpose, behavioral quirks, return values, and usage context. Nothing critical is missing; the tool is simple enough that this is complete.

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 100%, so baseline is 3. The description reiterates 1-indexed inclusive semantics and adds clamping behavior tied to from/to, but does not materially expand parameter meaning beyond the schema. No missed parameters or ambiguity.

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 starts with a specific verb+resource+scope: 'Return a 1-indexed inclusive line slice of a file.' It clearly distinguishes from siblings by naming exact alternatives (read_section, grep_in_file), making the tool's unique purpose unmistakable.

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?

Explicitly states when to use: 'Use to inspect a stack-trace region or a chunk of a large file without pulling the whole body.' It also names alternatives with specific conditions: 'Prefer read_section if you know the heading, grep_in_file if you know a pattern but not the line number.' This is exactly what the rubric requires.

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/safiyu/kontexta'

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