Skip to main content
Glama

pcb_set_mech_layers

Set names, enablement and kinds for multiple mechanical layers of an open PCB board in one call, with each change read back and per-layer failures reported.

Instructions

Name, enable and kind the mechanical layers of the open BOARD.

The board counterpart of lib_set_mech_layers, which takes a library by path and refuses a PcbDoc. Without this a board could only have kinds set, one layer per call through pcb_set_mech_layer_kind, and could not be renamed at all above Mechanical16.

Every change is READ BACK. A layer whose name, enable or kind did not take is reported against that layer rather than folded into an overall pass.

PAIRED KINDS. Any kind ending in Top or Bottom is held by the layer PAIR rather than by either layer, under a shorter name with the side dropped, so "Courtyard Top" is stored as the pair kind "Courtyard". Give both sides in the same call and the two are joined and the pair given the kind. Single kinds such as "Fab Notes" need no partner.

READ THE BOARD FIRST. pcb_get_mech_layer_names reports primitive_count per layer, and a kind moved off a layer that is carrying geometry orphans that geometry from whatever resolves the layer by purpose.

Args: layers: One dict per layer. Keys: layer (required, e.g. "Mechanical13"), and any of name, enabled (bool), kind (e.g. "Courtyard Top"). A layer with none of the three is reported as nothing asked for. tidy_pairs: Remove layer pairs no kind justifies. Off by default, because it REMOVES pairs. timeout: Seconds.

Returns: Dict with document, layers (each: layer, changed, problem), changed, failed, kinds_displaced, pairs_removed, pairs_tidied and pairs_scanned_to.

Input Schema

NameRequiredDescriptionDefault
layersYes
timeoutNo
tidy_pairsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.9/5.0
Behavior5/5

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

No annotations exist, so the description carries the full burden and does: it discloses per-layer read-back verification with per-layer failure reporting rather than an aggregate pass, the paired-kind storage model (side dropped, pair held jointly), the requirement to supply both sides in one call, and the orphaning hazard when a kind moves off a layer carrying geometry. This is precisely the context an agent cannot get from the schema.

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 verb statement followed by labeled sections (PAIRED KINDS, READ THE BOARD FIRST, Args, Returns) make it scannable despite its length. Minor deduction: the sentence contrasting what a board 'could only have' without this tool is rationale the caller does not need, and the Returns block partly duplicates the output schema.

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 mutation tool with no annotations and a 0%-documented schema, the description covers preconditions, per-parameter semantics, failure semantics, destructive-option warning, and the domain trap (paired kinds / orphaned geometry). An output schema exists, so describing return keys is a convenience rather than a gap-filler.

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% and layers is an untyped object array, so the description must compensate entirely — and it does: it enumerates the allowed keys (layer required, e.g. 'Mechanical13'; name; enabled bool; kind e.g. 'Courtyard Top'), defines the empty-dict case ('reported as nothing asked for'), and explains tidy_pairs' destructive default and units for timeout.

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 triple plus resource and scope: 'Name, enable and kind the mechanical layers of the open BOARD.' It immediately names the two siblings it must be distinguished from (lib_set_mech_layers, pcb_set_mech_layer_kind) and states exactly what those cannot do, so the agent can route without opening a 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 versus named alternatives, plus a stated prerequisite workflow ('READ THE BOARD FIRST' with pcb_get_mech_layer_names) and a clear when-not/why-not for tidy_pairs ('Off by default, because it REMOVES pairs'). Nothing about selection is left to inference.

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