Skip to main content
Glama

app_exit_active_command

Clears a stuck active command left by a crashed handler so Altium will accept saves again. Use it to recover from refused saves that survive editor restarts.

Instructions

Close a transaction a crashed handler left open in Altium.

THE TOOL FOR "A command is currently active and save cannot be completed at this time". While that state is set, EVERY save is refused and the editor asks whether to write a copy instead.

IT SURVIVES RESTARTING THE POLLING LOOP, because the state lives in Altium's PCB server rather than in the script, and Escape in the editor does not clear it either. MEASURED on 2026-08-25: saves were being refused on a brand-new library, and the state had been left hours earlier by lib_link_3d_model faulting between PreProcess and PostProcess on an undeclared identifier. It outlived several restarts.

Every PreProcess in this bridge is paired, including on its error paths, so this is not routine cleanup: it is recovery from a handler that DIED mid-transaction. AltiumScriptCentral ships the same one-line remedy as ExitActiveCommand.vbs.

Calling it when nothing is outstanding is harmless.

It saves nothing by itself. Run app_save_all afterwards and check still_dirty.

Returns: Dict reporting whether each server accepted the unwind, plus the count of still-modified documents before and after.

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.4/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and largely meets it: it discloses that the state lives in Altium's PCB server (survives restarts), that it is not routine cleanup, that it is idempotent-safe, and that it does not itself save. It does not say what happens to the in-flight transaction's changes when the unwind occurs, which is the one behavioral fact an agent might still need.

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 critical trigger and the follow-up instruction are front-loaded and the follow-up is stated up front. However, the dated case study ('MEASURED on 2026-08-25... lib_link_3d_model faulting between PreProcess and PostProcess') and the AltiumScriptCentral/VBS aside are narrative padding that does not change how an agent calls the tool.

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

Completeness4/5

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

For a zero-parameter recovery tool with an output schema, this covers trigger, persistence, safety of a false positive, and the required post-step. The only gap is that the return value is summarized but the agent is not told what to do with per-server acceptance failures.

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

Parameters4/5

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

The tool takes zero parameters, so there is nothing for the description to disambiguate; baseline 4 applies. The description correctly conveys that invocation is unconditional and needs no arguments.

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?

Opens with a specific verb+resource ('Close a transaction') and immediately scopes it to the precise failure state ('a crashed handler left open'). It further anchors the purpose to the exact user-visible symptom ('A command is currently active and save cannot be completed'), which no sibling tool addresses.

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 an explicit trigger condition (saves being refused), an explicit non-cost for a false positive ('Calling it when nothing is outstanding is harmless'), and an explicit follow-up sequence ('Run app_save_all afterwards and check still_dirty'). It also warns that Escape and restarts do not resolve the state, so alternatives are ruled out.

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