Skip to main content
Glama

read_file

Reads the contents of a text file from a designated read-only project folder, using a path and optional byte limit to retrieve file data for code inspection.

Instructions

Đọc nội dung một file text.

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
max_bytesNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.6/5.0
Behavior2/5

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

No annotations are supplied, so the description carries the full behavioral burden, and it says almost nothing. Reading implies a safe read, but it never mentions that output may be truncated by max_bytes (default 200000), what happens on a missing or binary file, or any encoding assumptions. For a tool with zero annotation coverage, this is a substantial gap.

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

Conciseness3/5

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

The single sentence is front-loaded and free of padding, but the brevity comes from omission rather than efficiency. A sentence explaining truncation and path expectations would have earned its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple and an output schema exists, so return values need not be described. Still, for a two-parameter file reader with no annotations, the description omits truncation behavior, error cases, and path semantics — the exact things an agent needs to call it correctly.

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

Parameters2/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 not. It says nothing about `path` (absolute vs relative, base directory) and nothing about `max_bytes`, even though that parameter governs silent truncation of the returned content, which is the single most consequential semantic here.

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 contents of a text file. That is enough for an agent to distinguish it from write_file (same resource, opposite action) and list_dir (enumerates rather than reads). It does not explicitly name those siblings, which keeps it below a 5.

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

Usage Guidelines2/5

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

There is no guidance on when to use this instead of list_dir or search_code, and no preconditions (file must exist, must be text rather than binary). The agent has to infer that this is the tool for pulling full file contents.

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

Deploy Server

Other Tools