Read a PcbLib
read_pcblibReads an Altium .PcbLib file and returns its footprints with primitives (pads, tracks, arcs, etc.) as structured JSON. Use to inspect existing footprint styles or preserve data for round-trip edits.
Instructions
Read an Altium .PcbLib file and return its contents including footprints with their primitives (pads, vias, tracks, arcs, regions, fills, text, component_bodies). Returns structured data that can be used to understand existing footprint styles. All coordinates and dimensions are in millimetres (mm). Fields such as guid, unique_id, raw_tail, raw_block, raw_geometry, raw_layer_id, param_key_order and primitive_order are fidelity carriers: pass them back unchanged to write_pcblib or update_component and the rewrite is byte-identical to the source; omit them when authoring from scratch. Each footprint is the same JSON shape get_component, export_library and write_pcblib use; a list with no entries and an optional field with no value are omitted rather than empty/null. For large libraries, use component_name to fetch specific footprints, or use limit/offset for pagination.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Optional: maximum number of footprints to return, 1 or more (default: all) | |
| offset | No | Optional: skip the first N footprints, 0 or more (default: 0) | |
| compact | No | If true (default), omit per-layer pad data when stack_mode is Simple. Set to false for full output. | |
| filepath | Yes | Path to the .PcbLib file | |
| component_name | No | Optional: fetch only this footprint, by name in any case; a name the library does not hold is an error naming the available footprints |