Skip to main content
Glama

read_file

Retrieve the contents of a file as UTF-8 text by providing its path.

Instructions

Read a file's contents as UTF-8 text.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
fileYesPath of the file to read.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/5

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

No annotations are provided, so the description carries full burden for behavioral traits. The description only states it reads as UTF-8 text, but does not disclose whether the file may be binary, what happens with very large files, required permissions (e.g., file must exist, be accessible), or any side effects (none expected since it's read-only). For a read operation, the lack of explicit safety confirmation (e.g., 'This operation is read-only') is a gap.

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 sentence of 7 words, with no wasted text. It is front-loaded with the core purpose. Every word earns its place by stating the action, resource, and encoding.

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 has only one parameter, no annotations, and a single sibling 'read_file_lines' that provides a natural alternative, the description is reasonably complete. However, it lacks information about the output schema (which is available but not referenced) and error conditions (e.g., file not found). The agent might need to infer these from the tool name and context.

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 a single required parameter 'file' described as 'Path of the file to read'. The description adds a slight nuance by stating 'UTF-8 text', implying the file should be a UTF-8 encoded text file. However, it does not clarify whether the path is absolute or relative (though the sibling 'get_cwd' hints at relative context), or whether it supports wildcards. The description adds marginal value beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states 'Read a file's contents as UTF-8 text', which has a specific verb ('Read'), a resource ('file'), and a format detail (UTF-8). This distinguishes it from sibling tools like 'read_file_lines' (which reads only lines) and 'file_info' (which reads metadata). However, it does not explicitly mention that it returns the full file content, leaving a slight ambiguity about the output structure.

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 the tool is for reading entire file contents, which is a common use case. It does not provide explicit guidance on when to use it vs alternatives like 'read_file_lines' (for line-by-line), 'grep' (for search within file), or 'replace_in_file' (for editing). No exclusions or prerequisites are mentioned, so the agent must infer context from sibling names.

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/jvcaesar/gremlin-mcp'

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