Skip to main content
Glama
Sendmux

Sendmux Email Inbox API + Sending

Official
by Sendmux

Wait For Message

mailbox_wait_for_message
Read-onlyIdempotent

Wait for new email for up to 25 seconds instead of manual polling. Returns a matching message with attachment metadata found by filters, or a no_message result to call again.

Instructions

Use this to wait briefly for new mail instead of manual polling. It polls for up to 25 seconds, returns a matching message with attachment metadata when found, or a clean no_message result so you can call again.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNoOptional full-text query to match.
afterNoISO 8601 lower bound for received_at. Omit to wait for messages received after this call starts.
keywordNoOptional keyword/label that the message must have, such as $seen.
subjectNoOptional subject text filter.
folder_idNoOptional folder ID filter.
from_emailNoOptional sender email address or display-name filter.
mailbox_idNoMailbox public ID when the credential can access more than one mailbox.
has_attachmentNoWhen true, wait only for messages with attachments.
timeout_secondsNoMaximum seconds to wait. Capped at 25 seconds so MCP clients do not hold a tool call open indefinitely.

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": {
      +          "matched": {
      +            "type": "boolean"
      +          },
      +          "message": {
      +            "oneOf": [
      +              {
      +                "additionalProperties": false,
      +                "properties": {
      +                  "attachments": {
      +                    "items": {
      +                      "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"
      +                    },
      +                    "type": "array"
      +                  },
      +                  "id": {
      +                    "type": "string"
      +                  },
      +                  "received_at": {
      +                    "type": [
      +                      "string",
      +                      "null"
      +                    ]
      +                  }
      +                },
      +                "required": [
      +                  "id",
      +                  "received_at",
      +                  "attachments"
      +                ],
      +                "type": "object"
      +              },
      +              {
      +                "type": "null"
      +              }
      +            ]
      +          },
      +          "next_after": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "matched",
      +          "message",
      +          "next_after"
      +        ],
      +        "type": "object"
      +      },
      +      "meta": {
      +        "additionalProperties": false,
      +        "properties": {
      +          "request_id": {
      +            "type": "string"
      +          },
      +          "sync_state": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "request_id"
      +        ],
      +        "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"
      +          },
      +          "sync_state": {
      +            "type": "string"
      +          }
      +        },
      +        "required": [
      +          "request_id"
      +        ],
      +        "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?

Adds meaningful behavioral detail beyond the annotations: it polls up to 25 seconds, returns a matching message with attachment metadata when found, and returns a clean no_message result so the agent can call again. This clarifies retry semantics and the non-terminal nature of the operation.

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 sentences with no wasted words. The purpose and usage guidance are front-loaded, and the retry behavior is stated efficiently.

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 full parameter descriptions, annotations indicating a read-only/idempotent operation, and an output schema available, the description covers everything an agent needs: when to use it, how long it waits, and what result to expect.

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 coverage is 100% and every parameter has a description, so the schema carries the documentation burden. The tool description adds no parameter-specific meaning beyond restating the timeout behavior, matching the baseline for fully covered schemas.

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: wait for new mail rather than manually polling. It clearly describes the polling window, the matching-message result, and the no_message fallback, which makes its role distinct from sibling read tools like mailbox_get_message or mailbox_list_messages.

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?

Gives explicit usage context: use this to wait briefly for new mail instead of manual polling. It does not name sibling alternatives or state when not to use it, but the intended scenario is clear.

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