Skip to main content
Glama

search_gmail_messages_tool

Search Gmail messages using queries to find specific emails by sender, subject, or other criteria within Apps Script projects.

Instructions

Search for Gmail messages matching a query.

Args: user_google_email: The user's Google email address query: Gmail search query (e.g., "from:user@example.com subject:hello") max_results: Maximum number of messages to return (default: 10)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
user_google_emailYes
queryNo
max_resultsNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior2/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 mentions the action ('search') and a default value for 'max_results,' but fails to describe key behaviors such as authentication requirements, rate limits, error handling, pagination, or the format of returned results. The presence of an output schema mitigates some gaps, but the description lacks essential operational context for a tool that likely interacts with external APIs.

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 appropriately sized and front-loaded, with the core purpose stated first followed by parameter details in a clear 'Args:' section. Every sentence adds value, such as the query example, and there is no redundant or verbose content. However, the structure could be slightly improved by integrating usage guidelines or behavioral notes more seamlessly.

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?

Given the tool's moderate complexity (3 parameters, no annotations, but with an output schema), the description is partially complete. It covers parameter semantics adequately and the output schema will handle return values, but it lacks critical behavioral details like authentication needs, rate limits, and error conditions. For a search tool interacting with Gmail, this omission leaves significant gaps in understanding how to use it effectively.

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?

The description adds meaningful context for all three parameters beyond the input schema, which has 0% description coverage. It clarifies that 'user_google_email' is 'The user's Google email address,' 'query' is a 'Gmail search query' with an example, and 'max_results' has a default of 10. This compensates well for the schema's lack of descriptions, though it does not detail constraints like email format validation or query syntax beyond the example.

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 clearly states the tool's purpose as 'Search for Gmail messages matching a query,' which includes a specific verb ('search') and resource ('Gmail messages'). It distinguishes itself from sibling tools like 'get_gmail_message_tool' (which retrieves a single message) and 'send_gmail_message_tool' (which sends messages), but does not explicitly differentiate from other search tools like 'search_docs_tool' or 'search_drive_files_tool' beyond the resource type.

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?

The description provides no guidance on when to use this tool versus alternatives. It does not mention prerequisites (e.g., authentication status), compare it to similar tools like 'get_gmail_message_tool' for single-message retrieval, or specify scenarios where it is most appropriate. The only implied usage is for searching Gmail messages, but this is redundant with the purpose statement.

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/sam-ent/appscript-mcp'

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