Skip to main content
Glama
cunicopia-dev

gmail-mcp

count_messages

Count Gmail messages matching a query without fetching content—use it as a blast-radius check before bulk actions. With all_accounts, get a per-account breakdown and total across authorized accounts.

Instructions

Count how many messages match a Gmail query WITHOUT fetching their content — the blast-radius check to run before a bulk_action or trash. Set all_accounts=true to count across every authorized account and get a per-account breakdown plus a total.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesGmail search query.
accountNoAccount to count in (ignored if all_accounts).
all_accountsNoCount across every authorized account.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.7.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations provided, the description carries the full burden of disclosure, and it delivers meaningfully: it states the tool does not fetch message content, positions itself as a non-destructive safety/blast-radius check, and describes the multi-account output behavior ('per-account breakdown plus a total'). It stops short of a 5 because it does not address counting semantics such as spam/trash inclusion or whether the query syntax matches search_messages.

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 deliver purpose, scope, the multi-account option, and its return behavior with zero filler. The primary function is front-loaded ahead of the usage context, and every clause 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?

For a simple 3-parameter tool with no output schema, the description covers the essentials: what is counted, what is not fetched, when to run it, and the return shape for the multi-account case. It is slightly incomplete on the non-all_accounts return format and Gmail query edge cases, but these are minor given the tool's low complexity.

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 the baseline is 3 and the schema already documents all three parameters. The description adds modest value by noting that all_accounts=true yields a per-account breakdown plus a total, but it does not deepen semantics for query syntax or the account-override behavior beyond what the schema states.

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 specifies a precise verb and resource — 'Count how many messages match a Gmail query' — with the key differentiator 'WITHOUT fetching their content', which cleanly separates it from content-returning siblings like search_messages, read_message, and read_thread. The blast-radius framing also ties it to bulk_action and trash, so an agent can tell this tool apart without opening any sibling schemas.

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?

'The blast-radius check to run before a bulk_action or trash' explicitly states when to invoke this tool — prior to destructive or bulk operations — giving clear context for selection. However, it never names the alternative content-returning tools or states when NOT to use count_messages; the exclusion is only implied by the 'WITHOUT fetching their content' clause.

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

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/cunicopia-dev/gmail-mcp'

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