list_threads
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
| Name | Required | Description | Default |
|---|---|---|---|
| query | No | ||
| label_ids | No | ||
| page_token | No | ||
| max_results | No | ||
| include_spam_trash | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||