Skip to main content
Glama
tom275275

Google Workspace MCP Server

by tom275275

search_gmail_messages

Search Gmail messages using standard search operators, returning message and thread IDs with clickable links for manual verification. Supports pagination to retrieve additional results.

Instructions

Searches messages in a user's Gmail account based on a query. Returns both Message IDs and Thread IDs for each found message, along with Gmail web interface links for manual verification. Supports pagination via page_token parameter.

Args: query (str): The search query. Supports standard Gmail search operators. user_google_email (str): The user's Google email address. Required. page_size (int): The maximum number of messages to return. Defaults to 10. page_token (Optional[str]): Token for retrieving the next page of results. Use the next_page_token from a previous response.

Returns: str: LLM-friendly structured results with Message IDs, Thread IDs, and clickable Gmail web interface URLs for each found message. Includes pagination token if more results are available.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYes
page_sizeNo
page_tokenNo
user_google_emailYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.14.3

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the full disclosure burden and does solid work: it states the return shape (Message IDs, Thread IDs, web links), the pagination contract via page_token, and the page_size default of 10. It omits auth prerequisites (start_google_auth is a sibling) and no-result behavior, but for a non-destructive search operation nothing surprising is hidden.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in the first sentence, followed by return-value and pagination highlights, then clean Args and Returns sections. There is mild redundancy between the opening summary ('Returns both Message IDs and Thread IDs...') and the Returns paragraph, but every section earns its place given the 0% schema coverage the description must compensate for.

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 4-parameter tool with no annotations and an empty schema, the description covers purpose, all parameter semantics, return format, and the pagination loop end-to-end. The only notable omission is the auth state required (sibling start_google_auth hints this matters), which is minor for a read-only search tool.

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?

Schema description coverage is 0%, and the description fully compensates by documenting all four parameters with operational detail: query supports 'standard Gmail search operators,' page_token is tied to 'next_page_token from a previous response,' page_size has an explicit default, and user_google_email is marked Required. This adds meaning well beyond the bare schema types.

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?

States a specific verb and resource — 'Searches messages in a user's Gmail account' — and clarifies it returns Message IDs, Thread IDs, and web verification links, which cleanly separates it from content-fetching siblings like get_gmail_message_content and Chat's search_messages. An agent can tell what this tool does without opening the schema.

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?

Usage is implied rather than stated: the description positions the tool as a search-and-verify step ('for manual verification') with pagination support, but never names alternatives or exclusion conditions. An agent must infer that get_gmail_message_content or get_gmail_threads_content_batch would be the follow-up for actual content, since the description notes search only returns IDs and links.

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

Deploy Server

Other Tools