edit_footprint
Edit a PCB footprint by setting field values, flipping between board layers, or locking/unlocking it against accidental moves. Preview changes with dry-run mode.
Instructions
Edits a footprint's properties: set a field value, change layer (flip the component to the other side), or lock/unlock it against accidental moves. Actions: 'set_field' sets a named field (requires field_name and field_value). 'set_layer' flips the component to the specified layer (requires layer). 'lock' prevents accidental moves in the GUI. 'unlock' allows moves again. This creates one undo step: Ctrl+Z reverts the edit. Use dry_run=true to preview the change without applying it. WARNING: set_layer flips the component, which may affect routing.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer | No | Target layer for the footprint. Required when action='set_layer'. Valid values: F.Cu (front), B.Cu (back). Flipping to a different side mirrors the component. | |
| action | Yes | The edit operation to perform. Valid values: 'set_field', 'set_layer', 'lock', 'unlock'. | |
| dry_run | No | If true, compute and report what would change without actually editing the footprint. Defaults to false. | |
| reference | Yes | Reference designator of the footprint to edit. Examples: U1, R1, C1, J1. Use list_footprints to discover available references. | |
| field_name | No | Name of the field to set. Required when action='set_field'. Common fields: 'Value', 'Reference', 'Footprint'. Custom fields are also supported. | |
| field_value | No | New value for the field. Required when action='set_field'. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |