Skip to main content
Glama

list_threads

Read-only

Search and retrieve conversation threads from an authenticated Gmail mailbox using query filters, label IDs, pagination, and optional spam/trash inclusion.

Instructions

List conversation threads in the authenticated user's mailbox.

Args: query: Gmail search syntax filter, e.g. 'subject:invoice newer_than:7d'. label_ids: Only return threads that have all of these label IDs. max_results: Maximum number of threads to return (default 50, max 500). page_token: Continuation token from a previous response for pagination. include_spam_trash: When True, include threads from SPAM and TRASH.

Returns: Dictionary with threads (id, snippet, history_id), optional next_page_token, and result_size_estimate. Use get_thread for full messages. On API failure, returns {"error": "..."}.

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "list_threads"
  }
}

Input Schema

NameRequiredDescriptionDefault
queryNo
label_idsNo
page_tokenNo
max_resultsNo
include_spam_trashNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.9.6

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true, so the safety profile is covered; the description adds value beyond that with default/max result counts (50/500), pagination via page_token, and the error contract {"error": "..."}. It doesn't discuss quota/rate limits or ordering, but the behavioral disclosure is well above the annotation baseline.

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?

Front-loaded one-line purpose followed by structured Args and Returns blocks; each line is informative. The Returns block partially restates what the output schema already provides, which is minor redundancy rather than waste.

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?

For a 5-parameter read-only list tool with zero schema description coverage, the definition covers every parameter, the pagination model, the result shape, and the failure mode. An agent has everything needed to call it correctly on the first attempt.

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%, so the description carries the full burden and does: it explains query as Gmail search syntax with a concrete example, label_ids as an AND-match over label IDs, max_results default and ceiling, page_token as a continuation token, and include_spam_trash's effect on SPAM/TRASH.

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 (list) and resource (conversation threads in the authenticated user's mailbox), and explicitly points to get_thread for full messages, so an agent can distinguish it from the sibling without opening a schema.

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?

Clear context for use plus an explicit alternative: 'Use get_thread for full messages.' It also notes when include_spam_trash matters. It lacks explicit when-not conditions (e.g., bulk export or message-level filtering), but the routing to get_thread covers the main ambiguity.

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