Skip to main content
Glama
Sendmux

Sendmux Email Inbox API + Sending

Official
by Sendmux

Read Attachment

mailbox_read_attachment
Read-onlyIdempotent

Fetch attachment contents directly from email metadata; small text attachments return inline text, while binary or large files provide metadata and a fresh download link.

Instructions

Use this after finding a message attachment when you need the attachment contents. Text-like attachments are downloaded server-side and returned as text, so agents do not need a generic web_fetch tool. Binary or oversized attachments return metadata plus a fresh download link.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNoRead mode: auto, metadata, text, or resource_link. auto inlines small text attachments.auto
mailbox_idNoMailbox public ID when the credential can access more than one mailbox.
message_idYesMessage ID containing the attachment.
attachment_idYesAttachment ID from message metadata.
max_text_bytesNoMaximum text bytes to return inline. Defaults to 262144 and is capped at 1048576.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.0.8
    • addedOutput schema / $schema
      Added value: +"https://json-schema.org/draft/2020-12/schema"
    • removedOutput schema / additionalProperties
      Removed value: -true
    • addedOutput schema / oneOf
      Added value: +[
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "data": {
      +        "oneOf": [
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "content_id": {
      +                "description": "Content ID for inline attachments, when present.",
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "content_type": {
      +                "example": "application/pdf",
      +                "type": "string"
      +              },
      +              "disposition": {
      +                "example": "attachment",
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "download_url": {
      +                "description": "Short-lived URL for this exact attachment. Fetch it promptly; if it expires, call the message or attachment metadata endpoint again to receive a fresh URL.",
      +                "example": "https://app.sendmux.ai/api/v1/mailbox/messages/msg_123/attachment-downloads/attref_abc123?download_token=...",
      +                "type": "string"
      +              },
      +              "filename": {
      +                "example": "invoice.pdf",
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "id": {
      +                "description": "Attachment blob ID.",
      +                "type": "string"
      +              },
      +              "size_bytes": {
      +                "example": 12345,
      +                "type": [
      +                  "integer",
      +                  "null"
      +                ]
      +              }
      +            },
      +            "required": [
      +              "id",
      +              "filename",
      +              "content_type",
      +              "size_bytes",
      +              "disposition",
      +              "content_id"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "bytes_read": {
      +                "minimum": 0,
      +                "type": "integer"
      +              },
      +              "content_id": {
      +                "description": "Content ID for inline attachments, when present.",
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "content_type": {
      +                "example": "application/pdf",
      +                "type": "string"
      +              },
      +              "disposition": {
      +                "example": "attachment",
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "download_url": {
      +                "description": "Short-lived URL for this exact attachment. Fetch it promptly; if it expires, call the message or attachment metadata endpoint again to receive a fresh URL.",
      +                "example": "https://app.sendmux.ai/api/v1/mailbox/messages/msg_123/attachment-downloads/attref_abc123?download_token=...",
      +                "type": "string"
      +              },
      +              "filename": {
      +                "example": "invoice.pdf",
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "id": {
      +                "description": "Attachment blob ID.",
      +                "type": "string"
      +              },
      +              "read_mode": {
      +                "const": "text"
      +              },
      +              "size_bytes": {
      +                "example": 12345,
      +                "type": [
      +                  "integer",
      +                  "null"
      +                ]
      +              },
      +              "text": {
      +                "type": "string"
      +              },
      +              "truncated": {
      +                "type": "boolean"
      +              }
      +            },
      +            "required": [
      +              "id",
      +              "filename",
      +              "content_type",
      +              "size_bytes",
      +              "disposition",
      +              "content_id",
      +              "read_mode",
      +              "text",
      +              "truncated",
      +              "bytes_read"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "content_id": {
      +                "description": "Content ID for inline attachments, when present.",
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "content_type": {
      +                "example": "application/pdf",
      +                "type": "string"
      +              },
      +              "disposition": {
      +                "example": "attachment",
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "download_url": {
      +                "description": "Short-lived URL for this exact attachment. Fetch it promptly; if it expires, call the message or attachment metadata endpoint again to receive a fresh URL.",
      +                "example": "https://app.sendmux.ai/api/v1/mailbox/messages/msg_123/attachment-downloads/attref_abc123?download_token=...",
      +                "type": "string"
      +              },
      +              "filename": {
      +                "example": "invoice.pdf",
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "id": {
      +                "description": "Attachment blob ID.",
      +                "type": "string"
      +              },
      +              "read_mode": {
      +                "const": "resource_link"
      +              },
      +              "resource_link": {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "mime_type": {
      +                    "type": "string"
      +                  },
      +                  "name": {
      +                    "type": "string"
      +                  },
      +                  "size_bytes": {
      +                    "type": [
      +                      "integer",
      +                      "null"
      +                    ]
      +                  },
      +                  "uri": {
      +                    "type": "string"
      +                  }
      +                },
      +                "required": [
      +                  "uri",
      +                  "name",
      +                  "mime_type",
      +                  "size_bytes"
      +                ],
      +                "type": "object"
      +              },
      +              "size_bytes": {
      +                "example": 12345,
      +                "type": [
      +                  "integer",
      +                  "null"
      +                ]
      +              },
      +              "text": {
      +                "type": "null"
      +              }
      +            },
      +            "required": [
      +              "id",
      +              "filename",
      +              "content_type",
      +              "size_bytes",
      +              "disposition",
      +              "content_id",
      +              "read_mode",
      +              "text",
      +              "resource_link"
      +            ],
      +            "type": "object"
      +          }
      +        ]
      +      },
      +      "meta": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "request_id": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "ok": {
      +        "const": true
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "data"
      +    ],
      +    "type": "object"
      +  },
      +  {
      +    "additionalProperties": false,
      +    "properties": {
      +      "error": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "code": {
      +            "type": "string"
      +          },
      +          "doc_url": {
      +            "type": "string"
      +          },
      +          "errors": {
      +            "items": {
      +              "additionalProperties": false,
      +              "properties": {
      +                "code": {
      +                  "type": "string"
      +                },
      +                "field": {
      +                  "type": "string"
      +                },
      +                "message": {
      +                  "type": "string"
      +                }
      +              },
      +              "required": [
      +                "field",
      +                "code",
      +                "message"
      +              ],
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "message": {
      +            "type": "string"
      +          },
      +          "param": {
      +            "type": "string"
      +          },
      +          "retryable": {
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "code",
      +          "message"
      +        ],
      +        "type": "object"
      +      },
      +      "meta": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "request_id": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "ok": {
      +        "const": false
      +      }
      +    },
      +    "required": [
      +      "ok",
      +      "error"
      +    ],
      +    "type": "object"
      +  }
      +]
  2. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, and destructiveHint, so the description only needs to supplement them. It does by explaining that text-like attachments are returned as text and binary/oversized attachments return metadata plus a fresh download link. This adds useful behavioral context without contradicting the annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is three sentences with no filler. It front-loads the core use case, then explains the server-side behavior and the unnecessary web_fetch alternative. Every sentence contributes useful information.

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?

Given the output schema exists and annotations cover the safety profile, the description is largely sufficient. It covers when to use the tool, the text vs binary return behavior, and the web_fetch alternative. A minor gap is not explicitly contrasting it with mailbox_get_attachment, but this does not prevent correct use.

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 100%, so the parameters are fully documented in the input schema. The description adds context about text vs binary/oversized behavior that relates to mode and max_text_bytes, but it does not add per-parameter meaning beyond what the schema already provides.

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?

The description clearly states the tool reads attachment contents after finding an attachment, and explains the text vs binary/oversized return behavior. It also distinguishes the tool from a generic web_fetch by noting text-like attachments are downloaded server-side and returned as text.

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?

It gives explicit when-to-use context: 'Use this after finding a message attachment when you need the attachment contents.' It also tells agents they do not need a separate web_fetch tool. It does not explicitly differentiate from the sibling mailbox_get_attachment, but the content-focused purpose is clear enough for most selection decisions.

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