Skip to main content
Glama

read_file

Read UTF-8 text files from a Filaxis target layer without changing remote state; returns path, content, size, and mtime for safe inspection before edits.

Instructions

只读获取目标层中的 UTF-8 文本文件(不修改远端状态),返回 { path, content, size, mtime_ms }。文件不存在、无权限或层不支持元数据时报错;下载二进制文件请改用 get_file,同时读多个文件优先使用 run_batch,后续受控修改请配合 edit_file。

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
pathYes目标层内的文件路径(绝对路径或相对层工作目录)
layerNo目标层名(缺省=默认层)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.1.1
    • addedInput schema / properties / path / description
      Added value: +"目标层内的文件路径(绝对路径或相对层工作目录)"
    • addedInput schema / properties / path / minLength
      Added value: +1
  2. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

No annotations exist, so the description carries the burden and does well: it declares the operation non-mutating, names the exact response fields, and lists failure modes (missing file, no permission, layer lacking metadata support). It does not address large-file truncation or encoding edge cases, keeping it just shy of a 5.

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?

Everything is front-loaded in two dense sentences – read-only guarantee and return shape first, then error behavior and sibling routing. No filler and no repetition of the schema.

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 correctly supplies the return fields and the error semantics, which is enough for a simple two-parameter read tool. Only edge-case handling for very large files is unaddressed.

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% and both parameters (path, layer) are already documented in the schema, including the default-layer behavior. The description adds little parameter-level meaning beyond restating 'target layer', so the baseline 3 applies.

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 and resource: read-only retrieval of a UTF-8 text file in the target layer, with the return shape { path, content, size, mtime_ms } named explicitly. It also distinguishes itself from get_file (binary) and run_batch (multiple files), so an agent can pick it without inspecting siblings.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It routes the agent explicitly: use get_file for binary downloads, prefer run_batch when reading several files, and pair with edit_file for subsequent controlled modifications. Alternatives and their selecting conditions are both named.

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