Skip to main content
Glama

attachment_read

Download a stored shared file in base64-encoded chunks: read one byte window, continue with offset, and use total to know when the download is complete.

Instructions

Read one window of a stored file, base64-encoded. Clients use this to download a shared file in chunks; offset continues where the previous call stopped and total says when you are done. Not for the model to call on large files — use attachment_extract for text, and never for showing a picture (that is attachment_share; this returns bytes into YOUR context instead of a card). STORE ONLY: this never reads an arbitrary path.

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

Input Schema

NameRequiredDescriptionDefault
mimeNo
nameNo
pathYesAbsolute path under the attachments directory (the value attachment_share returned).
lengthNoBytes wanted; capped by the server.
offsetNoByte offset to start at (default 0).
sha256NoExpected digest, echoed back when known.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the burden well: it discloses that bytes land in the caller's context (a real cost signal), that this is store-only and cannot read arbitrary paths, and that offset/total drive the chunk loop. It stops short of failure behavior, such as what a sha256 mismatch or an out-of-store path yields, and defers the size cap to the schema ('capped by the server').

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 action, then constraints, then the hard boundary. Dense and mostly waste-free, though the parenthetical and capitalized clauses make it slightly crowded and require a second read in places.

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 six-parameter, no-annotation, no-output-schema tool, it covers the return format, the chunking protocol, and the safety boundary. It leaves some parameter semantics and error behavior to the schema, which is acceptable but not fully complete.

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 67%, so the baseline is 3. The description adds real meaning for offset ('continues where the previous call stopped') and for the completion signal, but mime, name, and sha256 get no explanation beyond their schema text, and 'total' is described although it is not an input parameter.

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 and resource with scope: 'Read one window of a stored file, base64-encoded.' It immediately distinguishes itself from attachment_extract (text) and attachment_share (picture card), so an agent can pick it out of the sibling list without opening a schema.

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?

Explicit when/when-not guidance: clients use it for chunked downloads, not for large files by the model, use attachment_extract for text, never use it to show a picture. Each alternative is named with the condition that selects it.

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