Skip to main content
Glama

lib_create_footprint_from_package

Create a complete PcbLib footprint from a datasheet package drawing, with IPC-7351B lands, silkscreen, courtyard and height, then read the pads back to verify geometry.

Instructions

Create a COMPLETE footprint in the open PcbLib from a package drawing.

Takes the package as the datasheet draws it, not a pad list: the lands come from IPC-7351B (toe, heel and side fillets with the tolerance stack-up) for the family and density asked for. Writes the pads (rounded rectangles with their corner ratio, rotation, holes, slots, non-plated holes), paste windows over an exposed pad with the pad's own paste closed, silkscreen kept clear of the copper with a pin 1 dot, the body outline and a .Designator on the assembly layer, the courtyard, and the footprint height from the package's maximum A. Origin at the package centroid. Every length goes in millimetres, unrounded.

It then READS THE PADS BACK (lib_get_pad_geometry) and compares count, centres, sizes, rotation, shape, holes and any manual paste or mask expansion with what was sent, within one internal unit. A difference is a failure, not a warning.

DATASHEET DISCIPLINE: transcribe the package from the manufacturer's drawing fetched in this conversation, each dimension as min/nom/max with its page and figure, and name the datasheet in source. The engine sizes lands from the tolerances, so a nominal-only dimension gives a worse pattern and says so in warnings.

Args: package: the PackageSpec as an object (or its JSON text): family (chip, melf, molded, sod, sot23, sot89, sot223, dpak, soic, son, qfn, qfp, plcc, bga, lga, crystal2, crystal4, dip, header, radial, axial, to220, to92, connector, custom) and the dimensions it needs, each a number, [min, max], [min, nom, max] or {min, nom, max, cite}. Axes: two-row parts have their rows LEFT and RIGHT, so lead_span_x is the tip to tip span across them (JEDEC E) and body_y the body along them (D); lead_length is the terminal along the span (L), lead_width across it (b). Exposed pad: ep_x/ep_y. source: {document, revision, page, ref, url}. name: footprint name; default the package's name, else a generated one (e.g. SOIC-8-P1.27N). density: L, N or M (least, nominal, most). Default: the package's own, N unless it says otherwise. description: appended to the generated description, which already names the family, the standard, the density and the source. assembly_layer, courtyard_layer: mechanical layers for those roles. Empty picks them BY ROLE from the library: the layer whose kind is "Assembly Top" / "Courtyard Top", else the one whose name says so (the same reading lib_audit_footprint_policies uses). With neither, the call refuses and lists the library's layers rather than guessing a number. drafting: overrides of the drafting rules, e.g. {"silk_width": 0.15, "ep_paste_coverage": 0.6, "mask_expansion": 0.05}. A non-zero mask expansion is written to every pad; at the default 1:1 the library's design rule decides. set_height: write the footprint height (package A max) with the existing height setter.

Returns: {ok, footprint, library_path, created, layers, readback, pads, courtyard_mm, warnings, notes, ipc, steps}. ok is true only when every step succeeded and the readback matched. A failure after the footprint was created says so: the footprint exists and is incomplete.

Input Schema

NameRequiredDescriptionDefault
nameNo
densityNo
packageYes
draftingNo
set_heightNo
descriptionNo
assembly_layerNo
courtyard_layerNo

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?

No annotations are provided, so the description carries the full burden and does so thoroughly. It discloses pad construction, paste and mask behavior, silkscreen, courtyard, designator, height handling, centroid origin, millimetre units, readback verification, refusal behavior for missing layers, warnings for nominal-only dimensions, and failure semantics including incomplete footprints after partial creation.

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 and dense, but it is front-loaded with the core action and verification behavior and uses clear sections. Most sentences carry operational detail, though some prose is more elaborate than strictly necessary.

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 complex 8-parameter mutation tool with no annotations, 0% schema coverage, and an output schema, the description is highly complete. It explains inputs, generation behavior, validation, return fields, failure handling, and datasheet requirements, leaving little an agent needs to infer before calling it.

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%, so the description must compensate, and it does. It explains the package object, family list, dimension formats, axis conventions, exposed pad fields, source citation structure, name defaulting, density values and defaults, description handling, layer selection by role or name, drafting override keys, and set_height behavior.

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: create a COMPLETE footprint in the open PcbLib from a package drawing. It immediately distinguishes the approach from a pad-list tool and from generic footprint creation by explaining that lands are derived from IPC-7351B using package dimensions, density, and tolerance stack-up.

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 strong usage context: package must come from the manufacturer's drawing fetched in this conversation, dimensions must be transcribed with page/figure and named in source, and datasheet discipline is explicit. It does not explicitly route between sibling tools such as lib_create_footprint, lib_create_standard_footprint, or lib_audit_footprint_vs_datasheet, so it lacks direct when-not/alternatives guidance.

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