Skip to main content
Glama

Fs Read File

fs_read_file

Reads text files from allowlisted directories, enforcing a size cap and blocking path traversal through symlinks or '..' sequences.

Instructions

Read a file under allowlisted roots with a hard size limit.

Symlink and .. escapes fail closed. Content is UTF-8 decoded with replacement characters; truncated is true when the file exceeded the cap.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYes
max_bytesNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, and it delivers: it discloses symlink/.. escape fail-closed behavior, UTF-8 decoding with replacement characters, and the 'truncated' flag when the file exceeds the cap. This is exactly the kind of edge-case behavior an agent needs to know before calling the tool. No annotation contradiction.

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?

Three sentences, each earning its place: the first states the core operation and constraint, the second covers security behavior, the third covers encoding and truncation. Front-loaded with the primary purpose. No fluff or repetition.

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 description covers the key behavioral aspects: security (fail-closed), encoding (UTF-8 replacement), and size cap (truncated flag). The output schema exists, so return values are documented elsewhere. Minor gap: it doesn't specify what happens on non-existent files or permission errors, but the fail-closed language partially covers this. For a 2-param read tool with an output schema, this is nearly 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 description coverage is 0%, so the description must compensate. It explains the 'max_bytes' cap implicitly via 'hard size limit' and 'truncated' flag, but it doesn't explicitly state that max_bytes is the cap parameter or describe the path format (relative vs absolute, allowlist details). The description adds some meaning beyond the bare schema (the size cap behavior), but the path parameter semantics are left to the schema's bare type string. Baseline 3 is appropriate.

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?

The description states a specific verb ('Read') and resource ('a file under allowlisted roots') with a hard size limit. It clearly distinguishes itself from siblings like fs_search (which searches) and the github/postgres tools. The scope constraint 'under allowlisted roots' adds precision beyond the tool name.

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?

The description implies when to use this tool: when you need to read a file's content under the allowlisted roots. It doesn't explicitly name alternatives or exclusions, but the sibling list makes the distinction clear (fs_search is for searching, not reading). The 'hard size limit' and 'fail closed' behavior give implicit guidance on constraints. Missing explicit 'use fs_search instead when...' guidance, but context is clear enough.

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