Skip to main content
Glama

read_file

Read a workspace text file using UTF-8 or a chosen encoding, returning its path, size, encoding, and full contents; rejects missing, oversized, or invalid files.

Instructions

Read a UTF-8 (or other specified encoding) text file from the workspace.

Args: path: Path to the file, relative to the workspace root. encoding: Text encoding to decode with (default "utf-8").

Returns: The file's path, size in bytes, encoding, and full text content. Fails if the file does not exist, isn't a file, exceeds the configured max file size, or isn't valid text in that encoding.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
encodingNoutf-8

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does well: it discloses the return payload (path, byte size, encoding, full content) and four concrete failure modes including the max-file-size limit and encoding validity. It stops short of stating permission requirements or that the operation is strictly non-mutating.

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?

Front-loaded one-line purpose followed by tightly scoped Args/Returns sections; every line carries information. The labeled sections add slight overhead but no filler sentences.

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?

With no output schema and no annotations, the description supplies both the return shape and the error conditions, which is what an agent needs to call it correctly. Minor gaps remain around permissions and large-file behavior beyond the size cap.

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 0%, so the description must compensate, and it does: path is defined as relative to the workspace root and encoding is described with its default. Only the set of valid encoding values is left unspecified.

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?

States a specific verb (read) and resource (text file) plus scope (from the workspace) and supported encodings. An agent can immediately distinguish it from write_file, append_file, and get_file_info.

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?

Usage is implied by the verb and the failure conditions, but the description never states when to prefer this over siblings like get_file_info (metadata only) or search_text_in_files. No explicit exclusions or alternatives are named.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.