Skip to main content
Glama

Download attachment

download_attachment
Read-only

Fetch metadata and a resource link for a single email attachment, with optional inline content or PDF text extraction for a specified page range.

Instructions

Get metadata and a resource link for one attachment. With inline, the result also includes the content. For a PDF, inline adds extracted text, and pages returns the text of a page range such as 201-400. The size limit is 10 MB.

Input Schema

NameRequiredDescriptionDefault
pagesNoPDF page or page range to read as text, such as 201-400
inlineNo
accountIdNoAccount to operate on. Optional when exactly one account is connected.
messageIdYes
attachmentIdYesOpaque attachment ID returned by message metadata

Output Schema

NameRequiredDescriptionDefault
dataYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.19.0
    • changedInput schema / properties / accountId / anyOf
      Previous value: -[
      -  {
      -    "minLength": 1,
      -    "type": "string"
      -  },
      -  {
      -    "type": "null"
      -  }
      -]New value: +[
      +  {
      +    "maxLength": 512,
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / attachmentId / maxLength
      Added value: +512
    • addedInput schema / properties / messageId / maxLength
      Added value: +512
  2. Changed10 schema fields changedv0.15.0
    • addedInput schema / properties / accountId / anyOf
      Added value: +[
      +  {
      +    "minLength": 1,
      +    "type": "string"
      +  },
      +  {
      +    "type": "null"
      +  }
      +]
    • addedInput schema / properties / accountId / description
      Added value: +"Account to operate on. Optional when exactly one account is connected."
    • removedInput schema / properties / accountId / minLength
      Removed value: -1
    • removedInput schema / properties / accountId / type
      Removed value: -"string"
    • changedInput schema / properties / inline / type
      Previous value: -"boolean"New value: +[
      +  "boolean",
      +  "null"
      +]
    • removedInput schema / properties / messageId / $ref
      Removed value: -"#/properties/accountId"
    • addedInput schema / properties / messageId / minLength
      Added value: +1
    • addedInput schema / properties / messageId / type
      Added value: +"string"
    • addedInput schema / properties / pages
      Added value: +{
      +  "anyOf": [
      +    {
      +      "description": "PDF page or page range to read as text, such as 201-400",
      +      "pattern": "^[1-9]\\d{0,5}(-[1-9]\\d{0,5})?$",
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "description": "PDF page or page range to read as text, such as 201-400"
      +}
    • changedInput schema / required
      Previous value: -[
      -  "accountId",
      -  "messageId",
      -  "attachmentId"
      -]New value: +[
      +  "messageId",
      +  "attachmentId"
      +]
  3. Changed1 schema field changedv0.11.1
    • removedOutput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
  4. Changed7 schema fields changedv0.11.0
    • removedInput schema / properties / accountId / description
      Removed value: -"Account to operate on. Optional when exactly one account is connected."
    • addedInput schema / properties / inline
      Added value: +{
      +  "type": "boolean"
      +}
    • addedInput schema / properties / messageId / $ref
      Added value: +"#/properties/accountId"
    • removedInput schema / properties / messageId / minLength
      Removed value: -1
    • removedInput schema / properties / messageId / type
      Removed value: -"string"
    • changedInput schema / required
      Previous value: -[
      -  "messageId",
      -  "attachmentId"
      -]New value: +[
      +  "accountId",
      +  "messageId",
      +  "attachmentId"
      +]
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "$schema": "http://json-schema.org/draft-07/schema#",
      +  "additionalProperties": false,
      +  "properties": {
      +    "data": {
      +      "additionalProperties": true,
      +      "properties": {
      +        "filename": {
      +          "type": "string"
      +        },
      +        "id": {
      +          "type": "string"
      +        },
      +        "mimeType": {
      +          "type": "string"
      +        },
      +        "sizeBytes": {
      +          "type": "number"
      +        }
      +      },
      +      "required": [
      +        "id",
      +        "filename",
      +        "mimeType",
      +        "sizeBytes"
      +      ],
      +      "type": "object"
      +    }
      +  },
      +  "required": [
      +    "data"
      +  ],
      +  "type": "object"
      +}
  5. Changed4 schema fields changedv0.9.0
    • removedInput schema / properties / attachmentId / $ref
      Removed value: -"#/properties/messageId"
    • addedInput schema / properties / attachmentId / description
      Added value: +"Opaque attachment ID returned by message metadata"
    • addedInput schema / properties / attachmentId / minLength
      Added value: +1
    • addedInput schema / properties / attachmentId / type
      Added value: +"string"
  6. First observedv0.1.0

TDQS

A3.9/5.0
Behavior4/5

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

Goes well beyond the readOnly/destructive annotations by disclosing that the default result is metadata plus a resource link, that inline changes the payload, that PDFs get extracted text, and that there is a hard 10 MB limit. It does not say what happens when that limit is exceeded, which is the remaining gap.

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?

Four short sentences, all front-loaded with the default behavior before the optional modes. The 10 MB limit sits at the end where a constraint belongs; nothing is redundant.

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?

An output schema already documents return structure, so the description only needs to explain mode-dependent behavior, and it does: default, inline, PDF text, and page ranges. The size limit covers the main failure mode for a binary-bearing read.

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 60% and the undocumented 'inline' flag is the most consequential parameter; the description explains exactly what it changes. The 'pages' behavior is reinforced with a concrete example (201-400). Only accountId/messageId assumptions (e.g., that messageId comes from a prior email listing) are left implicit.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource: retrieve metadata and a resource link for one attachment. It is clearly distinguishable from email-level retrieval siblings like get_email, though it does not name them explicitly.

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

Usage Guidelines3/5

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

Offers conditional guidance ('with inline, the result also includes the content', 'pages returns the text of a page range'), which tells an agent how to choose between modes. However, it never states when to use this tool versus get_email or get_email_body, nor any preconditions such as needing the attachmentId from message metadata first.

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