Skip to main content
Glama
fs-mcp-server

fs-mcp-server

by qsrahman

Read File

read_file
Read-onlyIdempotent

Read a text file by path, using offset and limit for specific line ranges or head/tail for first or last lines; output is capped near 100,000 characters to continue later.

Instructions

Read a text file (not a directory or a binary file). Output is capped at about 100,000 characters; a longer file ends with the offset to continue from. Use offset and limit for a range of lines, head for the first N lines or tail for the last N (use only one of the three).

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
headNoReturn only the first N lines.
pathYesAbsolute path, or relative to the server's working directory.
tailNoReturn only the last N lines.
limitNoMost lines to return, counting from offset.
offsetNoLine number to start reading from (1-based).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.6.1
    • changedInput schema / properties / head / description
      Previous value: -"If provided, returns only the first N lines of the file"New value: +"Return only the first N lines."
    • changedInput schema / properties / head / minimum
      Previous value: -0New value: +1
    • changedInput schema / properties / tail / description
      Previous value: -"If provided, returns only the last N lines of the file"New value: +"Return only the last N lines."
  2. First observedv0.3.0

TDQS

A3.9/5.0
Behavior4/5

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

Annotations already declare this a safe, idempotent read with no open-world access. The description adds genuinely new behavioral context beyond them: output is capped near 100,000 characters, and a longer file ends with the offset needed to continue — critical for an agent to avoid silently returning partial data.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three tight clauses, front-loaded with purpose, then truncation behavior, then parameter modes — no filler. The final clause is slightly dense ('head for the first N lines or tail for the last N (use only one of the three)') but still readable.

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 carries return-value burden and does so partly: it discloses the character cap and continuation offset. It does not state the output shape (raw text vs. numbered lines) or encoding handling, which is a modest gap for a read tool.

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 each parameter's meaning is already documented in the schema. The description adds one real semantic constraint not encoded in the schema: offset/limit, head, and tail are mutually exclusive modes. That is useful but limited to a single point beyond the baseline.

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 text file') and immediately bounds scope by excluding directories and binary files. It does not name a sibling such as read_multiple_files or fetch_url to contrast against, so differentiation from the surrounding toolset is left implicit rather than stated.

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?

It clearly explains which parameter mode to pick: offset+limit for a line range, head for the first N lines, tail for the last N. The parenthetical '(use only one of the three)' is explicit exclusion guidance, but there is no guidance on when to choose this tool over read_multiple_files, fetch_url, or shell.

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