Skip to main content
Glama

read_file

Read file content with line numbers by providing a file path, and optionally specify start and end lines to read a section of the file.

Instructions

Read content from a file with line numbers, validating the file path first.

Args:
    file_path: Path to the file to read
    start_line: Line number to start reading from (0-indexed, default: 0)
    end_line: Line number to end reading at (0-indexed, inclusive, default: None for all lines)
    
Returns:
    A string with numbered lines from the file
    
Raises:
    FileNotFoundError: If the file does not exist
    ValueError: If the line parameters are invalid

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
file_pathYes
start_lineNo
end_lineNo
Behavior4/5

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

The description discloses that the tool validates the file path first, raises specific exceptions (FileNotFoundError, ValueError), and clarifies that end_line defaults to None for all lines. While no annotations are provided, this adds useful behavioral context beyond the schema.

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?

The description uses a clear docstring format with Args, Returns, Raises sections. It is well-organized but slightly verbose (e.g., '0-indexed, inclusive' could be more concise). Still, every sentence is informative.

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?

The tool has 3 simple parameters and no output schema. The description covers purpose, parameters, and error cases. It lacks details about the exact format of the output string (e.g., 'numbered lines' is vague), but overall it is sufficient for a simple read operation.

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?

The schema has 0% description coverage (no property descriptions), but the tool description explicitly details each parameter: file_path (path), start_line (0-indexed, default 0), end_line (inclusive, default None). This adds significant meaning beyond the schema's type and default information.

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 'Read content from a file with line numbers, validating the file path first', which specifies the verb (read), resource (file), and key feature (line numbers, validation). It is distinct from sibling tools which focus on Postman collection operations.

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 description implies usage by stating it reads files with line numbers and validates paths, but it does not explicitly mention when to use this tool versus alternatives or provide any exclusion criteria. No guidance on prerequisites or alternative tools is given.

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/marioToribi0/code2postman-mcp'

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