Skip to main content
Glama

readFileTool

Read a file from the AgentFiles directory and return its contents as text, enabling safe access to local agent files within FileMCP.

Instructions

Reads a file from the 'AgentFiles' directory and returns its contents as 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": {
      "filePath": "<filePath>"
    },
    "name": "readFileTool"
  }
}

Input Schema

NameRequiredDescriptionDefault
filePathYesThe path to the file to read, relative to the 'AgentFiles' directory.

Output Schema

NameRequiredDescriptionDefault
textYesThe contents of the file or an error message.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv2.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 directory scoping and text return, which conveys a read-only nature. However it omits error behavior for missing paths, encoding/binary handling, and size limits.

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?

A single tight sentence that front-loads the verb, resource, and scope with zero filler.

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 detail is unnecessary. For a simple single-parameter read tool this covers purpose and scope adequately, though edge-case behavior remains 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 there is only one parameter, so the schema already documents filePath fully. The description's 'relative to AgentFiles' framing mirrors the schema description rather than adding new meaning; 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?

States a specific verb (reads), resource (a file), scope (from the 'AgentFiles' directory), and outcome (returns contents as text). This cleanly separates it from its write-oriented and listing siblings like createFileTool and listDirectoryTool.

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?

The use case is implied clearly enough for a read tool, but there is no explicit when-to-use/when-not guidance and no mention of alternatives. No exclusions or prerequisites are stated.

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