Skip to main content
Glama

Read file

read_file
Read-onlyIdempotent

Read UTF-8 text files with optional startLine/endLine ranges and a maxBytes cap to prevent large files from flooding context; binary files are detected and refused.

Instructions

Read a UTF-8 text file on this computer. Supports partial reads via startLine/endLine and a maxBytes cap (default 200 KB) so large files never flood the context. Returns size, total line count and sha256 (pass that sha256 back to write_file/edit_file as expectedSha256 for safe concurrent edits). Binary files are detected and refused.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "path": "<path>"
    },
    "name": "read_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
noteNoShort human-readable explanation (1 line, in the user's language) of what you are about to do and why. Shown to the user on the approval card. Always provide when calling mutating tools.
pathYes
agentNoShort consistent identifier or display name of this agent (e.g. 'Claude · Лендинг', 'Тесты', 'Мой агент'). Used to separate tasks and route tray messages when multiple agents work in parallel.
endLineNo
maxBytesNo
startLineNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true, idempotentHint=true and destructiveHint=false, so the safety profile is covered elsewhere. The description still adds real behavior beyond that: a 200 KB default cap, binary refusal, and the returned fields (size, line count, sha256) with the concurrency-safe-edit pattern. Notably absent is what happens on a missing path or a read that exceeds the cap mid-file.

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?

Four tight sentences, front-loaded with the core action, then read modes, then return values and the sha256 workflow. No filler, and the progression from what it does to how to constrain it to what comes back is easy to scan.

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, the description correctly takes on the return-shape burden by naming size, total line count and sha256. It is nearly complete for a read tool; only error and edge-case behavior (missing file, permission denied, cap exceeded) is left unstated.

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 only 33%, so the description must carry the load for path, startLine, endLine and maxBytes; it explains the partial-read pair and the maxBytes cap with its default. The schema already documents note and agent, so the remaining gap is minor; path semantics are assumed obvious.

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 and resource plus scope: "Read a UTF-8 text file on this computer." The UTF-8/on-this-computer framing separates it from read_image and from remote-fetch style siblings, and the first sentence alone tells an agent what it does.

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?

Gives concrete guidance for large files (use startLine/endLine or maxBytes) and describes the intended workflow of passing the returned sha256 to write_file/edit_file as expectedSha256. It also implies that non-UTF-8 content is out of scope ("binary files are detected and refused"), which nudges an agent toward read_image, though that alternative is never named explicitly.

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