Skip to main content
Glama

Read a file or directory

ReadPath
Read-onlyIdempotent

Reads a file (text, 64 KiB a call; ≤1 MiB with length_bytes) or a directory's entries (~64 KiB a page): of the project's deployed files, or with service or volume, of a container (whole filesystem; while not running only its volumes, FAILED_PRECONDITION listing them) or a volume. NOT_FOUND names the nearest existing directory. Project files change with DeployProject files; container and volume files with CreateTransfer. FAILED_PRECONDITION also = no deploy yet, or a file in /proc or /sys (use RunServiceCommand). Untrusted.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "ReadPath"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathNoFrom the root, e.g. "/compose.yaml", "/data/uploads". Empty = "/": the root's entries.
volumeNoIn the volume, from its root.
serviceNoIn its container.
workspaceNoThe workspace: its id or name (ListWorkspaces). Omit when the account has one.
project_idNo
entry_limitNo0 = 200. Also ends at ~64 KiB.
length_bytesNo≤1 MiB; 0 = 64 KiB.
offset_bytesNoFile offset.
entry_page_tokenNoThe previous next_entry_page_token, other fields unchanged.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • addedInput schema / properties / workspace
      Added value: +{
      +  "description": "The workspace: its id or name (ListWorkspaces). Omit when the account has one.",
      +  "type": "string"
      +}
  2. First observed

TDQS

A4.5/5.0
Behavior5/5

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

Goes well past the annotations (readOnly/idempotent/openWorld) by disclosing chunking behavior (64 KiB per call, ≤1 MiB with length_bytes, ~64 KiB per directory page), error semantics (NOT_FOUND names the nearest existing directory; FAILED_PRECONDITION for no deploy yet or /proc and /sys), and which operations mutate the underlying data (DeployProject `files`, CreateTransfer). The closing 'Untrusted' warning flags content trust, which no annotation conveys.

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?

Front-loaded with the core read behavior and chunk sizes, then error and mutation context, with zero filler sentences. The heavy parenthetical stacking and telegraphic phrasing (e.g. 'FAILED_PRECONDITION also = no deploy yet') make it dense and slightly harder to parse than necessary.

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 9-parameter read tool with no output schema, it covers what is returned at a high level (file text vs. directory entries), size limits, pagination via next_entry_page_token, and the main failure modes, which is most of what an agent needs. It stops short of describing the concrete response shape or how entry listings are ordered, which matters given there is no output schema.

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?

Schema coverage is 89%, so the schema already defines path, volume, service, offsets, limits, and the page token. The description still adds value by tying length_bytes to the 64 KiB default and 1 MiB ceiling and by framing `service`/`volume` as source selectors rather than mere strings. It does not add anything beyond the schema for `workspace`, `project_id`, or the mutual-exclusion constraint.

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?

Names a specific verb (Reads) and resource (a file or a directory's entries) and immediately enumerates the three sources it can address: project deployed files, a container via `service`, or a `volume`. This distinguishes it from siblings like RunServiceCommand or QueryContainerLogs without the agent needing to open another schema.

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

Usage Guidelines4/5

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

Gives concrete routing rules: use `service`/`volume` for container or volume paths, and explicitly says to use RunServiceCommand instead for files under /proc or /sys. It also explains that FAILED_PRECONDITION while a container is stopped means only volumes are readable. What it lacks is an explicit statement of when *not* to use this tool at all (e.g., log or traffic inspection siblings).

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources