Skip to main content
Glama

Read file

read_file
Read-onlyIdempotent

Read files within an allowed root, supporting utf8 text with line offset/limit and base64 binary encoding.

Instructions

Read a file inside an allowed root. Use encoding=base64 for binary. offset/limit are 1-based line numbers for utf8.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesAbsolute or ~ path to a file
limitNoMax lines to return (utf8 only)
offsetNoFirst line to return (utf8 only)
encodingNoutf8 for text, base64 for binaryutf8
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint=false. The description adds behavioral context beyond these: the allowed root restriction, the base64 encoding requirement for binary files, and the 1-based line numbering semantics. No contradiction with 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?

The description is two concise sentences with no fluff. Every clause adds information: the core purpose, encoding guidance, and offset/limit semantics. It is efficiently front-loaded with the primary action.

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 simple read operation, the description covers the essential points: purpose, allowed root constraint, encoding options, and offset/limit behavior. It does not explicitly state the return format (file content), but that is implied by 'read a file'. Given no output schema, this is a minor gap, but overall the description is sufficient for an agent to call it correctly.

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%, with each parameter having a description. The description adds the crucial clarification that offset and limit are 1-based line numbers, which is not explicitly stated in the schema (schema only says 'First line to return'). It also reinforces the encoding choice for binary. This adds meaningful value beyond the 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 the tool reads a file within an allowed root, using a specific verb and resource. It distinguishes itself from sibling tools like write_file, list_directory, and search_files by focusing on reading a single file's content. The 'allowed root' constraint adds important scope.

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 gives operational tips (encoding for binary, 1-based offsets) but does not explicitly compare with alternatives. It implies usage for reading a file but lacks guidance on when to prefer this over list_directory or search_files. No explicit when-not-to-use conditions are provided.

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/jameymcelveen/desktop-bridge'

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