Skip to main content
Glama

Read File Text

read_file_text

Reads a text file line by line, letting you request a specific starting line and limit the number of lines returned. Useful for inspecting or extracting portions of large files.

Instructions

Read a text file by lines.

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_text"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesfile path
limitNomax lines to return (None = rest of file)
offsetNo0-based starting line
encodingNotext encoding (invalid bytes are replaced)utf-8

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full disclosure burden and does very little with it. It implies a read-only, line-oriented operation but says nothing about failure behavior on missing/unreadable paths, whether large files are streamed or truncated, or the shape of the line result set.

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?

A single short sentence with no filler, and the core verb+resource leads. Nothing in it is redundant or padded.

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 tool is simple, all four parameters are fully documented, and an output schema exists to describe return values, so the description does not need to cover those. The remaining gap is error/edge-case behavior and sibling routing, which keeps it below 5.

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 path, limit, offset, and encoding are already documented in the schema. The phrase "by lines" reinforces that limit/offset are line-based rather than byte-based, which is a small but real addition.

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?

Names a specific verb and resource ("Read a text file") and adds a meaningful qualifier, "by lines," which distinguishes it from a whole-blob read. It does not explicitly contrast with siblings like read_file_base64 or read_log_file, so it stops short of a 5.

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?

There is no guidance on when to choose this over read_file_base64, read_log_file, or other read paths, and no mention of prerequisites such as file existence or permissions. The agent must infer the choice from the name alone.

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

Deploy Server

Other Tools