Skip to main content
Glama

lib_get_footprint_primitives

Read all non-pad primitives of a PcbLib footprint—tracks, arcs, regions, fills, texts, and vias—with layers and mm coordinates from the footprint origin; pads are handled separately.

Instructions

Every non-pad primitive of one PcbLib footprint, with where it is.

Tracks, arcs, regions, fills, texts and vias, each with its layer (the name the library's stack gives it, plus layer_id), in mm from the footprint's origin: the frame the lib_add_footprint_* writers take. Pads are in lib_get_pad_geometry. Read-only. Each primitive is listed once. Altium's own iterator yields one just added to the footprint on screen twice until that footprint is shown again; the footprint writers here show it again after each write, and this read skips a repeat either way.

Args: footprint_name: The footprint name in the library. library_path: Optional .PcbLib path; defaults to the focused library.

Returns: {name, library_path, height_mm, bodies (a count), body_layers (the layer of each body), tracks [{layer, layer_id, x1, y1, x2, y2, width}], arcs [{layer, layer_id, xc, yc, r, start, end, width}], regions and fills [{layer, layer_id, x1, y1, x2, y2, area (regions)}], texts [{text, layer, layer_id, x, y, size, rotation, x1, y1, x2, y2}], vias [{x, y, diameter, hole}]}. A text's box is Altium's cached one and can lag an edit made this session.

Input Schema

NameRequiredDescriptionDefault
library_pathNo
footprint_nameYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so: it declares 'Read-only', specifies the coordinate frame (mm from the footprint's origin, matching the lib_add_footprint_* writers), and discloses the Altium iterator duplicate-yield quirk plus the mitigation ('this read skips a repeat either way'). It also flags the text-box staleness caveat, which is exactly the kind of behavioral detail an agent needs.

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?

Purpose is front-loaded in the first sentence and the Args/Returns sections are well organized. The middle paragraph on the Altium iterator quirk is slightly long, and the Returns block partially restates the existing output schema, but both earn their place as behavioral context.

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?

Given an output schema is present, the description need not document returns, yet it adds unit/frame semantics the schema cannot convey. Both parameters, the read-only nature, the dedup behavior, and the staleness caveat are all covered, leaving nothing an agent needs to call it correctly.

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?

Schema description coverage is 0%, so the description must compensate, and it does: footprint_name is 'the footprint name in the library' and library_path is 'Optional .PcbLib path; defaults to the focused library', covering both optionality and default behavior. Format details (e.g., full vs relative path) are not given, keeping it from a 5.

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 ('Every non-pad primitive of one PcbLib footprint, with where it is') and enumerates the primitive kinds covered (tracks, arcs, regions, fills, texts, vias). It explicitly excludes pads and redirects to lib_get_pad_geometry, so an agent can distinguish it from siblings 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?

The description gives a clear context for use (reading a footprint's non-pad geometry) and names the alternative for pads (lib_get_pad_geometry). It does not cover when to prefer this over related probes such as lib_probe_footprint, but the primary routing is explicit.

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