Skip to main content
Glama

app_click_menu

Invoke an Altium menu command by named path through a real menu click, so commands run reliably or return the failure reason and any dialog opened.

Instructions

Invoke ANY Altium menu command by path, by driving the menu.

Use this when app_run_menu will not do, which is more often than it looks: that tool reports success for commands it never invokes, because the process ids it dispatches cannot report failure and some of them are not real (task #83). This one clicks the actual menu, so a command either runs or the reply says why not.

PATH BY NAME. "Design|Rules...", "Tools|Update From Libraries...". Accelerator markers and a trailing ellipsis are ignored, so "Design|Rules" works too. Nested submenus work by adding levels. Names are used rather than positions because entries move with context and separators are invisible.

IT NEEDS THE FOREGROUND. Altium has no Win32 menu and its DevExpress bars expose no working accessible action, so the only thing that opens them is real input: this brings Altium to the front and briefly moves the pointer, putting it back afterwards. Every other press in this package is addressed to a window handle and depends on none of that, which is why this one is gated behind may_steal_focus and never happens by default.

THE MENU BAR IS PER EDITOR. With a board focused you get the PCB menus, with a schematic the schematic ones. Focus the matching document first, or the reply will tell you the item was not there and list what was.

WHAT HAPPENS NEXT IS NOT THIS TOOL'S JOB. Many commands open a dialog. Read it with app_list_open_dialogs; the dialog drivers handle the rest.

Args: menu_path: pipe-separated path, top level first. may_steal_focus: required to actually click anything. list_only: do not invoke. Reports the top-level menus currently on screen, which is the way to find out what this editor context offers. expect_dialog: part of the title of the dialog the command should open. Then ok means that dialog appeared; any other dialog, or none, fails and names what did open.

Returns: Dict with ok and opened (titles of dialogs that appeared); on failure reason and offered listing what that level actually contained. A path that leaves the menu open (it ended at a submenu, or the click did not land) is a failure: no command ran. A level that reads empty, or without the entry asked for, is walked once more before failing (retried); first_read then says what the first read found, and both reads are in reason when both fail.

Input Schema

NameRequiredDescriptionDefault
list_onlyNo
menu_pathYes
expect_dialogNo
may_steal_focusNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.7/5.0
Behavior4/5

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

No annotations exist, so the description carries the whole burden and does so well: it discloses focus stealing, pointer movement and restoration, the may_steal_focus gate, retry-on-empty-level behavior, what counts as failure (a menu left open means no command ran), and the offered/first_read diagnostics. It stops short only of explicit safety or reversibility framing for arbitrary menu commands, which is a minor gap rather than a missing one.

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?

Front-loaded with the purpose, then organized under scannable headings (PATH BY NAME, IT NEEDS THE FOREGROUND, THE MENU BAR IS PER EDITOR). Some passages, such as the internal task-number rationale and the DevExpress bar explanation, are longer than strictly needed, though they do justify the tool's existence.

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 complex, focus-stealing, arbitrary-command tool with a four-parameter schema that lacks field descriptions, everything an agent needs is present: path syntax, gating, context dependence, expected dialog verification, failure semantics, and diagnostics. The Returns section slightly duplicates the output schema but usefully explains what 'ok', 'offered', and 'retried' actually mean.

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?

Schema description coverage is 0%, so the description must compensate and does: menu_path syntax is given with concrete examples, rules for accelerator markers and trailing ellipses, multi-level submenu handling, and the rationale for names over positions; may_steal_focus, list_only, and expect_dialog each get behavioral meaning beyond their bare boolean/string types, including how expect_dialog changes what 'ok' means.

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+mechanism: 'Invoke ANY Altium menu command by path, by driving the menu.' It immediately distinguishes itself from the closest sibling: 'Use this when app_run_menu will not do,' and explains the sibling's failure mode (reports success for commands it never invokes). An agent can pick between the two without opening either schema.

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?

Explicit when-to-use (app_run_menu is unreliable), when-not-by-default (gated behind may_steal_focus), prerequisites (focus the matching document first because the menu bar is per editor), and handoff (dialogs are read with app_list_open_dialogs). It also names the discovery path: list_only reports what the current editor context offers.

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