Skip to main content
Glama

Read file

read_file
Read-onlyIdempotent

Reads UTF-8 text files, optionally limiting results to a line window and reporting total lines and truncation so large files can be paged by advancing the start line.

Instructions

Read a UTF-8 text file, optionally a window of lines.

    The result reports total_lines and whether the file was truncated, so
    large files can be paged through by advancing start_line.
    

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
pathYesFile to read, relative to the root.
max_linesNoMaximum lines.
start_lineNoFirst line to return (1-based).

Output Schema

NameRequiredDescriptionDefault
pathYes
contentYes
end_lineYes
truncatedYesTrue if the file continues past end_line.
start_lineYes
total_linesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

The annotations already establish that this is a read-only, idempotent, closed-world operation. The description adds useful behavioral context beyond the annotations: files are treated as UTF-8, reads can be windowed by line, and the result reports total_lines and truncation so the caller can page safely.

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 two short sentences and front-loads the essential operation. Every sentence contributes either the core purpose or the paging behavior, with no redundant wording.

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 simple read-only file tool with a full input schema, an output schema, and annotations covering safety, the description is largely complete. It omits error behavior for missing, inaccessible, or non-UTF-8 files, but those gaps are modest for this tool's complexity.

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 all three parameters are already documented in the input schema. The description adds some meaning by connecting start_line to paging through a file, but it does not add syntax, edge-case, or format details beyond what the schema provides.

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?

The description gives a specific verb and resource: 'Read a UTF-8 text file, optionally a window of lines.' That is clear and precise enough to distinguish a content read from listing or searching tools, but it does not explicitly contrast itself with siblings such as search_files.

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?

It explains the paging pattern: advance start_line to page through large files. However, it does not say when to use this tool rather than search_files, list_files, or another sibling, so the usage guidance is implied rather than explicit.

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