Skip to main content
Glama

Write a PcbLib

write_pcblib
Destructive

Write Altium .PcbLib footprint libraries by defining pads, tracks, vias, text, and 3D bodies, with append support for updating existing libraries.

Instructions

Write footprints to an Altium .PcbLib file (set 'append': true to add to an existing library instead of replacing it). Each footprint is defined by its primitives: pads (with position, size, shape, layer), tracks, vias, fills, arcs, regions, text and component_bodies. The AI is responsible for calculating correct positions and sizes based on IPC-7351B or other standards. All coordinates and dimensions must be in millimetres (mm). A footprint authored without a '.Designator' text receives one on the Top Overlay automatically, just above its topmost pad, so every placed part shows its reference designator: supply your own to control its placement, or set 'auto_designator': false to omit it; a footprint echoed back from a read (carrying primitive_order) is never touched. The response 'bodies' array echoes each footprint's 3D body height and source; a footprint with no STEP model and no component body reports source 'none'. Set 'auto_3d_body': true to have an extruded placeholder body (default height 1.0 mm, flagged 'assumed_height': true) added to such footprints, then confirm or override it by supplying 'component_bodies' explicitly. The response also includes a 'warnings' array flagging silkscreen (overlay) tracks that overlap a pad (silk-on-pad) so you can move them clear. No text field may contain '|', the separator of Altium's record format, which cannot hold it.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
appendNoIf true, append to existing file; if false, create new file
filepathYesPath to the .PcbLib file to create/modify
footprintsYesArray of footprint definitions
auto_3d_bodyNoIf true, footprints with pads but no STEP model and no component body get a placeholder extruded 3D body (1.0 mm tall, flagged assumed_height). Default false: nothing is added unless you ask, since many footprints (fiducials, test points, mounting holes) legitimately have no body. Prefer supplying real heights via component_bodies.
auto_designatorNoIf true (default), a footprint authored without a '.Designator' text gets one on the Top Overlay just above its topmost pad, so the placed part shows its reference designator. Never applied to a footprint echoed back from read_pcblib/get_component (one carrying primitive_order): Altium's own library footprints carry no designator text, and a read-modify-write must not add primitives. Set false to author a footprint without one.

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.1.0

TDQS

A4.6/5.0
Behavior5/5

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

Annotations only signal destructiveHint=true and readOnlyHint=false, but the description discloses far more: append semantics, automatic designator insertion on Top Overlay, auto_3d_body placeholder behavior (1.0 mm, assumed_height flag), the response 'bodies' source reporting ('none' when no STEP/body), the silk-on-pad warnings array, and the '|' separator restriction. This is rich behavioral context that materially affects how the agent uses the tool and interprets results.

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 description is long but every sentence carries actionable information, from append mode to units to the '|' separator constraint. The primary verb and resource are front-loaded in the first sentence. It loses a point for being a single dense paragraph — the auto-designator, auto-3D-body, and response behavior could be separated for easier scanning — 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?

Despite having no output schema, the description covers the response contract ('bodies' array, 'warnings' array) and all critical behavioral edge cases: library replacement vs append, designator auto-placement, read-echo preservation, 3D body fallbacks, units, and the separator restriction. For a write tool of this complexity, nothing essential is missing for an agent to invoke 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 100%, so the baseline is 3, and the description adds meaningful value beyond it: it specifies that all coordinates/dimensions must be in mm, that the AI must calculate positions per IPC-7351B, and it explains the practical intent of auto_designator, auto_3d_body, and append. These details are not fully captured in the schema property descriptions, so the description genuinely supplements the schema.

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 states a specific verb and resource: 'Write footprints to an Altium .PcbLib file.' It clearly distinguishes this from the read/schlib siblings by naming the exact file type and the append-vs-replace behavior. The scope (pads, tracks, vias, fills, arcs, regions, text, component_bodies) is enumerated, leaving no ambiguity about what the tool operates on.

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 clear guidance on the key usage decision ('set append: true to add to an existing library instead of replacing it') and explains when auto_designator and auto_3d_body should be toggled, including the important read-echo exclusion (a footprint carrying primitive_order is never touched). It doesn't explicitly name sibling alternatives like write_schlib, but the context is clear enough that an agent can select this tool for PcbLib authoring without inference.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/embedded-society/altium-designer-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server