Skip to main content
Glama

gmail.users.messages.batchDelete

Deletes multiple Gmail messages by ID in one batch request for bulk cleanup, removing specified messages without individual delete calls.

Instructions

Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all [HTTP POST] — creates or triggers a change; refused under --readonly safety profiles. Returns the API's response resource as JSON — request body is a JSON BatchDeleteMessagesRequest object accepting ids; pass it via params or whole via body_file Siblings over the same resource: batchModify, delete, get, import, insert, list, modify, send, trash, untrash.

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.
body_fileNoRead the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON BatchDeleteMessagesRequest object.
request_bodyNoRequest body of type BatchDeleteMessagesRequest: pass it via `params` (merged into the built body) or whole via `body_file`.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / body_file / description
      Previous value: -"Read the request body from this file ('-' for stdin) instead of building one from the parameters."New value: +"Read the request body from this file ('-' for stdin) instead of building one from the parameters. The body is a JSON BatchDeleteMessagesRequest object."
    • addedInput schema / properties / request_body
      Added value: +{
      +  "description": "Request body of type BatchDeleteMessagesRequest: pass it via `params` (merged into the built body) or whole via `body_file`.",
      +  "properties": {
      +    "ids": {
      +      "items": {
      +        "type": "string"
      +      },
      +      "type": "array"
      +    }
      +  },
      +  "type": "object"
      +}
  2. Changed2 schema fields changed
    • 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."
  3. First observed

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations, the description carries the burden well: it discloses that it is a mutating POST, that deletion is not verified against prior existence (idempotency caveat), that readonly profiles reject it, and that the response is the raw API resource. It stops short of naming required OAuth scopes or confirming permanence vs. trash semantics.

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-loads the destructive action and the non-existence caveat, then the failure mode, then the body contract. The [HTTP POST] tag and full sibling roster are low-value boilerplate but do not obscure the essentials.

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 6-parameter destructive mutation with no annotations and no output schema, the description covers mutation semantics, failure conditions, body shape and return type. Only scope/permission requirements and permanence are unaddressed, which is a minor gap given the 100% schema coverage.

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 100%, so the schema already documents userId, params, body_file and the nested ids body. The description restates the body type and the params/body_file routing rather than adding new meaning, so baseline 3 applies.

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?

Opens with a specific verb+resource+scale: "Deletes many messages by message ID", which distinguishes it from single-message delete. The sibling roster names delete/trash/batchModify so an agent can orient, but the description never explicitly contrasts itself with those alternatives beyond listing them.

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?

Gives one useful conditional -- "refused under --readonly safety profiles" -- which tells the agent when the call will fail. It does not say when to pick this over messages.delete or messages.trash, leaving that inference to the agent.

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