Skip to main content
Glama

read_file

Read a text file by specifying its path. Control which lines to retrieve using offset and limit parameters to page through large files efficiently.

Instructions

Read a text file. Returns up to limit lines starting at line offset (1-indexed offset, line 1 = offset 0).

Args: path: File path (absolute, or relative to the server's working dir). ~ is expanded. offset: Line number to start at (0 = first line). Use this to page through large files. limit: Maximum number of lines to return (default 2000).

Returns: path, content, total_lines, returned_lines, offset, truncated.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
limitNo
offsetNo
Behavior4/5

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

No annotations exist, so the description carries full burden. It explains paging behavior, return fields, and path conventions. However, it does not mention error handling (e.g., file not found) or potential performance issues with large files.

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 is front-loaded with the main action and then provides detailed parameter descriptions in a structured docstring format. Slightly verbose but well-organized.

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 lists return fields, which is helpful. It covers paging and file path conventions, but lacks error behavior and encoding details. Still, it's adequate 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?

The schema has 0% description coverage, so the description fully compensates by detailing path expansion, offset 0 meaning first line, and limit default. This adds significant meaning beyond the bare schema.

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 a text file' and details the parameters for paging (limit, offset). This verb+resource pair is distinct from sibling tools like write_file, delete, or list_directory.

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?

The description implies usage for reading text files with paging support, but does not explicitly state when not to use (e.g., for binary files) or alternatives like list_directory for browsing. Still, the context 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/cristopulos/QT_mcp_server'

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