Skip to main content
Glama
Sendmux

Sendmux Email Inbox API + Sending

Official
by Sendmux

Get Attachment Metadata

mailbox_get_attachment
Read-onlyIdempotent

Retrieve a specific email attachment using its message and attachment IDs. Get attachment metadata and a fresh short-lived download URL, then fetch the file promptly before the link expires.

Instructions

Use this after finding a message attachment. It returns metadata plus a fresh short-lived download_url for that exact attachment; fetch the URL promptly, and call this tool again if it expires.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
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.

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": {
      +        "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"
      +      },
      +      "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.5/5.0
Behavior5/5

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

Beyond the readOnlyHint and idempotentHint annotations, the description adds critical behavioral detail: the download_url is short-lived and must be fetched promptly, and the tool should be called again if it expires. This is exactly the kind of actionable behavior an agent needs.

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?

Two dense sentences with no filler. The usage context is front-loaded, followed by the critical expiry warning and remedy.

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 a full input schema, output schema, and detailed annotations, the description covers the one thing structured data cannot express: the transient nature of the returned URL and how to handle expiry. Nothing essential 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 description coverage is 100%, so the schema already documents all parameters. The description adds no significant parameter-level semantics beyond implying that message_id and attachment_id identify the exact attachment.

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 a specific verb and resource: it returns metadata plus a fresh short-lived download_url for a specific message attachment. This distinguishes it from sibling tools like mailbox_read_attachment, which likely retrieve content rather than metadata and a URL.

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?

The description gives explicit context: use this after finding a message attachment. It does not explicitly name alternatives or state when not to use it, but the sequencing guidance is clear and practical.

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