Skip to main content
Glama

read_file

Read a bounded portion of a UTF-8 text file from the workspace, rejecting large, binary, or unauthorized files to provide safe source context.

Instructions

Read a bounded amount of one UTF-8 text file. Large, binary, denied or out-of-workspace files are rejected.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
max_charsNo
workspaceYes
relative_pathYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYes
end_lineYes
truncatedYes
workspaceYes
start_lineYes
relative_pathYes
Behavior4/5

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

With no annotations, the description carries the full burden. It discloses important behavioral traits: the tool only reads UTF-8 text, enforces a size limit, and will reject files that are large, binary, denied, or outside the workspace. This goes beyond the schema and gives agents a clear picture of operational constraints.

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 a single, front-loaded sentence that immediately states the core purpose, then lists rejection conditions. Every word adds value with no redundancy or filler.

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 the tool's simplicity, the description covers the essential operational envelope: bounded reading, text-only, and rejection conditions. The output schema exists, so return values are documented elsewhere. Minor gaps remain (e.g., what constitutes 'large' or how 'bounded' is determined), but overall it is sufficiently complete for an agent to use correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, and the description does not explicitly explain any parameter. It vaguely aligns 'bounded amount' with max_chars and mentions workspace/relative path via rejection of out-of-workspace files, but does not clarify required syntax, default behavior, or how max_chars works. The description provides minimal compensation for the missing schema documentation.

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 action (read), the resource (one UTF-8 text file), and a key constraint (bounded amount). It also lists rejection criteria (large, binary, denied, out-of-workspace) which further defines the tool's scope and distinguishes it from sibling tools like read_file_range and get_file_metadata.

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: read text files up to a bounded size. The rejection of large, binary, denied, and out-of-workspace files gives context about when not to use it. However, it does not explicitly name alternatives or provide when-to-use/when-not-to-use guidance compared to sibling tools like read_file_range or get_file_metadata.

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/negativexq/repo-context-forge'

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