Skip to main content
Glama
c0webster

Hardened Google Workspace MCP

by c0webster

search_gmail_messages

Search Gmail messages using queries with standard operators to find specific emails, returning message and thread IDs with web links for verification.

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
user_google_emailYes
page_sizeNo
page_tokenNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
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 behavioral disclosure. It effectively describes key behaviors: it returns structured results with IDs and web links, supports pagination via page_token, and mentions manual verification capabilities. However, it does not cover aspects like rate limits, authentication requirements, or error handling, leaving some gaps for a tool with no annotations.

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?

The description is well-structured and appropriately sized, with a clear opening sentence followed by bullet-point-like sections for Args and Returns. Every sentence adds value, such as explaining pagination and return format. Minor improvements could include merging some details into a more fluid paragraph, but overall it is efficient and front-loaded.

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?

Given the tool's complexity (4 parameters, no annotations, but with an output schema), the description is largely complete. It covers input semantics, behavioral traits like pagination, and output format, though the output schema likely handles return values. It could be more complete by addressing authentication or error scenarios, but it provides sufficient context for effective use.

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

Parameters4/5

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

Schema description coverage is 0%, so the description must compensate. It adds meaningful semantics for all parameters: 'query' supports Gmail search operators, 'user_google_email' is required, 'page_size' defaults to 10, and 'page_token' is for pagination with usage instructions. This goes beyond the bare schema, though it could provide more detail on query syntax or email format validation.

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 the tool's purpose with specific verbs ('searches messages') and resources ('in a user's Gmail account'), distinguishing it from siblings like 'get_gmail_message_content' or 'draft_gmail_message'. It explicitly mentions what it returns (Message IDs, Thread IDs, Gmail web links) and supports (pagination), making the purpose unambiguous.

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?

The description implies usage for searching Gmail messages with a query, but does not explicitly state when to use this tool versus alternatives like 'search_docs' or 'search_drive_files'. It mentions pagination support, which provides some context, but lacks guidance on prerequisites (e.g., authentication) or exclusions compared to other Gmail-related tools.

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/c0webster/hardened-google-workspace-mcp'

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