Skip to main content
Glama
Sendmux

Sendmux Email Inbox API + Sending

Official
by Sendmux

Count Messages

mailbox_count_messages
Read-onlyIdempotent

Count messages in a mailbox using filters like sender, subject, or date, without retrieving the full list. Get totals to gauge volume or guide follow-up listing actions.

Instructions

Use this to count messages matching mailbox filters without listing every result. Follow with mailbox_list_messages only when examples are needed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qNoFull-text search query across message fields.
ccNoFilter by CC recipient email address or display name.
toNoFilter by To recipient email address or display name.
bccNoFilter by BCC recipient email address or display name.
bodyNoFilter by message body text.
fromNoFilter by sender email address or display name.
afterNoFilter to messages after this ISO 8601 timestamp.
beforeNoFilter to messages before this ISO 8601 timestamp.
keywordNoRequire this message keyword, such as `$seen`.
subjectNoFilter by subject text.
folder_idNoFilter to messages in this folder ID.
is_unreadNoWhen true, only return unread messages.
thread_idNoFilter to messages in this thread ID.
mailbox_idNoMailbox public ID to target when the credential grants access to more than one mailbox. Omit when the credential is scoped to exactly one mailbox.
header_nameNoHeader name to match with `header_value`.
not_keywordNoExclude messages with this keyword.
header_valueNoHeader value to match with `header_name`.
has_attachmentNoWhen true, only return messages with attachments.
max_size_bytesNoMaximum message size in bytes.
min_size_bytesNoMinimum message size in bytes.

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed4 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 / properties
      Added value: +{
      +  "result": {
      +    "allOf": [
      +      {
      +        "properties": {
      +          "meta": {
      +            "additionalProperties": {},
      +            "properties": {},
      +            "type": "object"
      +          },
      +          "ok": {
      +            "enum": [
      +              true
      +            ],
      +            "type": "boolean"
      +          }
      +        },
      +        "required": [
      +          "ok",
      +          "meta"
      +        ],
      +        "type": "object"
      +      },
      +      {
      +        "properties": {
      +          "data": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "sync_state": {
      +                "type": [
      +                  "string",
      +                  "null"
      +                ]
      +              },
      +              "total": {
      +                "type": "integer"
      +              }
      +            },
      +            "required": [
      +              "total",
      +              "sync_state"
      +            ],
      +            "type": "object"
      +          },
      +          "meta": {
      +            "additionalProperties": false,
      +            "properties": {
      +              "request_id": {
      +                "example": "req_clxxxxxxxxxxxxxxxxxxxxxxxxx",
      +                "type": "string"
      +              }
      +            },
      +            "required": [
      +              "request_id"
      +            ],
      +            "type": "object"
      +          }
      +        },
      +        "required": [
      +          "data"
      +        ],
      +        "type": "object"
      +      }
      +    ],
      +    "unevaluatedProperties": {
      +      "not": {}
      +    },
      +    "x-fastmcp-top-level-schema": "MailboxMessageCountResponse"
      +  }
      +}
    • addedOutput schema / required
      Added value: +[
      +  "result"
      +]
  2. First observedv1.0.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, openWorldHint, idempotentHint, and destructiveHint, covering safety and idempotency. The description adds the behavioral trait that it does not list results (only counts), which is useful beyond the annotations. It also hints at a workflow sequence. No contradiction with 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 two sentences with zero redundancy. The primary purpose is front-loaded, and the usage alternative is stated succinctly. Every word earns its place.

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 tool has 20 optional parameters and an output schema exists (though not shown), the description sufficiently explains when to use it and what it accomplishes. It does not explain the return format, but the output schema likely covers that. The description is adequate for an agent to decide when to invoke this tool.

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?

The schema description coverage is 100%, so the baseline is 3. The description does not elaborate on any parameters; it only refers to 'mailbox filters' generically. Since the schema already documents all 20 parameters, the description adds no additional semantic value here.

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's function: 'count messages matching mailbox filters without listing every result.' It specifies the verb (count) and resource (messages), and explicitly differentiates itself from mailbox_list_messages, which is a sibling. This makes the purpose unambiguous.

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

Usage Guidelines5/5

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

The description provides explicit usage guidance: use this tool to count messages, and follow with mailbox_list_messages only when examples are needed. This directly addresses when to use this tool versus an alternative, leaving no ambiguity for the agent.

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