Skip to main content
Glama
mailbox-org-mcp
by getrdone

Count messages

mailbox_count_messages
Read-only

Count messages matching a Gmail-style query per folder without listing them, so you can check how many unread newsletters exist or size a cleanup before a bulk action.

Instructions

Count messages matching a Gmail-style query per folder, without listing them. Good for 'how many unread newsletters' or sizing a cleanup before a bulk action.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "mailbox_count_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryNoGmail-style query. Examples: from:amazon is:unread | subject:"invoice" newer_than:30d | has:attachment larger:5M | label:$purchases | color:red | is:starred -from:me | has:unsubscribe older_than:6m | (from:a OR from:b) | in:Archive. Bare words search headers and body. Empty = all messages.
foldersNoDefault INBOX. ["all"] = every folder except Trash and Junk.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A3.8/5.0
Behavior3/5

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

Annotations already declare readOnlyHint and openWorldHint, so safety is covered. The description adds that messages are not listed (a payload-size hint) and that results are aggregated per folder, but with no output schema it says nothing about the actual return shape, error behavior, or cost of counting over many folders.

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, front-loaded with the verb and scope, followed by concrete usage examples. No filler or restatement of the title.

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?

For a zero-required-parameter read tool with no output schema, the description covers purpose, scope, and rough result shape (count per folder). Only the exact return structure and any folder-count limits are unaddressed.

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 both parameters are fully documented in the schema, including the Gmail query syntax and folder defaults. The description only reinforces the per-folder framing and adds no syntax or edge-case detail beyond 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?

Names a specific verb (count) and resource (messages), plus the scoping dimensions (query, per folder) and the key differentiator: results are counts, not message listings. It does not name the sibling search/list tool it is implicitly distinguished from, so it falls just short of top marks.

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 concrete when-to-use scenarios ('how many unread newsletters', 'sizing a cleanup before a bulk action'), the latter implicitly routing destructive/bulk siblings to be preceded by this call. It does not explicitly name alternatives or when-not to use it, but the guidance is clear enough to select the tool.

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