Skip to main content
Glama
shivam-bit

bounded-filesystem-mcp

by shivam-bit

Read Text File

read_text_file
Read-only

Reads a file's contents as text, with parameters to limit output by lines or characters. Use to inspect single files within allowed directories.

Instructions

Read the complete contents of a file from the file system as text. Handles various text encodings and provides detailed error messages if the file cannot be read. Use this tool when you need to examine the contents of a single file. Use the 'head' parameter to read only the first N lines of a file, or the 'tail' parameter to read only the last N lines of a file. Use the 'offset' and 'limit' parameters to read a window of characters, for example to continue after a truncated result; they cannot be combined with 'head' or 'tail'. Results longer than 50,000 characters are cut short, ending with a notice that says how to get the rest. Operates on the file as text regardless of extension. Only works within allowed directories.

Input Schema

NameRequiredDescriptionDefault
headNoIf provided, returns only the first N lines of the file
pathYes
tailNoIf provided, returns only the last N lines of the file
limitNoMaximum number of characters to return, clamped to the result cap
offsetNoCharacter position to start reading from (default 0). Use the offset given in a truncation notice to continue

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior5/5

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

Beyond the readOnlyHint=true annotation, the description discloses several behavioral traits: a 50,000-character truncation cap with a notice explaining how to continue, detailed error messages, automatic text decoding across encodings, and the 'only works within allowed directories' constraint. This is rich, non-obvious operational detail that an agent could not infer from the annotation or schema.

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?

Purpose is front-loaded in the first sentence, followed by usage, parameter modes, truncation behavior, and the directory constraint. Six sentences that each carry distinct information with no redundancy, though it is on the longer side for a read tool.

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 5 parameters, no output schema, and 80% schema coverage, the description adequately covers encoding handling, error reporting, truncation, and windowing modes. It leaves minor gaps such as the format of the truncation notice and permission requirements, but nothing critical to correct invocation is missing.

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 80%, so the schema already documents head, tail, limit, and offset. The description adds a genuinely important constraint the schema omits — that offset/limit cannot be combined with head/tail — plus a concrete use case ('continue after a truncated result'). It adds value beyond the schema, though the bare 'path' parameter still carries no description.

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 states a specific verb and resource ('Read the complete contents of a file from the file system as text') and clarifies scope with 'Operates on the file as text regardless of extension.' It implies a contrast with read_media_file/read_file but never names a sibling, so differentiation is only implicit rather than explicit.

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 gives clear context ('Use this tool when you need to examine the contents of a single file') and thoroughly explains which parameter mode to use for line-limited vs. windowed reading. It does not explicitly name read_multiple_files or read_file as the alternatives to prefer for multi-file or single-file reads, so routing guidance is incomplete.

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