Skip to main content
Glama

undo_bulk_modify

DestructiveIdempotent

Revert a bulk label change exactly by applying the undo plan returned by bulk_modify; pass steps unchanged to restore lost labels, remove added labels, and optionally verify results.

Instructions

Revert a bulk_modify exactly, from the undo plan it returned (bulk_modify with undo:true). Pass steps unchanged: each step adds back the labels its messages lost and takes off the labels they gained, so a message that was already in the target state before the bulk change is left alone. Steps name labels by id, as the plan does; a label name is refused, because an unknown name would be created rather than restored. The plan restores the state read just before the bulk change. A label changed by hand since then is changed again by the undo, and a label deleted since then makes its step fail — reported in failed, the other steps still run. A label the bulk change created stays in the mailbox, empty. Set verify:true to read the labels back afterwards — one read per affected thread, however many steps name it. USE WHEN: the user wants a bulk change taken back, and the bulk_modify result carried undo. DO NOT USE: without a plan from bulk_modify (use bulk_modify or modify_labels), or to change labels in a new way — this applies exactly the steps it is given. SIDE EFFECTS: label changes on the listed messages; reversible again by the inverse.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "steps": "<steps>"
    },
    "name": "undo_bulk_modify"
  }
}

Input Schema

NameRequiredDescriptionDefault
stepsYes
verifyNo

Output Schema

NameRequiredDescriptionDefault
failedYes
verifiedNo
submittedMessagesYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.32.0
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
  2. Changed2 schema fields changedv0.25.0
    • removedInput schema / additionalProperties
      Removed value: -false
    • removedInput schema / properties / steps / items / additionalProperties
      Removed value: -false
  3. Addedv0.23.0

TDQS

A4.4/5.0
Behavior3/5

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

Annotations already declare destructiveHint=true, idempotentHint=true and readOnlyHint=false, so the mutation profile is known; the description nonetheless adds real context: precedence rules for messages already in the target state, failure of a step whose label was deleted (reported in `failed`, other steps continue), empty labels left behind, and the read cost of verify. However, no annotation contradiction: label changes are consistent with destructive=true and re-application of the same steps is consistent with idempotent=true, though 'reversible again by the inverse' is not strictly the same as idempotence.

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 with the core rule, then structured by USE WHEN / DO NOT USE / SIDE EFFECTS, and every clause carries a real constraint. The prose is dense in long multi-clause sentences, so it is efficient rather than elegant.

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 mutation tool with an output schema already covering returns, the description supplies everything an agent needs to call it correctly: where the plan comes from, not to author steps, id-only labels, and what happens to steps that fail.

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

Parameters4/5

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

With 0% schema coverage, the description carries the load and does well: it defines `steps` as an opaque plan to pass unchanged, mandates label ids over names with the reason (an unknown name would be created), and explains `verify` behavior and cost. It leaves the nested add/remove/messageIds/threadIds fields to inference, which keeps it short of a 5.

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 and resource ('Revert a bulk_modify exactly') and pins the source of truth ('from the `undo` plan it returned'), which separates it cleanly from bulk_modify and modify_labels without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

Explicit USE WHEN / DO NOT USE blocks: it says to use it only when the bulk_modify result carried `undo`, and names the alternatives (bulk_modify or modify_labels) for the cases where no plan exists or a new label change is intended.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.