Skip to main content
Glama

undo_transaction

Reverse an incorrectly recorded stock transaction using its transaction ID, keeping inventory history accurate and preserving best-before dates.

Instructions

Reverse a stock transaction that should not have been recorded.

Every write tool returns a transaction_id; stock_history shows older ones. Undoing is the right way to fix a mistake — booking an opposite consume or purchase instead leaves both entries in the history and gets the best-before dates wrong.

Args: transaction_id: From a write tool's response, or from stock_history.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
transaction_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior2/5

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

No annotations are provided, so the description must carry the full burden of behavioral disclosure. It only says 'reverse' without specifying the actual effect on the transaction record, stock levels, best-before dates, or whether the operation is irreversible. It mentions best-before dates in the context of the alternative, but not the outcome of the undo itself, leaving key behavioral aspects implicit.

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?

The description is concise, begins with the primary purpose, and is front-loaded with the key point. The 'Args' section adds useful parameter context, though it is slightly redundant with the schema; however, it adds value by clarifying the source of the ID. Overall, it is efficient without waste.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter undo tool, the description covers the purpose, input source, and the reason to prefer it over alternatives. However, it stops short of describing the actual consequences of executing the undo (e.g., whether the transaction record is deleted, whether it can itself be undone, or how it affects stock and best-before dates). These details would be important for an agent to fully understand the tool's behavior.

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

Parameters5/5

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

With schema description coverage at 0%, the description fully compensates by explaining the transaction_id parameter: it is obtained from a write tool's response or from stock_history. This is crucial, as the schema provides no help, and the description gives the exact source for the value.

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 states a specific verb and resource ('Reverse a stock transaction') and clearly differentiates the tool from alternative write operations by explaining why creating opposite entries is wrong. It is unambiguous and immediately tells an agent what the tool is for.

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?

It explicitly states when to use the tool ('Undoing is the right way to fix a mistake') and when not to use it (booking an opposite consume/purchase). It also tells the agent exactly where to obtain the transaction_id (from a write tool's response or stock_history), leaving no ambiguity about the correct invocation context.

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