Skip to main content
Glama
nityeshaga

google-workspace-mcp-server

by nityeshaga

List Gmail Messages

gmail_list_messages
Read-onlyIdempotent

List Gmail messages filtered by search query, labels, or pagination, showing subject, sender, date, and snippet.

Instructions

List messages from Gmail with optional search filters.

Args:

  • query (string, optional): Gmail search query (e.g., 'from:boss@company.com is:unread', 'subject:invoice after:2024/01/01')

  • max_results (number): Maximum messages to return, 1-100 (default: 10)

  • label_ids (string[]): Filter by labels like 'INBOX', 'UNREAD', 'STARRED', 'SENT'

  • page_token (string, optional): Token for pagination

  • response_format ('markdown' | 'json'): Output format (default: 'markdown')

Returns: List of message summaries with ID, subject, from, date, and snippet.

Examples:

  • Unread emails: query="is:unread"

  • From specific sender: query="from:notifications@github.com"

  • Recent with attachment: query="has:attachment newer_than:7d"

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoGmail search query (e.g., 'from:someone@example.com is:unread', 'subject:invoice')
label_idsNoFilter by label IDs (e.g., ['INBOX', 'UNREAD', 'STARRED'])
page_tokenNoToken for pagination to retrieve the next page of results
max_resultsNoMaximum messages to return (1-100)
response_formatNoOutput format: 'markdown' for human-readable or 'json' for structured datamarkdown
Behavior4/5

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

Annotations already declare readOnlyHint=true and idempotentHint=true, and the description does not contradict this. It adds valuable behavioral details beyond those hints, including the return format (Markdown/JSON), pagination via page_token, default max_results, and the output structure (ID, subject, from, date, snippet). This is especially helpful given there is no output schema to define the return value.

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 with Args, Returns, and Examples sections. It is slightly verbose due to repeating some schema details, but every section serves a purpose: examples illustrate usage, returns clarifies output, and parameter defaults are restated for readability. Light redundancy with the schema is acceptable here.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has 5 parameters, no output schema, and relies on annotations for safety, the description fills the gaps well. It explains pagination, return fields, defaults, and even provides multiple use-case examples. This is a complete, self-contained description that allows an agent to select and invoke the tool correctly without additional external knowledge.

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 schema provides 100% coverage with descriptions for all five parameters, so the bar for added value is higher. The description still contributes by showing concrete query syntax (e.g., 'from:boss@company.com is:unread', 'subject:invoice after:2024/01/01') and clarifying response_format with 'markdown' vs 'json'. These examples go beyond the schema's parameter descriptions.

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 opens with 'List messages from Gmail with optional search filters,' which clearly states the verb (list), resource (Gmail messages), and scope (optional filters). It distinguishes from siblings like gmail_get_message (single message) and gmail_list_threads (threads) by explicitly focusing on messages.

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 description provides strong contextual guidance through examples ('Unread emails: query="is:unread"', 'From specific sender'), making it clear this tool is for listing/searching messages. It does not explicitly name alternatives or state when not to use it, but the scope is evident from the examples and sibling tool names.

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/nityeshaga/google-workspace-mcp-server'

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