Skip to main content
Glama

Read attachment

read_attachment
Read-onlyIdempotent

Return the content of a single attachment by its id — the value of a File or Image column, which is the id of the attachment record in the sfiles table (metadata via read_data). Images (png, jpg, gif, webp) are returned as an MCP image block; text files (csv, eml, htm, html, ini, json, log, md, sql, svg, txt, xml, yaml, yml) as JSON with encoding 'text', decoded by the encoding detected from the byte order mark of the stored file; a file without one is decoded as UTF-8 and, when it is not valid UTF-8, by the server code page; other files as an embedded MCP resource block (base64 blob). Attachments larger than 10 MB are refused.

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": {
      "id": "<id>"
    },
    "name": "read_attachment"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYesAttachment id — the value of a File/Image column, or sfiles.id.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.4/5.0
Behavior5/5

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

Adds substantial behavior well beyond the annotations: the per-type return shape (MCP image block, JSON text, embedded resource blob), how encoding is detected, and a hard 10 MB refusal limit. These are exactly the traits an agent needs to predict the response and avoid failures.

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 purpose, then return formats, then the size limit — a logical order with no filler. The long parenthetical file-extension lists are dense but each item serves the return-type explanation.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description carries the return-value burden itself and does so thoroughly: three distinct response shapes, encoding rules, and the size cap. Nothing critical for a correct call is missing.

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 the parameter description already says the id is a File/Image column value or sfiles.id, so the description largely restates it. The added value is only the pointer to read_data for metadata, which is marginal against a fully documented schema.

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 and resource ("Return the content of a single attachment by its id") and immediately scopes it to File/Image column values. It distinguishes itself from read_data by noting that read_data gives metadata, so an agent can tell the two apart without opening either 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?

Clearly states the use case (fetching content of one attachment given an id) and routes metadata lookups to a named sibling (read_data). No explicit exclusions or guidance on when not to call it, which keeps it short of a 5.

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