Skip to main content
Glama

Undo a purchase

undo_purchase
DestructiveIdempotent

Undoes a Deal Desk purchase recorded by mistake (before it is listed or sold): the card comes out of the user's SlabLineage collection and the purchase no longer counts on the Deal Desk scoreboard. Before calling, ask the user "Undo the purchase of for $? It comes out of your collection and the scoreboard." and pass confirm true after they say yes. Pass an idempotencyKey. Undoing a purchase that is already undone answers repeated true and changes nothing. If the result has alerts, show them to the user before anything else.

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": {
      "dealId": "<dealId>",
      "confirm": "<confirm>"
    },
    "name": "undo_purchase"
  }
}

Input Schema

NameRequiredDescriptionDefault
dealIdYesThe dealId of the purchase (from record_purchase).
confirmYesTrue once the user said yes to undoing this purchase; never set it before that.
idempotencyKeyNoA unique key for this record (any short text you make up once); a retry with the same key never records twice.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=true, and the description goes further by naming exactly what is reversed: the card leaves the user's SlabLineage collection and the purchase stops counting on the scoreboard. It also documents the idempotent edge case ('already undone answers repeated true and changes nothing') and mandates surfacing alerts first.

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 effect and consequence, then the confirmation protocol, then idempotency and alert handling. The quoted confirmation sentence is long but is the required script, so it earns its space; the prose is otherwise tight.

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 no-output-schema destructive mutation, the description covers prerequisites, side effects, retry semantics, the 'repeated true' return signal, and how to handle alerts. Nothing an agent needs to call it safely and correctly is missing.

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 each parameter is already documented, including dealId's origin and the idempotencyKey retry guarantee. The description adds only the exact confirmation wording and the ordering of confirm relative to the user's yes, which is largely usage guidance rather than new parameter meaning.

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 ('Undoes a Deal Desk purchase recorded by mistake') and pins the scope constraint 'before it is listed or sold', which separates it cleanly from record_purchase and from listing/sale tools. An agent knows exactly what this does without opening the 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?

Gives the triggering condition (a purchase recorded by mistake), an implicit when-not (not after it is listed or sold), and the mandatory confirmation script to ask the user before calling. The sequencing instruction 'pass confirm true after they say yes' is an explicit prerequisite, not something inferred.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources