Skip to main content
Glama

file_read

Reads a file's contents as UTF-8 text or base64, and rejects files above 8 MiB or end-to-end encrypted files. Use it to inspect file contents across stored adapters.

Instructions

Read a file's contents. Returns UTF-8 text when the bytes are valid UTF-8, otherwise base64. Files above 8 MiB are rejected - use the REST download endpoint for those. An end-to-end encrypted file (encrypted: true) is refused with E2E_ENCRYPTED: filex holds no key; the person decrypts it in the filex web UI or with filex decrypt.

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": "file_read"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesadapter://file path to read

Output Schema

NameRequiredDescriptionDefault
mimeYes
pathYes
contentYes
encodingYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior3/5

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

With no annotations, the description carries the whole burden; it does well on encoding rules, the 8 MiB size cap, and the exact E2E_ENCRYPTED refusal with a remediation path. It says nothing about permission failures (e.g. missing read access on a path), whether reading has any side effects such as access logging or counters, or behaviour for a nonexistent path. That leaves real gaps for a no-annotation tool, even if the coverage it does have is unusually concrete.

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?

Four short sentences, front-loaded with the happy path, then the return encoding, the size ceiling, and the encryption refusal. Every sentence says something an agent needs to call the tool correctly.

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 the description needn't explain the return shape, yet it still documents encoding behaviour for free. Because there are no annotations, the definition could add one clause on permission and not-found errors to be fully self-sufficient.

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

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Single `path` parameter with 100% schema description coverage, so the schema already defines the `adapter://` format; the description adds no path syntax or resolution details beyond it. One parameter with full coverage anchors the score at least a 3, and the surrounding 8 MiB and encryption notes hint at which kinds of paths fail.

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?

Opens with a specific verb+resource ("Read a file's contents") and immediately distinguishes the tool's output behaviour (UTF-8 text vs base64). The reader knows exactly what this does versus siblings like file_info or file_convert, which don't return raw bytes.

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?

Gives explicit routing for the two cases where the tool must not be used: files above 8 MiB go to the REST download endpoint, and encrypted:true files go to the filex web UI or `filex decrypt`. Both alternatives are named with the condition that selects them.

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