Skip to main content
Glama

Compare two libraries

diff_libraries
Read-only

Compare two Altium library files of the same type to report added, removed, and modified components plus stored stream and library stream differences.

Instructions

Compare two Altium library files and report differences. Shows added, removed, and modified components, a component counting as modified when its description, designator or count of any primitive kind differs. Each one in both files is also compared by the bytes of every stream it is stored in, so a change the model does not show is reported too: under modified as stored stream changes, or under stored_only when the compared fields are equal. Between a library and its own rewrite, a stored_only component is one the rewrite changed without being asked; between libraries saved apart, record identities differ and stored_only is expected. library_streams lists the library's own streams that differ (a PcbLib's Library/Data records its save path and time, so it differs after every save). Both files must be the same type (.PcbLib or .SchLib).

Input Schema

NameRequiredDescriptionDefault
filepath_aYesPath to the first (base/old) library file
filepath_bYesPath to the second (new/changed) library file

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.1/5.0
Behavior5/5

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

Annotations already establish readOnly and non-destructive behavior, yet the description adds substantial context: how modified is defined, why stored_only may be expected or not, and that library_streams will differ after every save because Library/Data records save path and time. This is exactly the interpretive context an agent needs beyond the safety annotations.

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?

Purpose is front-loaded in the first sentence and every subsequent sentence adds semantic detail about result categories or constraints. The middle sentences are dense and long, 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?

There is no output schema, so the description must explain what is returned, and it does: added, removed, modified, stored_only, and library_streams are all characterized, along with the critical caveat about record identities differing across libraries saved apart. Nothing essential for interpreting a diff result 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 100%, so the schema already documents filepath_a and filepath_b including the base/old vs new/changed semantics. The description adds a real constraint the schema does not state: both files must be the same type (.PcbLib or .SchLib).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The first sentence gives a specific verb and resource: compare two Altium library files and report differences. It is clearly library-level rather than component-level, which distinguishes it from compare_components, though it never names that sibling explicitly.

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

Usage Guidelines3/5

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

Usage context is implied through interpretation scenarios, e.g. a stored_only component is expected between libraries saved apart but signals an unrequested change in a rewrite. However, there is no explicit statement of when to choose this over compare_components or merge_libraries, and no clear when-not-to-use guidance.

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