Skip to main content
Glama

undo_last_head_change

Destructive

Restore a design, preset, or feature branch to its prior head from the latest head-changing reflog entry after an unwanted change.

Instructions

One-tap recovery: snap branch_id back to the old_head of its most recent head-mutating reflog entry.

Free door, tiered answer — Free: Branch · merge · cherry-pick · undo, on the designs you keep · Pro: Branch · merge · cherry-pick · undo, on every design · Business: ✓ · Enterprise: ✓.

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": {
      "artifact_type": "<artifact_type>",
      "branch_id": "<branch_id>"
    },
    "name": "undo_last_head_change"
  }
}

Input Schema

NameRequiredDescriptionDefault
operatorNoWho is making the change, recorded on the restore entry. On Kiln's servers it must match the signed-in account (a different name is refused); omitted, the signed-in account, or on a local install the local operator.
branch_idYesThe branch whose last head change to undo.
artifact_typeYesThe kind of branch: ``design``, ``preset`` or ``feature``; any other word is refused.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changedv1.5.1
    • addedInput schema / properties / artifact_type / description
      Added value: +"The kind of branch: ``design``, ``preset`` or ``feature``; any other word is refused."
    • addedInput schema / properties / branch_id / description
      Added value: +"The branch whose last head change to undo."
    • addedInput schema / properties / operator / description
      Added value: +"Who is making the change, recorded on the restore entry. On Kiln's servers it must match the signed-in account (a different name is refused); omitted, the signed-in account, or on a local install the local operator."
  2. Addedv1.5.0

TDQS

B3.3/5.0
Behavior3/5

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

With destructiveHint=true already supplied by annotations, the description usefully adds that the recovery targets the old_head of the most recent head-mutating reflog entry. It does not explain edge cases such as no qualifying reflog entry, permission failures, or what exactly is changed on the branch beyond the head pointer. The tier-availability sentence is product boilerplate rather than behavioral disclosure.

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 first sentence is front-loaded and precise about the operation. The second sentence is confusing tier marketing ('Free door, tiered answer...') that does not help an agent decide or invoke correctly, so the description is not as tight as it could be.

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 destructive undo operation, the core action and target are adequately described, and annotations already signal destructiveness. However, the description omits important operational context such as failure behavior when no head-mutating entry exists and how this tool differs from neighboring reflog and rollback tools. The tier information does not compensate for those gaps.

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 the input schema already documents operator, branch_id, and artifact_type thoroughly. The description refers to branch_id only in passing and adds no new meaning for artifact_type, operator, or accepted values. Baseline 3 is appropriate because the schema carries parameter semantics.

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 clearly states the action and target: undo the last branch head change by snapping branch_id back to the old_head of the most recent head-mutating reflog entry. It is substantially more specific than the tool name alone, though it does not explicitly distinguish itself from close siblings such as restore_from_reflog_entry or show_reflog.

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 phrase 'One-tap recovery' and the stated action imply when to use this tool: recovering the most recent branch head change. However, the description gives no explicit when-not-to-use guidance and does not mention when to choose restore_from_reflog_entry or another rollback sibling instead.

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

Deploy Server

Other Tools