Skip to main content
Glama

lib_add_footprint_regions

Add solid polygon regions to a PCB footprint in one call, with required layers and exact units, to create paste windows or filled mechanical and overlay shapes.

Instructions

Add solid polygon regions to a PcbLib footprint in ONE call.

What a footprint needs beyond pads and lines: paste windows over an exposed pad (on TopPaste, with the pad's own paste closed by a negative paste_expansion in lib_add_footprint_pads), or any filled shape on a mechanical or overlay layer.

Args: regions: list of {"layer": ..., "points": [[x, y], ...]}, three or more points each, relative to the footprint origin. The layer is REQUIRED: there is no default, because a solid shape defaulted onto copper is a short. footprint_name: footprint to write into. Empty uses the editor's current footprint; a name makes that footprint current first and refuses if it cannot. units: "mil" (default) or "mm", for every point, kept exact.

Returns: Dict with added, failed, bad_points, unknown_layers, total. A region refused here before sending is listed in refused with the reason.

Input Schema

NameRequiredDescriptionDefault
unitsNomil
regionsYes
footprint_nameNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.5/5.0
Behavior4/5

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

No annotations are present, so the description carries the full burden and largely meets it: it discloses the side effect that a named footprint is made current first and the call refuses if that fails, that regions are validated locally and refused with a reason before sending, and that units are kept exact. It does not say whether repeated calls duplicate regions or how existing regions relate to new ones, leaving a minor gap for a mutation tool.

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 batch capability and the core use case are front-loaded in the first two sentences, and the Args/Returns block is scannable. Slightly verbose in the docstring-style listing, but no sentence is filler.

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?

An output schema exists, yet the description still adds the refusal semantics ('refused' with the reason) that matter for error handling. For a three-parameter batch-add tool with a validation step, everything an agent needs to call it correctly is present.

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 coverage is 0%, so the description must compensate and does: it specifies the regions dict shape ({layer, points}), the minimum of three points, coordinates relative to the footprint origin, and why layer has no default (a solid shape defaulted onto copper is a short). It also defines footprint_name's empty-string behavior and the mil/mm unit options.

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?

States a specific verb and resource ('Add solid polygon regions to a PcbLib footprint') plus the batch scope ('in ONE call'). The second paragraph distinguishes it from sibling primitives (lib_add_footprint_pads, lib_add_footprint_track/tracks) by naming the shapes and layers it covers that those do not.

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?

Gives concrete when-to-use scenarios: paste windows over an exposed pad, or filled shapes on mechanical/overlay layers, and cross-references lib_add_footprint_pads for the complementary negative paste_expansion step. It stops short of explicit exclusions (e.g. 'do not use for copper pours / use pcb_place_polygon_rect on a board'), so the alternative-selection guidance is clear but not exhaustive.

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