Skip to main content
Glama

Read File (Deprecated)

read_file
Read-onlyIdempotent

Reads a file's complete text contents, optionally returning only the first or last N lines; deprecated, use read_text_file instead.

Instructions

Read the complete contents of a file as text. DEPRECATED: Use read_text_file instead.

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
headNoIf provided, returns only the first N lines of the file
pathYesThe file to read as text. Absolute, or relative to an allowed directory; it must resolve inside the allowed directories.
tailNoIf provided, returns only the last N lines of the file

Output Schema

NameRequiredDescriptionDefault
contentYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.3.0

TDQS

A4.2/5.0
Behavior3/5

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

The annotations already declare read-only, idempotent, non-destructive, closed-world behavior, so the safety profile is covered. The description adds the important deprecation status, but nothing about error behavior when a path falls outside allowed directories or about how head/tail interact with the 'complete contents' claim.

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 short sentences with zero filler, and the deprecation warning is placed where it will be read immediately. Nothing to cut.

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?

The output schema covers return values and the input schema fully documents all three parameters, leaving little for the description to carry beyond purpose and deprecation. Only the untidy tension between 'complete contents' and the head/tail options keeps it from being fully complete.

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 coverage is 100%, so path, head, and tail are fully documented in the schema itself, and this is the baseline case. The phrase 'complete contents' arguably conflicts with the head/tail truncation parameters and adds no clarifying meaning beyond the schema.

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 (read file contents as text) and immediately names the sibling that supersedes it, read_text_file. An agent can distinguish this from read_media_file or read_multiple_files without opening any schema.

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

Usage Guidelines5/5

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

Explicitly says to use read_text_file instead, giving a clear when-not-to-use signal and naming the exact alternative. For a deprecated tool this is precisely the routing guidance an agent needs.

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