Skip to main content
Glama
your-mail-mcp

your-mail-mcp

count

Read-only

Count email messages matching a notmuch query across all IMAP accounts or one account, so you can check result totals before retrieving them.

Instructions

Count the messages matching a query.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "query": "<query>"
    },
    "name": "count"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYesnotmuch query, for example from:alice@example.com and date:2026-01-01..2026-06-30. Terms: from: to: subject: tag: folder: attachment: date:, combined with and/or/not. A bare word matches anywhere in the message.
accountNoLimit the search to one account, named as folders and status report it. Omit to search every account at once.
include_excludedNoSet true to also search the junk and trash folders, which are left out by default. Use it only when a message is expected to be there, since mail in those folders is more likely to be hostile.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv0.5.0
    • addedInput schema / properties / account / description
      Added value: +"Limit the search to one account, named as folders and status report it. Omit to search every account at once."
    • addedInput schema / properties / include_excluded / description
      Added value: +"Set true to also search the junk and trash folders, which are left out by default. Use it only when a message is expected to be there, since mail in those folders is more likely to be hostile."
    • addedInput schema / properties / query / description
      Added value: +"notmuch query, for example from:alice@example.com and date:2026-01-01..2026-06-30. Terms: from: to: subject: tag: folder: attachment: date:, combined with and/or/not. A bare word matches anywhere in the message."
  2. First observedv0.3.0

TDQS

B3.1/5.0
Behavior2/5

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

Annotations already cover the read-only, non-destructive profile, so the description only needed to add operational context — but it discloses nothing about cost, whether excluded folders are skipped, or that the result is just a tally. Note the odd idempotentHint=false on a pure read, which the description does nothing to clarify.

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?

A single front-loaded sentence with no filler. Nothing in it is redundant or misplaced.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read-only counter with fully documented parameters, the essentials are nearly there, but with no output schema the description should say that the result is a single count and not messages — an agent could otherwise assume it returns content.

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%, with the query syntax, account scoping, and include_excluded semantics all documented inline. The description adds nothing beyond that, which is the baseline 3 case.

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?

States a specific verb ('Count') and resource ('messages matching a query'), so the intent is unambiguous. It does not distinguish itself from siblings like 'search' or 'ids', which take similar queries and return messages or identifiers.

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

Usage Guidelines2/5

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

No guidance on when to use count instead of 'search' or 'ids', and no mention that it returns only a number rather than message content. The agent must infer the choice from the names alone.

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