Skip to main content
Glama

gmail.users.history.list

Lists mailbox change history to synchronize Gmail clients, returning chronological records filtered by label, type, or start history ID.

Instructions

Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing historyId). For more information, see Synchronize clients with Gmail [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

Input Schema

NameRequiredDescriptionDefault
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.
labelIdNo[query parameter] Only return messages with a label matching the ID.
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 history records to return. This field defaults to 100. The maximum allowed value for this field is 500.100
historyTypesNo
startHistoryIdNo[query parameter] Required. Returns history records after the specified `startHistoryId`. The supplied `startHistoryId` should be obtained from the `historyId` of a message, thre

Output Schema

NameRequiredDescriptionDefault
historyNo
historyIdNo
nextPageTokenNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed11 schema fields changed
    • changedInput schema / properties / historyTypes / items / description
      Previous value: -"History types to be returned by the function"New value: +"[query parameter] History types to be returned by the function Values: `messageAdded` = ; `messageDeleted` = ; `labelAdded` = ; `labelRemoved` = ."
    • changedInput schema / properties / labelId / description
      Previous value: -"Only return messages with a label matching the ID."New value: +"[query parameter] Only return messages with a label matching the ID."
    • addedInput schema / properties / maxResults / default
      Added value: +"100"
    • changedInput schema / properties / maxResults / description
      Previous value: -"Maximum number of history records to return. This field defaults to 100. The maximum allowed value for this field is 500."New value: +"[query parameter] Maximum number of history records 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 / startHistoryId / description
      Previous value: -"Required. Returns history records after the specified `startHistoryId`. The supplied `startHistoryId` should be obtained from the `historyId` of a message, thre"New value: +"[query parameter] Required. Returns history records after the specified `startHistoryId`. The supplied `startHistoryId` should be obtained from the `historyId` of a message, thre"
    • addedInput schema / properties / startHistoryId / format
      Added value: +"uint64"
    • 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": {
      +    "history": {
      +      "items": {
      +        "properties": {
      +          "id": {
      +            "type": "string"
      +          },
      +          "labelsAdded": {
      +            "items": {
      +              "properties": {
      +                "labelIds": {
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "message": {
      +                  "properties": {
      +                    "classificationLabelValues": {
      +                      "items": {
      +                        "type": "object"
      +                      },
      +                      "type": "array"
      +                    },
      +                    "historyId": {
      +                      "type": "string"
      +                    },
      +                    "id": {
      +                      "type": "string"
      +                    },
      +                    "internalDate": {
      +                      "type": "string"
      +                    },
      +                    "labelIds": {
      +                      "items": {
      +                        "type": "string"
      +                      },
      +                      "type": "array"
      +                    },
      +                    "payload": {
      +                      "type": "object"
      +                    },
      +                    "raw": {
      +                      "type": "string"
      +                    },
      +                    "sizeEstimate": {
      +                      "type": "integer"
      +                    },
      +                    "snippet": {
      +                      "type": "string"
      +                    },
      +                    "threadId": {
      +                      "type": "string"
      +                    }
      +                  },
      +                  "type": "object"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "labelsRemoved": {
      +            "items": {
      +              "properties": {
      +                "labelIds": {
      +                  "items": {
      +                    "type": "string"
      +                  },
      +                  "type": "array"
      +                },
      +                "message": {
      +                  "properties": {
      +                    "classificationLabelValues": {
      +                      "items": {
      +                        "type": "object"
      +                      },
      +                      "type": "array"
      +                    },
      +                    "historyId": {
      +                      "type": "string"
      +                    },
      +                    "id": {
      +                      "type": "string"
      +                    },
      +                    "internalDate": {
      +                      "type": "string"
      +                    },
      +                    "labelIds": {
      +                      "items": {
      +                        "type": "string"
      +                      },
      +                      "type": "array"
      +                    },
      +                    "payload": {
      +                      "type": "object"
      +                    },
      +                    "raw": {
      +                      "type": "string"
      +                    },
      +                    "sizeEstimate": {
      +                      "type": "integer"
      +                    },
      +                    "snippet": {
      +                      "type": "string"
      +                    },
      +                    "threadId": {
      +                      "type": "string"
      +                    }
      +                  },
      +                  "type": "object"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "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"
      +          },
      +          "messagesAdded": {
      +            "items": {
      +              "properties": {
      +                "message": {
      +                  "properties": {
      +                    "classificationLabelValues": {
      +                      "items": {
      +                        "type": "object"
      +                      },
      +                      "type": "array"
      +                    },
      +                    "historyId": {
      +                      "type": "string"
      +                    },
      +                    "id": {
      +                      "type": "string"
      +                    },
      +                    "internalDate": {
      +                      "type": "string"
      +                    },
      +                    "labelIds": {
      +                      "items": {
      +                        "type": "string"
      +                      },
      +                      "type": "array"
      +                    },
      +                    "payload": {
      +                      "type": "object"
      +                    },
      +                    "raw": {
      +                      "type": "string"
      +                    },
      +                    "sizeEstimate": {
      +                      "type": "integer"
      +                    },
      +                    "snippet": {
      +                      "type": "string"
      +                    },
      +                    "threadId": {
      +                      "type": "string"
      +                    }
      +                  },
      +                  "type": "object"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          },
      +          "messagesDeleted": {
      +            "items": {
      +              "properties": {
      +                "message": {
      +                  "properties": {
      +                    "classificationLabelValues": {
      +                      "items": {
      +                        "type": "object"
      +                      },
      +                      "type": "array"
      +                    },
      +                    "historyId": {
      +                      "type": "string"
      +                    },
      +                    "id": {
      +                      "type": "string"
      +                    },
      +                    "internalDate": {
      +                      "type": "string"
      +                    },
      +                    "labelIds": {
      +                      "items": {
      +                        "type": "string"
      +                      },
      +                      "type": "array"
      +                    },
      +                    "payload": {
      +                      "type": "object"
      +                    },
      +                    "raw": {
      +                      "type": "string"
      +                    },
      +                    "sizeEstimate": {
      +                      "type": "integer"
      +                    },
      +                    "snippet": {
      +                      "type": "string"
      +                    },
      +                    "threadId": {
      +                      "type": "string"
      +                    }
      +                  },
      +                  "type": "object"
      +                }
      +              },
      +              "type": "object"
      +            },
      +            "type": "array"
      +          }
      +        },
      +        "type": "object"
      +      },
      +      "type": "array"
      +    },
      +    "historyId": {
      +      "type": "string"
      +    },
      +    "nextPageToken": {
      +      "type": "string"
      +    }
      +  },
      +  "type": "object"
      +}
  2. First observed

TDQS

A3.5/5.0
Behavior3/5

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

With no annotations, the description does carry useful behavioral facts: [HTTP GET] implies read-only, results are chronological by increasing historyId, and the body/params precedence rule is stated. It omits the traits that actually matter for this endpoint — that history records expire and a stale startHistoryId yields an error requiring a full resync, and that results are paginated with pageToken.

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 first two sentences are tight and front-loaded, but the trailing sentence about JSON bodies, typed flags beating the params map, and body_file is generic boilerplate repeated across the whole tool family and contributes little here. Acceptable but not lean.

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 10-parameter list endpoint this is close to right: output schema exists so return-shape detail is unnecessary, GET semantics and ordering are stated, and the schema covers parameter meaning. The missing history-expiry/pagination caveats cost it a point, but the overall picture an agent needs to call it is present.

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 description coverage is 90%, so the schema already documents startHistoryId, historyTypes, maxResults, labelId, and pageToken well. The description adds nothing parameter-specific, not even a note that startHistoryId is functionally required for meaningful output. Baseline 3 applies when the schema does the heavy lifting.

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?

It clearly states the verb (Lists) and the resource (history of all changes to the given mailbox), and adds the incremental-sync framing with ordering by increasing historyId, so an agent knows this is a change-log reader rather than a message reader. It does not explicitly distinguish itself from gmail.users.messages.list or drive.changes.list, so a 4 rather than 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 Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Usage is implied through the link to the 'Synchronize clients with Gmail' guide, which signals the incremental-sync scenario, but the description never says when to use this versus a full messages.list, or what prerequisite (a recent historyId) makes it valid. No explicit exclusions or alternative-tool routing.

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