Skip to main content
Glama

gmail.users.threads.list

List Gmail threads in a user's mailbox, filtered by search query or label IDs, with pagination and optional inclusion of spam and trash.

Instructions

Lists the threads in the user's mailbox. For more information, see Manage threads [HTTP GET]. Returns the requested resource as JSON — request bodies are built from the typed parameters (typed flags win over the params map), or read whole from body_file Siblings over the same resource: delete, get, modify, trash, untrash.

Input Schema

NameRequiredDescriptionDefault
qNo[query parameter] Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, `"from:someuser@example.com rfc822msgid:
queryNoExtra KEY=VALUE query pairs for endpoints whose parameters Discovery does not describe.
paramsNoParameter map merged into the request; typed parameters win.
userIdYes[URL path segment] The user's email address. The special value `me` can be used to indicate the authenticated user.me
dry_runNoReturn the request that would be sent, without sending it.
labelIdsNo
body_fileNoRead the request body from this file ('-' for stdin) instead of building one from the parameters.
pageTokenNo[query parameter] Page token to retrieve a specific page of results in the list.
maxResultsNo[query parameter] Maximum number of threads to return. This field defaults to 100. The maximum allowed value for this field is 500.100
includeSpamTrashNo[query parameter] Include threads from `SPAM` and `TRASH` in the results.false

Output Schema

NameRequiredDescriptionDefault
threadsNo
nextPageTokenNo
resultSizeEstimateNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changed
    • addedInput schema / properties / includeSpamTrash / default
      Added value: +"false"
    • changedInput schema / properties / includeSpamTrash / description
      Previous value: -"Include threads from `SPAM` and `TRASH` in the results."New value: +"[query parameter] Include threads from `SPAM` and `TRASH` in the results."
    • changedInput schema / properties / labelIds / items / description
      Previous value: -"Only return threads with labels that match all of the specified label IDs."New value: +"[query parameter] Only return threads with labels that match all of the specified label IDs."
    • addedInput schema / properties / maxResults / default
      Added value: +"100"
    • changedInput schema / properties / maxResults / description
      Previous value: -"Maximum number of threads to return. This field defaults to 100. The maximum allowed value for this field is 500."New value: +"[query parameter] Maximum number of threads to return. This field defaults to 100. The maximum allowed value for this field is 500."
    • addedInput schema / properties / maxResults / format
      Added value: +"uint32"
    • changedInput schema / properties / pageToken / description
      Previous value: -"Page token to retrieve a specific page of results in the list."New value: +"[query parameter] Page token to retrieve a specific page of results in the list."
    • changedInput schema / properties / q / description
      Previous value: -"Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, `\"from:someuser@example.com rfc822msgid: "New value: +"[query parameter] Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, `\"from:someuser@example.com rfc822msgid: "
    • addedInput schema / properties / userId / default
      Added value: +"me"
    • changedInput schema / properties / userId / description
      Previous value: -"The user's email address. The special value `me` can be used to indicate the authenticated user."New value: +"[URL path segment] The user's email address. The special value `me` can be used to indicate the authenticated user."
    • changedOutput schema / (root)
      Previous value: -nullNew value: +{
      +  "properties": {
      +    "nextPageToken": {
      +      "type": "string"
      +    },
      +    "resultSizeEstimate": {
      +      "type": "integer"
      +    },
      +    "threads": {
      +      "items": {
      +        "properties": {
      +          "historyId": {
      +            "type": "string"
      +          },
      +          "id": {
      +            "type": "string"
      +          },
      +          "messages": {
      +            "items": {
      +              "properties": {
      +                "classificationLabelValues": {
      +                  "items": {
      +                    "properties": {
      +                      "fields": {
      +                        "items": {
      +                          "type": "object"
      +                        },
      +                        "type": "array"
      +                      },
      +                      "labelId": {
      +                        "type": "string"
      +                      }
      +                    },
      +                    "type": "object"
      +                  },
      +                  "type": "array"
      +                },
      +                "historyId": {
      +                  "type": "string"
      +                },
      +                "id": {
      +                  "type": "string"
      +                },
      +                "internalDate": {
      +                  "type": "string"
      +                },
      +                "labelIds": {
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "payload": {
      +                  "properties": {
      +                    "body": {
      +                      "type": "object"
      +                    },
      +                    "filename": {
      +                      "type": "string"
      +                    },
      +                    "headers": {
      +                      "items": {
      +                        "type": "object"
      +                      },
      +                      "type": "array"
      +                    },
      +                    "mimeType": {
      +                      "type": "string"
      +                    },
      +                    "partId": {
      +                      "type": "string"
      +                    },
      +                    "parts": {
      +                      "items": {
      +                        "type": "object"
      +                      },
      +                      "type": "array"
      +                    }
      +                  },
      +                  "type": "object"
      +                },
      +                "raw": {
      +                  "type": "string"
      +                },
      +                "sizeEstimate": {
      +                  "type": "integer"
      +                },
      +                "snippet": {
      +                  "type": "string"
      +                },
      +                "threadId": {
      +                  "type": "string"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "snippet": {
      +            "type": "string"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

B3.2/5.0
Behavior3/5

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

With no annotations, the description carries the behavioral burden; it does disclose that this is an HTTP GET returning JSON, which implies read-only, and explains how the request body is sourced (typed params vs params map vs body_file). It omits pagination behavior, auth/quota implications, and the odd fit of body_file for a GET is left unexplained.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The purpose sentence is front-loaded and tight, but the boilerplate about request bodies and body_file is largely irrelevant for a GET endpoint and adds noise. The docs link and HTTP-method tag are fine but the body-building sentence does not earn its place here.

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?

For a straightforward list endpoint with 90% schema coverage and an output schema, the description supplies enough orientation to call it correctly. The remaining gap is that it does not clarify list semantics (pagination/result shape) but the output schema covers returns.

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

Parameters3/5

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

Schema coverage is 90%, so the baseline is 3 and the schema already documents q, labelIds, pageToken, maxResults, includeSpamTrash, and userId thoroughly. The description only adds the typed-params-over-params-map precedence rule, which is a modest increment over the schema.

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?

"Lists the threads in the user's mailbox" gives a clear verb and resource, and the sibling list (delete, get, modify, trash, untrash) confirms this is the collection-read variant. It stops short of distinguishing itself from the nearby gmail.users.messages.list, so not a 5.

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 never states when to use threads.list versus messages.list, nor when to prefer it over a search, and offers no exclusions. Enumerating sibling names is not usage guidance.

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