Skip to main content
Glama

Roll back a multi-step unit of work

ratchet_unwind_group

Call this when a multi-step workflow fails partway and the steps that already succeeded must be undone — a booking made but not paid for, a resource created but not configured. Returns the exact compensations to perform, in the order to perform them, which is the REVERSE of the order they succeeded in. Undoing forwards can strand a step that depended on an earlier one. Ratchet does NOT perform the compensations. For each step: call ratchet_begin_effect with the step's suggested_idempotency_key and compensates_effect_id, do the real undo, then call ratchet_report_effect. Gating the undo is what stops a retry from refunding twice. Read unresolved first. If any effect in the group has an unknown outcome, STOP and resolve it before undoing anything around it. Read irreversible too: those steps succeeded and declared no way to undo themselves, so a human has to decide what to do about them. Say so plainly rather than implying the rollback was complete.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
reasonNoWhy it is being rolled back. Stored for the operator.
group_keyYesThe unit of work to roll back, e.g. "booking:trip_8812".

TDQS

A4.5/5.0
Behavior5/5

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

The annotations give only generic hints, so the description carries the behavioral burden. It reveals non-obvious facts: Ratchet does NOT perform the compensations, the order must be reverse-of-success, and unresolved or irreversible effects must be handled before undoing. This is essential context beyond the structured fields.

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

Conciseness5/5

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

The description is dense but every sentence earns its place: trigger, output, ordering rationale, non-execution warning, step sequence, and safety caveats. It is front-loaded with the when-to-use condition and structured into short, readable paragraphs.

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 tool with no output schema and minimal annotations, this description covers the full calling workflow: when to call, what it returns, what it does NOT do, how to execute each compensation, and what to check before undoing. An agent has enough information to use it correctly without additional lookups.

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 100%, so group_key and reason are already documented in the schema. The description does not add meaningful parameter-level details beyond restating the group context, so the baseline 3 is appropriate.

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?

The description opens with the exact trigger condition: a multi-step workflow fails partway and already-succeeded steps must be undone. It clearly identifies the resource (a group/unit of work) and distinguishes this tool from siblings by stating it returns compensations rather than executing them.

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

Usage Guidelines4/5

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

It explicitly says when to call this tool and provides the full follow-up sequence: read unresolved/irreversible, then call ratchet_begin_effect, perform the undo, and call ratchet_report_effect. It does not name alternative sibling tools, but the context is specific enough to prevent obvious misuse.

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.

TDQS

A4.2/5.0
Disambiguation4/5

Most tools map to clearly distinct lifecycle phases (begin/report/resolve/heartbeat) and are strongly described, but recall, group_status, and list_effects all deal with looking up past effect or workflow state and could be confused when resuming work. The use-case guidance in the descriptions mostly disambiguates them, so this is a minor rather than systemic issue.

Naming Consistency4/5

All tools share the ratchet_ prefix and snake_case, which gives a strong predictable family feel. However, some names follow verb_noun (begin_effect, resolve_effect) while others are noun phrases (effect_receipts, group_status, prevented_loss), so the pattern is consistent in style but not in grammatical form.

Tool Count5/5

Fifteen tools is at the upper end of the ideal range, but the domain is broad enough to justify every entry: effect lifecycle, lease maintenance, state inspection, circuit breakers, policies, receipts, reconciliation, rollback, and usage. Each tool fills a distinct role with no obvious redundancy.

Completeness5/5

The surface covers the full idempotency and safety lifecycle: authorize, execute, report, heartbeat, recover from indeterminate outcomes, verify with receipts, reconcile vendor truth, roll back multi-step work, and monitor budgets and policies. There are no dead ends or missing operations that would strand an agent in this domain.