Skip to main content
Glama

fs_read

Reads text files from a sandbox with optional line-range and byte-limit controls, letting agents inspect file contents without loading the whole file.

Instructions

读取沙箱内的文本文件,可按行截取。

Args: path: 相对于沙箱根目录的文件路径。 start_line: 起始行号(从 1 开始)。 end_line: 结束行号;0 表示读到文件末尾。 max_bytes: 最多读取的字节数;0 表示使用配置上限。

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": "fs_read"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYes
end_lineNo
max_bytesNo
start_lineNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses three real behavioral traits: sandbox confinement of the path, 1-based line slicing, and a configurable byte cap with a server-side default. It omits error behavior (missing file, non-UTF-8 content), whether the byte cap truncates mid-line, and what happens if start_line exceeds the file length.

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?

One front-loaded summary sentence followed by a compact Args block; every line is informative and there is no filler. The Args block is somewhat redundant in form with the schema, but justified because the schema has zero description coverage.

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?

An output schema exists, so return-value explanation is not required, and the parameters are fully covered. The remaining gap is error/edge-case behavior for a file-read tool (missing path, encoding, truncation semantics), which an agent would benefit from knowing before calling.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/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 and it does: it explains the sandbox-relative path, 1-based start_line, the sentinel value 0 for end_line meaning read-to-EOF, and 0 for max_bytes meaning use the configured default. This is exactly the semantics the bare schema lacks, including the non-obvious sentinel encodings.

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?

First sentence gives a specific verb+resource ('read text files in the sandbox') plus the key capability (line-range slicing). It does not explicitly contrast with siblings like fs_list or fs_search, but the read-only, single-file, text-oriented framing makes the distinction inferable.

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?

Usage is only implied: 'sandbox text files' hints that binary files or out-of-sandbox paths are out of scope, and the line-range args imply partial reads. There is no explicit guidance on when to prefer fs_read over fs_search or fs_list, and no stated prerequisites.

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