Skip to main content
Glama

Read Text File

read_text_file
Read-onlyIdempotent

Read UTF-8 text files inside an allowed directory and return their contents.

Instructions

Read a UTF-8 text file inside an allowed directory and return its contents.

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_text_file"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesFile path to read

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.1

TDQS

B3.4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint, idempotentHint, destructiveHint=false and openWorldHint=false, so the safety profile is covered. The description adds two genuinely useful traits beyond that: UTF-8 encoding and confinement to an allowed directory (a sandbox boundary). It omits failure modes an agent would care about, such as behavior on binary or non-UTF-8 files, size limits, and path-traversal rejection.

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?

One sentence, front-loaded with the verb and resource, with the constraint and the return value following. No filler or redundancy.

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?

For a one-parameter read tool with rich annotations and no output schema, the description states the input constraint and the return value, which is close to sufficient. It falls short only on error/edge-case behavior for unreadable or non-text files.

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?

There is a single parameter with 100% schema description coverage, so baseline is 3. The description does add meaning by constraining the path to an allowed directory, but gives no format hints (absolute vs relative, allowed roots).

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?

A specific verb plus resource ("Read a UTF-8 text file") with a scope constraint ("inside an allowed directory") and a stated result ("return its contents"). It is clearly distinguishable from a metadata call like get_file_info or a mutation like write_file, though it does not name any sibling explicitly.

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 when-to-use or when-not-to-use guidance and no comparison to alternatives such as get_file_info (metadata) or list_directory (discovery). The only implicit signal is the encoding/directory constraint, which tells the agent nothing about tool selection.

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