Skip to main content
Glama
Sendmux

Sendmux Email Inbox API + Sending

Official
by Sendmux

Upload Attachment

mailbox_upload_attachment

Upload a file before sending it as an email attachment: generate a short-lived signed URL for real files and get a blob ID for later use. Inline base64 handles small agent-authored files up to 32 KiB.

Instructions

Use this before sending a mailbox attachment. For real files set presign_upload_url=true with filename, content_type, and size_bytes, then PUT the file to the returned short-lived URL promptly and send the returned blob_id. Inline content_base64 is a last resort for tiny agent-authored files only and is capped at 32 KiB decoded.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
filenameYesFilename to use when sending the uploaded attachment.
mailbox_idNoMailbox public ID when the credential can access more than one mailbox.
size_bytesNoExact byte size required when presign_upload_url=true.
content_typeNoMIME type to store with the upload, for example application/pdf.application/octet-stream
content_base64NoLast-resort inline base64 for tiny agent-authored files only. Decoded content must be at most 32 KiB; use presign_upload_url for real files.
presign_upload_urlNoWhen true, return a short-lived signed PUT URL instead of reading bytes. Provide size_bytes and upload with a shell/client promptly.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed5 schema fields changedv1.0.8
    • changedInput schema / properties / content_base64 / description
      Previous value: -"Last-resort inline base64 for tiny agent-authored files only. Decoded content must be at most 32 KiB; use file_path or presign_upload_url for real files."New value: +"Last-resort inline base64 for tiny agent-authored files only. Decoded content must be at most 32 KiB; use presign_upload_url for real files."
    • removedInput schema / properties / file_path
      Removed value: -{
      -  "anyOf": [
      -    {
      -      "type": "string"
      -    },
      -    {
      -      "type": "null"
      -    }
      -  ],
      -  "default": null,
      -  "description": "Local file path for stdio MCP only. The path must be inside a client-declared MCP root; hosted MCP rejects it."
      -}
    • 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": {
      +              "blob_id": {
      +                "description": "Uploaded attachment blob ID for a later send request.",
      +                "type": "string"
      +              },
      +              "content_type": {
      +                "example": "application/pdf",
      +                "type": "string"
      +              },
      +              "filename": {
      +                "example": "invoice.pdf",
      +                "type": "string"
      +              },
      +              "size_bytes": {
      +                "example": 12345,
      +                "type": "integer"
      +              }
      +            },
      +            "required": [
      +              "blob_id",
      +              "filename",
      +              "content_type",
      +              "size_bytes"
      +            ],
      +            "type": "object"
      +          },
      +          {
      +            "additionalProperties": false,
      +            "properties": {
      +              "expires_at": {
      +                "description": "Upload URL expiry time.",
      +                "format": "date-time",
      +                "type": "string"
      +              },
      +              "headers": {
      +                "additionalProperties": false,
      +                "description": "Headers that must be sent exactly with the PUT request.",
      +                "properties": {
      +                  "Content-Length": {
      +                    "type": "string"
      +                  },
      +                  "Content-Type": {
      +                    "type": "string"
      +                  }
      +                },
      +                "required": [
      +                  "Content-Type",
      +                  "Content-Length"
      +                ],
      +                "type": "object"
      +              },
      +              "max_size_bytes": {
      +                "description": "Maximum accepted attachment size in bytes.",
      +                "type": "integer"
      +              },
      +              "method": {
      +                "description": "HTTP method to use with `upload_url`.",
      +                "enum": [
      +                  "PUT"
      +                ],
      +                "type": "string"
      +              },
      +              "upload_id": {
      +                "description": "Short-lived upload intent ID.",
      +                "type": "string"
      +              },
      +              "upload_url": {
      +                "description": "Short-lived signed PUT URL for this exact attachment. Upload promptly; if it expires, create a new upload URL.",
      +                "example": "https://app.sendmux.ai/api/v1/mailbox/attachment-uploads/upl_123?upload_token=...",
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "upload_id",
      +              "upload_url",
      +              "method",
      +              "expires_at",
      +              "headers",
      +              "max_size_bytes"
      +            ],
      +            "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?

The description adds meaningful behavioral detail beyond the annotations: the returned URL is short-lived and must be used promptly, the upload returns a blob_id to send later, and inline base64 is capped at 32 KiB decoded. Annotations already indicate this is not read-only, and the description expands on the operational workflow without contradicting them.

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. The primary use case is front-loaded, and each sentence adds a necessary point: when to use it, how to handle real files, and when to use the fallback path.

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?

Given the tool's moderate complexity, full schema descriptions, output schema, and annotations, the description covers the complete workflow: choosing the presigned path, supplying required fields, uploading promptly, and reusing the blob_id when sending. Nothing essential for correctly invoking the tool is missing.

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?

Because schema description coverage is 100%, the baseline is 3, but the description adds important usage semantics: which parameters belong to the presigned path, what 'promptly' means for the short-lived URL, and that inline content is capped at 32 KiB decoded. This goes beyond simply restating the schema.

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?

The description states a specific verb and resource: uploading an attachment before sending a mailbox message, with distinct handling for presigned real-file uploads versus inline base64. It is clearly about upload, not retrieval, but it does not explicitly differentiate itself from the sibling tool sending_upload_attachment, so it stops short of full sibling differentiation.

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 clear usage context: use before sending a mailbox attachment, use presign_upload_url=true for real files, and use content_base64 only as a last resort for tiny agent-authored files. It explains the two modes well but does not explicitly contrast this tool with alternative siblings such as sending_upload_attachment.

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