Skip to main content
Glama

Read File

read_file
Read-onlyIdempotent

Read text files and extract text from PDF files on the local filesystem. Supports line offset, line cap, and line numbers for precise navigation.

Instructions

Read a file from the local filesystem. Text files are returned as-is (UTF-8); PDF files are detected automatically and their text is extracted page by page.

Args:

  • path (string): Absolute or ~-relative file path.

  • offset (number): Start reading at this 1-based line (default 1). Use with max_lines to page through big files.

  • max_lines (number): Optional cap on lines returned.

  • line_numbers (boolean): Prefix each line with "N: " (default false). Use before edit_lines, so you know the exact line numbers.

Returns the file contents. Use list_directory first if unsure of the path.

Example: { "path": "/project/README.md" } or { "path": "/app.py", "offset": 100, "max_lines": 50, "line_numbers": true }

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesFile path (absolute or ~-relative)
offsetNo1-based start line
max_linesNoOptional line cap
line_numbersNoPrefix lines with "N: "
Behavior4/5

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

Annotations already indicate readOnly, non-destructive, idempotent. Description adds automatic PDF detection and text extraction, plus return of file contents. Does not discuss handling of other binary files or errors, but sufficient given 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?

Concise (~100 words), well-structured with main sentence, parameter details, return note, and example. Front-loaded with purpose, no redundant information.

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 4 parameters and no output schema, description covers file type handling, parameter usage hints, and return value. Lacks details on error behavior or large files, but adequate for a read-only tool with good annotations.

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 100%, so baseline 3. Description adds usage context: offset is 1-based and used with max_lines for paging, line_numbers is recommended before edit_lines. This adds value beyond schema descriptions.

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?

Clearly states 'Read a file from the local filesystem' and distinguishes handling for text vs PDF. Suggests using list_directory first, differentiating from sibling tools.

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

Usage Guidelines4/5

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

Provides explicit context: use list_directory when unsure of path, and line_numbers before edit_lines. Does not explicitly state when not to use, but the guidance is clear.

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/highercomve/mcptools'

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