Skip to main content
Glama

read_file

Read-only

Fetch UTF-8 file contents with line and byte limits, and get the SHA-256 hash to detect concurrent modifications when writing.

Instructions

Read a UTF-8 text file with line and byte limits. Returns the file SHA-256; pass it back as "expected_sha256" when writing to detect concurrent changes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath relative to the workspace root, or an allowed absolute path.
max_bytesNoMaximum UTF-8 bytes to return.
max_linesNoMaximum lines to return.
start_lineNoFirst line to return (1-based).
line_numbersNoPrefix each returned line with its 1-based number and a tab.
Behavior4/5

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

Annotations already declare readOnlyHint=true and destructiveHint=false, so the safety profile is covered. The description adds useful behavioral detail: it returns the file SHA-256 to detect concurrent changes, and it enforces line/byte limits. This goes beyond the annotations without contradicting them.

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?

Two sentences, with the core action front-loaded and the important SHA-256 workflow placed second. Every sentence earns its place; there is no filler or 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?

For a read-only tool with fully documented parameters, the description covers the main return value, the SHA-256, and the concurrency use case. Since there is no output schema, more detail about the exact response format or defaults could be helpful, but the essentials are present.

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

Parameters3/5

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

Schema description coverage is 100%, so every parameter is already documented in the schema with meaningful descriptions. The tool description adds no parameter-specific semantics beyond the general mention of line and byte limits, which matches the baseline of 3.

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 a UTF-8 text file, with specific constraints on line and byte limits. This distinguishes it from sibling tools like file_info or list_directory, which inspect metadata or directory entries rather than file contents.

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 gives clear context for when to use this tool: whenever file content needs to be read. It also adds a concrete workflow hint, passing the returned SHA-256 back as expected_sha256 during writes, which helps coordinate with write_file. It does not explicitly name alternatives or exclusion cases, so it stops short of a 5.

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/JonusNattapong/ChatGPTMCP'

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