Skip to main content
Glama

Read a PcbLib

read_pcblib
Read-only

Read Altium .PcbLib files and output every footprint's primitives as structured JSON in millimetres, for studying library styles or feeding a read-modify-write workflow.

Instructions

Read an Altium .PcbLib file: every footprint with its description, height and primitives (pads, vias, tracks, arcs, regions, fills, text, component_bodies) as structured JSON, all coordinates and dimensions in millimetres. Use it to study a library's footprint style or to fetch data for a read-modify-write. For one footprint whose name you know, get_component is cheaper; to find footprints by name pattern across libraries, search_components; for names alone, list_components. Each footprint is the same JSON shape get_component, export_library and write_pcblib use, so a footprint read here can be passed to write_pcblib or update_component as it is. Fields such as guid, unique_id, raw_tail, raw_block, raw_geometry, raw_layer_id, additional_parameters, param_key_order, primitive_order and storage_name are fidelity carriers: pass them back unchanged and the rewrite is byte-identical to the source; omit them when authoring from scratch. A list with no entries and an optional field with no value are omitted rather than empty or null. compact (default true) omits a pad's per-layer size and shape arrays when its stack_mode is Simple, since they only repeat the top-level values; set it false to see every layer. For a large library, page with limit and offset: the result reports total_count, returned_count, offset and has_more. component_name fetches one footprint and turns paging off.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoOptional: maximum number of footprints to return, 1 or more (default: all)
offsetNoOptional: skip the first N footprints, 0 or more (default: 0)
compactNoIf true (default), omit per-layer pad data when stack_mode is Simple. Set to false for full output.
filepathYesPath to the .PcbLib file
component_nameNoOptional: fetch only this footprint, by name in any case; a name the library does not hold is an error naming the available footprints

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A5/5.0
Behavior5/5

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

Annotations already set readOnlyHint=true and destructiveHint=false, but the description adds substantial behavioral detail: fidelity fields that must be passed unchanged for byte-identical rewrites, omission of empty lists/optional fields, compact-mode behavior for Simple stack_mode pads, and paging response metadata (total_count, returned_count, offset, has_more). These disclosures go well beyond the annotations and accurately predict output semantics.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is front-loaded with the core purpose and then logically flows through usage, alternatives, data shape, fidelity rules, omission semantics, compact flag, paging, and component_name. Every sentence contributes unique functional information; there is no filler or redundancy. Its length is justified by the tool's complexity and absence of an output schema.

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 no output schema, the description covers the return format (structured JSON, units, included primitives), fidelity requirements, empty-value handling, compact-mode output, pagination metadata, and the effect of component_name. It also points to the shared JSON shape with get_component/export_library/write_pcblib, giving the agent enough context to correctly invoke and interpret results.

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?

Even with 100% schema description coverage, the description adds real meaning: 'compact (default true) omits a pad's per-layer size and shape arrays when its stack_mode is Simple', 'component_name fetches one footprint and turns paging off', and 'page with limit and offset: the result reports total_count...' These clarify how each parameter affects behavior, not just its type.

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 description opens with a precise action and resource: 'Read an Altium .PcbLib file' and specifies the returned content (every footprint with description, height, primitives) and units. It also names sibling tools and their distinct use cases, allowing an agent to immediately differentiate read_pcblib from get_component, search_components, and list_components.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says when to use this tool ('study a library's footprint style or to fetch data for a read-modify-write') and provides clear alternatives: 'For one footprint whose name you know, get_component is cheaper; to find footprints by name pattern across libraries, search_components; for names alone, list_components.' This exceeds the minimum by giving both context and exclusion conditions.

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