Skip to main content
Glama

read_file

Reads a bounded UTF-8 text file or specific line range, providing structured line metadata for precise content access.

Instructions

Read a bounded UTF-8 text file or 1-based line range with structured line metadata. Use shell tools for binary or very large files.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoBase directory. Defaults to the agent user home directory.
pathYesFile path. Relative paths are resolved against cwd.
endLineNoInclusive last line to return.
startLineNoFirst line to return, using 1-based indexing.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.5.0

TDQS

A3.8/5.0
Behavior3/5

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

No annotations are provided, so the description carries full behavioral burden. It discloses bounded reading, UTF-8, and structured line metadata, plus the binary/large-file caveat. It omits failure modes (non-existent file, encoding errors) and does not state whether output includes content plus line metadata explicitly.

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 tight sentences. Core behavior (bounded UTF-8 line-range read) is front-loaded, and the alternative-tool guidance follows immediately. No filler.

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 4-param read tool with full schema coverage and no output schema, the description covers the essential scope and the main exclusion. Missing only minor detail on error behavior and returned metadata shape, but adequate to invoke correctly.

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 the schema already defines cwd, path, startLine, and endLine. The description adds the '1-based' nuance (also in the schema) and confirms bounded line-range semantics but introduces no parameter meaning beyond the schema. Baseline 3 applies.

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?

Specific verb 'read' plus resource 'UTF-8 text file' and line range, distinguishing it from sibling tools like exec/list_directory. However, it does not name or explicitly contrast with the closest alternative, shell tools, only recommending them for binary/large files, so sibling differentiation is partial.

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?

Explicitly states when NOT to use it — 'Use shell tools for binary or very large files' — which gives a clear boundary condition. It lacks a positive 'use this when' framing beyond the scope of the operation, but the exclusion is practical and actionable.

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