Skip to main content
Glama

lib_redraw_assembly

Redraw assembly drawings for selected PCB footprints from body, pad, or courtyard geometry, replacing misplaced or missing layer content and adding designator text.

Instructions

Draw the assembly layer of the focused PCB library again from each footprint's own geometry: a rectangle round the part and a .Designator in its middle.

Libraries collected over the years carry the assembly drawing on the wrong layer, from another package, or not at all. With replace (the default) each footprint's tracks, arcs, texts, fills and regions on layer are cleared first; 3D bodies and pads on that layer are never touched.

Args: layer: The mechanical layer the assembly drawing goes on. footprint_names: Only these footprints. Empty means all. outline_from: What the rectangle goes round. body (the 3D bodies), pads (their copper, without mask expansion), courtyard (whatever is drawn on courtyard_layer), or auto (bodies, then the courtyard when courtyard_layer is given, then pads). A footprint with none of them is skipped and named in skipped. courtyard_layer: The layer the courtyard is drawn on. It cannot be layer itself with replace, which would clear the courtyard. width: Line width. Default 4 mil (0.1 mm). designator: Place a .Designator text in the middle, turned upright in a box taller than wide. text_height: Text height. 0 sizes it to a third of the box's short side, kept short enough for a four-character designator to fit along the long side, between 0.2 and 1 mm. replace: Clear what is on the layer first. With False the new drawing goes beside what is there. confirm: Required with replace, since it clears that layer in every footprint it redraws. units: "mil" (default) or "mm" for width and text_height.

The footprint on screen is shown again at the end. Does NOT save the library. A mechanical layer the library has not enabled is accepted, with layer_enabled false and a warning, since Altium does not draw what is on it.

Returns: Dict with layer, layer_enabled, redrawn, cleared, skipped, not_found, and items ({name, outline_from, cleared, width_mm, height_mm} per footprint drawn).

Input Schema

NameRequiredDescriptionDefault
layerYes
unitsNomil
widthNo
confirmNo
replaceNo
designatorNo
text_heightNo
outline_fromNoauto
courtyard_layerNo
footprint_namesNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations present, the description carries the full burden and does so: it discloses that 'replace' clears tracks, arcs, texts, fills and regions on the layer, that 3D bodies and pads are never touched, that 'confirm' is mandatory whenever replace is used, that the library is NOT saved, and that a disabled mechanical layer is accepted with layer_enabled false plus a warning. These are exactly the destructive/side-effect details an agent needs before invoking.

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 lead sentence front-loads the operation and the rest is organized as a scannable Args block, so it reads well. It runs long, and a few clauses (the text-height sizing formula, the returns field list) restate detail an agent may not need before calling, though none is genuinely wasteful.

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 10-parameter destructive library mutation, the description covers preconditions (confirm), irreversible effects (clearing the layer), failure modes (skipped/not_found footprints, disabled layer warning), and post-state (footprint re-shown, library unsaved). The Returns block slightly duplicates the output schema but leaves nothing an agent needs missing.

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% across 10 parameters, so the description must compensate entirely, and it does: each of layer, footprint_names, outline_from (with all four enum-like values and the auto fallback order), courtyard_layer (including the replace conflict), width, designator, text_height (default sizing rule and 0.2–1 mm clamp), replace, confirm, and units is explained with defaults and edge cases.

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 opening sentence gives a precise verb and resource ('Draw the assembly layer of the focused PCB library again') plus the exact output of the operation (a rectangle around the part plus a '.Designator' centered in it). An agent can distinguish this from lib_move_bodies_to_layer or pcb_copy_designators_to_mech without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It states the problem context that motivates the call ('libraries carry the assembly drawing on the wrong layer, from another package, or not at all'), which tells an agent when to reach for it, and it defines the replace-vs-append behavior. It stops short of naming a sibling alternative or an explicit 'do not use when' condition, so it is clear but not fully routing.

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