Skip to main content
Glama

gmail search messages

gmail_search_messages
Read-onlyIdempotent

Search Gmail messages using Gmail query syntax to find emails by sender, date, label, or unread status; returns matching message IDs for follow-up actions.

Instructions

Search Gmail with Gmail query syntax (e.g. 'from:boss@x.com is:unread newer_than:7d'). Returns message IDs.

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": "gmail_search_messages"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryYes
label_idsNo
max_resultsNo
include_spam_trashNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint, idempotentHint, openWorldHint and destructiveHint=false, so safety is covered. The description still adds genuine value by disclosing that only message IDs come back, signalling to the agent that a follow-up call is required to read content. It omits result-count capping/pagination behavior, which is the main remaining behavioral gap.

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 short sentences, front-loaded with the action and immediately followed by a concrete example and the return shape. Nothing is redundant with the title or annotations, and no sentence is wasted.

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?

An output schema exists, so return structure need not be spelled out, and the safety profile is fully annotated. Still, for a four-parameter search tool the description leaves the non-query parameters and any result-limit semantics entirely undocumented, which is a noticeable gap for correct invocation.

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

Parameters2/5

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

Schema description coverage is 0%, and the description only illustrates the 'query' parameter's syntax. The three optional parameters — label_ids, max_results (default 10) and include_spam_trash — receive no explanation at all, so an agent could silently under-fetch or miss label-scoped searches.

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?

The description names a specific verb and resource ('Search Gmail') and adds the query dialect plus the return shape ('Returns message IDs'), which is far more than the title alone. It does not explicitly contrast with siblings like gmail_list_threads or gmail_get_message, so an agent must infer that this is the free-text/query-driven entry point.

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

Usage Guidelines3/5

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

An example query ('from:boss@x.com is:unread newer_than:7d') shows intended usage concretely, which implies when to reach for this tool. However there is no statement of when not to use it, and no routing to gmail_get_message for full message content or gmail_list_threads for thread grouping.

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