Skip to main content
Glama

read_file

Read text and document files (PDF, DOCX, PPTX, XLSX, ODT, ODP, ODS) with flexible modes: full file, first N lines, last N lines, or a specific line range. Extracts PDF content with format metadata.

Instructions

Read files with flexible modes. Supports text and documents (PDF, DOCX, PPTX, XLSX, ODT, ODP, ODS). PDF: Extracts with format metadata (fonts, colors, layout). Modes: full (entire file), head (first N lines), tail (last N lines), range (lines from startLine to endLine, inclusive, 1-indexed). Document files ignore mode parameters and always return full content. Only works within allowed directories.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the file to read
modeNoRead mode: 'full' reads entire file, 'head' reads first N lines, 'tail' reads last N lines, 'range' reads lines from startLine to endLine (inclusive, 1-indexed). Document files (PDF, DOCX, etc.) ignore mode and always return full content.full
linesNoNumber of lines to read (required when mode is 'head' or 'tail', must be positive integer)
startLineNoStarting line number (1-indexed, required when mode is 'range')
endLineNoEnding line number (1-indexed, inclusive, required when mode is 'range')
Behavior4/5

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

No annotations are provided, so the description carries full burden. It discloses modes, document file behavior, PDF metadata extraction, and allowed directory constraints. It could mention limitations for binary files or error scenarios.

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 well-structured with a clear flow: file types, modes, special behavior, and restrictions. Every sentence contributes essential information without redundancy.

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 no output schema, the description adequately explains return values (e.g., PDF metadata) and covers modes, file support, and directory limits. It lacks details on file size limits or encoding, but is sufficiently complete for a read tool.

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%, but the description adds significant value beyond the schema: document files ignore mode, lines required for head/tail, 1-indexed and inclusive range, and path restrictions. This enriches the agent's understanding.

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 files with flexible modes, supports text and document formats, and lists specific modes. It distinguishes from siblings like read_multiple_files by focusing on single file reading with mode options.

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?

It provides clear guidance on when to use each mode (head, tail, range for text; document files always full) and mentions directory restrictions. However, it does not explicitly compare to alternative tools like grep_files or get_file_info.

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/n0zer0d4y/vulcan-file-ops'

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