Skip to main content
Glama

lib_audit_footprint_policies

Audit a PcbLib for footprints that break library conventions on layers, pads, courtyards, silkscreen, 3D models, and designators, reporting expected versus actual values for each deviation.

Instructions

Sweep a PcbLib and flag footprints that break the library's own conventions: inconsistent layer usage, pad rules, pin-1 markings, courtyard, silkscreen, 3D models, designator style.

For each policy dimension it learns the library's DOMINANT convention across all footprints and reports every footprint that deviates (so it works on any house style without hard-coded rules). Pass policy to pin a dimension to a required value instead, e.g. {"silk_layer": "Top Overlay", "courtyard": true}.

Each finding names the footprint, the dimension, and the expected vs actual value: enough to drive a fix, not just a report.

Designators are checked for presence, layer, height, and for sitting on the footprint's AVERAGE PAD CENTRE rather than the library origin (which is arbitrary). Tune the centring window with policy={"designator_center_tol": <mils>}.

Geometry is read with the bulk library.get_library_geometry command, which walks the library once and pages the result. A library of ~1000 footprints is one pass and a handful of round trips rather than one round trip (and one full library re-scan) per footprint.

Args: library_path: Optional .PcbLib to focus first; defaults to the focused library. policy: Optional explicit conventions to enforce; omitted dimensions are inferred from the library.

Returns {library_path, footprint_count, conventions, findings, summary}.

Input Schema

NameRequiredDescriptionDefault
policyNo
library_pathNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does well: it explains the inference algorithm (dominant convention across all footprints, deviation reporting), the designator-centring rule against average pad centre rather than library origin, and the bulk-read performance characteristic (one pass, paginated, not one re-scan per footprint). It never explicitly says the tool is read-only/no mutation, which is the remaining gap for a no-annotation tool.

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?

Front-loaded with the core action and dimension list, then mode selection, then detail. Mostly every sentence earns its place, though the paragraph on the bulk geometry command is more implementation rationale than agent-facing guidance and could be trimmed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return-value explanation is arguably redundant, but the description still notes the shape {library_path, footprint_count, conventions, findings, summary} and that findings carry expected vs actual values. Combined with the mode explanation and parameter guidance, an agent has enough to call this correctly; only the exhaustive policy key list is missing.

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 coverage is 0% and both parameters are free-form (policy is an open object), so the description must compensate and largely does: it explains `library_path` semantics (optional .PcbLib to focus, defaults to focused library) and gives concrete policy keys with example values ({"silk_layer": "Top Overlay", "courtyard": true}, {"designator_center_tol": <mils>}). It does not enumerate the full accepted key set, leaving some guesswork for the open object.

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?

Opens with a specific verb+resource ('Sweep a PcbLib and flag footprints') and immediately enumerates the policy dimensions checked (layer usage, pad rules, pin-1 markings, courtyard, silkscreen, 3D models, designator style). This clearly separates it from sibling audits that compare against an external reference (lib_audit_footprint_vs_datasheet, lib_audit_footprint_vs_package) because it explicitly audits against the library's own learned conventions.

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?

States the two operating modes precisely: by default it infers the dominant convention, and passing `policy` pins a dimension to a required value. Also clarifies that `library_path` defaults to the focused library. It never names an alternative sibling tool or says when not to use it, so it stops short of the top score.

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