Skip to main content
Glama

Read file

read_file
Read-onlyIdempotent

Retrieve a selected range of lines or bytes from a UTF-8 text file in the configured workspace to inspect code without loading the whole file.

Instructions

Read a UTF-8 text file slice inside the configured workspace.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
encodingNoutf-8
end_lineNo
max_bytesNo
max_linesNo
start_lineNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
okYes
errorNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.2

TDQS

B3.1/5.0
Behavior3/5

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

Annotations already convey read-only, idempotent, and non-destructive behavior. The description adds useful context about UTF-8 text and workspace confinement, but does not disclose behavior like truncation, line/byte limits, or handling of binary files.

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 with no filler. Every word earns its place by conveying the resource type, scope, and slicing capability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite output schema and annotations covering some context, the tool has six parameters with zero schema descriptions and no usage guidance. The description alone does not sufficiently equip an agent to form correct calls or interpret parameter interactions.

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

Parameters1/5

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

Schema description coverage is 0%, so the description must compensate for six undocumented parameters. It only hints at 'slice' and 'UTF-8', providing no meaningful semantics for path, start_line, end_line, max_lines, max_bytes, or encoding.

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 uses a specific verb ('Read') and resource ('UTF-8 text file slice') and scopes it to the configured workspace. It clearly distinguishes this from siblings like read_output and view_image, which operate on command output or images.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives no explicit guidance on when to use this tool versus alternatives such as list_files, search_text, or read_output. It does not state exclusions or prerequisites beyond the implicit workspace boundary.

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