Skip to main content
Glama

Read an attachment

messages_attachments_get
Read-only

Read one attachment of a message. The answer is what it says, as plain text; with as original it is the file itself, base64, or a picture too large for one answer shrunk to fit. messages_get and threads_get name a message's attachments and their sizes. Either answer names a link the original is served at whole for 15 minutes after it is given, to a plain GET carrying no credential. From a terminal, curl --fail-with-body -o "" fetches it; a refused fetch exits non-zero and leaves its reason in that file.

Input Schema

NameRequiredDescriptionDefault
asNotext, the default: what the file says. original: the file itself, byte for byte, or a picture too large for one answer shrunk to fit.
idYesAn attachment id, as a message read named it.
mailboxYesThe mailbox's name or its email address.
messageIdYesThe message's id, as a search or a read answered it.
continuationNoWhere the words resume, as the last part read named it. The original always comes whole.

Output Schema

NameRequiredDescriptionDefault
dataNo
sizeYes
textNo
shrunkNoWhere a picture's original is more than one answer carries: the JPEG data holds in its place, shrunk to fit.
addressNo
charsetNo
outcomeNo
filenameYes
mimeTypeYes
returnedYes
messageIdYes
attachmentIdYes
continuationNo
contentFormatYes
sizePrecisionYes
carriesPayloadYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / as / description
      Previous value: -"text, the default: what the file says. original: the file itself, byte for byte."New value: +"text, the default: what the file says. original: the file itself, byte for byte, or a picture too large for one answer shrunk to fit."
    • addedOutput schema / properties / shrunk
      Added value: +{
      +  "additionalProperties": false,
      +  "description": "Where a picture's original is more than one answer carries: the JPEG data holds in its place, shrunk to fit.",
      +  "properties": {
      +    "mimeType": {
      +      "const": "image/jpeg",
      +      "type": "string"
      +    },
      +    "size": {
      +      "type": "number"
      +    }
      +  },
      +  "required": [
      +    "mimeType",
      +    "size"
      +  ],
      +  "type": "object"
      +}
  2. Changed1 schema field changed
    • changedOutput schema / required
      Previous value: -[
      -  "messageId",
      -  "attachmentId",
      -  "filename",
      -  "mimeType",
      -  "size",
      -  "sizePrecision",
      -  "contentFormat",
      -  "returned",
      -  "carriesPayload",
      -  "address"
      -]New value: +[
      +  "messageId",
      +  "attachmentId",
      +  "filename",
      +  "mimeType",
      +  "size",
      +  "sizePrecision",
      +  "contentFormat",
      +  "returned",
      +  "carriesPayload"
      +]
  3. Changed2 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  4. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well beyond the readOnly/non-destructive annotations: discloses that text mode returns plain text, original returns base64 bytes or a downscaled picture, and that the answer carries a link valid for 15 minutes served to a credential-free GET. Even supplies a concrete curl invocation with its failure semantics.

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-loads the core action and mode selection before the link/curl detail, and every sentence carries information. The prose is somewhat run-on and the curl paragraph is dense, but nothing is wasted.

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?

Covers mode selection, size/continuation behavior, how the id is obtained, and how to retrieve the original via the expiring link — enough that an agent can call it correctly even though an output schema also exists.

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 100%, so baseline is 3; the description still adds value by clarifying what `as` yields in each mode (base64, shrunk picture) and that `continuation` only affects text mode while the original always comes whole.

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 ("Read one attachment of a message") and implicitly distinguishes itself from messages_get/threads_get, which only name attachments and sizes. An agent can tell exactly which tool fetches attachment bytes versus which lists them.

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?

Names the prerequisite path explicitly ("messages_get and threads_get name a message's attachments and their sizes"), so the agent knows how to obtain the id. It also explains the text-vs-original choice and the fallback for oversized pictures, though it gives no explicit exclusions for when not to call it.

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.