Skip to main content
Glama

read_file_tool

Reads the contents of a file from the filesystem so AI tools can access it by absolute or relative path, with optional encoding.

Instructions

Read the contents of a 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_tool"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesAbsolute or relative path to the file
encodingNoFile encoding (default: utf-8)utf-8

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations supplied, the description carries the full behavioral burden and provides almost none of it. It does not state whether output is text-only, how encoding affects decoding, what happens with unreadable/binary files, or whether the whole file is returned. Read-only safety is implied by the verb but never declared.

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?

A single front-loaded sentence with no filler or redundancy. It is efficient, though the brevity borders on under-specification rather than genuine conciseness.

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?

There is no output schema and no annotations, so the description should explain the return value (raw text? size limits?) and error behavior, which it does not. For a simple two-parameter read tool this is a notable gap rather than a minor one.

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 100%, so the schema already defines both path and encoding with defaults and acceptable forms. The description adds no meaning beyond that, so the baseline of 3 applies.

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?

States a specific verb (read) and resource (file contents), which distinguishes it from write_file_tool and delete_file_tool. It does not explicitly contrast with get_file_info_tool, which is the closest ambiguous sibling (contents vs. metadata), so an agent must infer that distinction.

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?

No when-to-use guidance, no prerequisites, and no named alternatives. Nothing tells the agent when to prefer this over search_files_tool or get_file_info_tool, or what to do for binary or oversized files.

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