Skip to main content
Glama
sethbang

proton-mail-mcp

count_messages

Read-onlyIdempotent

Get the number of messages in a folder that match your search criteria. Returns a simple count quickly without fetching full message details.

Instructions

Count messages in a folder matching optional search criteria. Returns just a number (no envelopes fetched). The attachment filters (hasAttachment, attachmentName, attachmentType) are rejected here — they require an envelope scan that defeats the count's speed promise. Use search_messages for attachment-based filtering. A non-selectable namespace container (e.g. Folders/Labels) is rejected with an actionable error rather than returning 0.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
folderNoFolder to count in (default: INBOX). A non-selectable namespace container like `Folders`/`Labels` is rejected.INBOX
matchNoOptional search criteria to narrow the count (same fields as search_messages: from, to, subject, body, since, before, seen, flagged, larger, smaller, listId). Attachment filters are NOT allowed here — use search_messages for those. Omit to count every message in the folder.
Behavior5/5

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

Annotations already indicate read-only and idempotent behavior. The description adds that it returns just a number, attachment filters are rejected, and non-selectable namespace containers yield an actionable error. No contradictions.

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?

Three sentences, each adding value: purpose, behavior, and specific constraints. Front-loaded with main action. No wasted words.

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?

For a simple counting tool with no output schema, the description covers its main purpose, error handling, and limitations. No gaps given the complexity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 100% description coverage. The description adds context: attachment filters are rejected due to performance trade-offs, and omitting match counts all messages. This goes beyond the schema.

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 that the tool counts messages in a folder with optional search criteria and returns only a number. It distinguishes itself from search_messages by explicitly noting attachment filters are not allowed, clarifying its purpose.

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 guidance: use this tool for fast counts without fetching envelopes; avoid for attachment-based filtering, where search_messages is recommended. This helps the agent choose correctly.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sethbang/proton-mail-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server