Repair a library
repair_libraryRemove orphaned 3D-model data from PcbLib files by deleting unreferenced embedded models and fixing body references to missing STEP models, resolving library validation errors.
Instructions
Repair a PcbLib by removing orphaned 3D-model data: (1) embedded models not referenced by any footprint, and (2) component body references that point to non-existent models. This fixes libraries where STEP model data is missing but references remain (validate_library reports both conditions). PcbLib only; a SchLib is refused.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"filepath": "<filepath>"
},
"name": "repair_library"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | If true, report what would be fixed without making changes (default: false) | |
| filepath | Yes | Path to the library file (.PcbLib) |