Skip to main content
Glama
agent-action-gate

agent-action-gate

by dwadlane

Undo an action

undo_action
DestructiveIdempotent

Reverses an executed action when it registered an undo step, restoring the prior state and recording who performed the reversal.

Instructions

Reverses an action that ran, if it registered an undo step. Says who did it.

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": {
      "action_id": "<action_id>",
      "by": "<by>"
    },
    "name": "undo_action"
  }
}

Input Schema

NameRequiredDescriptionDefault
byYes
action_idYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3/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 reversal semantics are partly pre-established. The description adds a meaningful behavioral constraint, the requirement that an undo step was registered, but says nothing about failure modes, permissions, or side effects. The trailing 'Says who did it' is cryptic and does not clarify the response.

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

Conciseness3/5

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

The precondition is front-loaded and the description is short, but the second sentence ('Says who did it') is ambiguous and does not clearly earn its place, leaving the reader guessing whether it describes the input or the output.

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

Completeness2/5

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

This is a destructive, open-world mutation with two undocumented required parameters and no output schema, so the description carries most of the burden. It covers the core idea but omits parameter meaning, failure behavior, and what the result contains, leaving key gaps for a destructive operation.

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

Parameters2/5

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

Schema description coverage is 0%, so both action_id and by are undocumented in the schema. The description does not explain what action_id must reference or what 'by' means (an actor identity? an attribution string?), and 'Says who did it' is too vague to compensate.

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?

The description states a specific verb and object ('Reverses an action that ran') and adds a qualifying condition ('if it registered an undo step'), so an agent can distinguish it from execute_action or approve_action. It stops short of explicitly contrasting itself with any sibling, so it is clear but not fully differentiated.

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?

The clause 'if it registered an undo step' gives a real precondition for when the tool will succeed, which is a genuine usage signal. However, it offers no guidance on alternatives (e.g., when to use this vs. approving/rejecting or re-proposing) and no explicit when-not-to-use guidance.

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