Skip to main content
Glama

update_symbols_from_library

Update placed symbols from their library symbols, as "Update Symbols from Library" of the schematic editor of KiCad 10 does it.

Instructions

Update placed symbols from their library symbols, as "Update Symbols from Library" of the schematic editor of KiCad 10 does it.

Each matching symbol gets the library symbol of its library ID (from the global and the project symbol library tables, flattened): the new shape and pins, the keywords and the footprint filters (always, as the dialog). The fields, the attributes and the alternate pins follow the options, with the defaults of the dialog. The library symbol is the text of a save in kicad-cli, as KiCad loads it: kicad-cli saves each library symbol with its parents one time (about 0.2 s), and again after a change of their text; a cache keeps the last 256 saves.

The pins follow the new library symbol (SCH_SYMBOL::UpdatePins): a pin keeps its UUID when the library symbol has its number; a new pin gets a new UUID, and a pin that the library symbol does not have goes. KiCad makes random UUIDs, and the order of a new pin comes from the memory: the tool uses the order of the placed pins in the file and of the library pins in the save of KiCad.

The fields of the update (fields): with no list, the dialog defaults: Footprint, Datasheet and Description, and each user field of the matching symbols and of their library symbols; not Reference and not Value. A private field is always updated. The position of a field (update_field_positions, and a new field) is the position of the symbol plus the position of the library field, rotated and mirrored as the symbol (SCH_FIELD::GetPosition). A user field of the library that the symbol does not have becomes a new field.

The tool refuses these updates:

  • A match with no symbol, or a field name that the dialog does not list.

  • A library ID that is not valid, or that the libraries do not have. A library symbol with fewer units than the symbol.

  • A symbol with no mandatory field (Reference, Value, Footprint, Datasheet or Description), with two fields of one name, or with a field or a library ID that the load changes (a field of the simulation of KiCad 7, "{slash}"): KiCad 10 never writes them (open and save the file in KiCad).

  • A symbol with fields_autoplaced and update_field_positions: KiCad places the fields with the sizes of its font, which the tool cannot measure.

  • A match that has only some instances of a symbol of a shared sheet.

  • A new reference for a sheet path with no instance in the file (KiCad makes the instance), or for two sheet paths that KiCad sorts by a hash.

  • A match that leaves an old copy of the library symbol with the same name and an other text in the file: a copy of an other symbol (add those symbols to the match), or a copy that no symbol uses. KiCad makes a copy with an other name when it finds the two symbols different. The tool compares only the texts, thus it can refuse a copy that KiCad finds equal.

"Update/reset pin name/number visibilities" changes nothing in the file: the update replaces the copy of the library symbol that holds it.

The tool checks all symbols and all files first, and writes no file when a check fails. It writes all files or no file. KiCad must not have the files open. The installed KiCad must be KiCad 10.0.

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": {
      "schematic_path": "<schematic_path>"
    },
    "name": "update_symbols_from_library"
  }
}

Input Schema

NameRequiredDescriptionDefault
matchNo"all" (each symbol), "reference" or "value" (pattern with "*" and "?", no case), or "lib_id" (pattern is "<library>:<symbol>").all
fieldsNoThe names of the fields to update, or none for the dialog defaults. The names of the user fields have case.
optionsNoThe update options of the dialog; a missing option has the default of the dialog.
patternNoThe text of the match "reference", "value" or "lib_id".
schematic_pathYesA .kicad_sch file of the project. The tool finds the symbols in the full project.

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.0

TDQS

A4/5.0
Behavior5/5

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

With no annotations, the description carries the full burden and does so thoroughly: it discloses atomic all-or-nothing writes, that no file is written when a check fails, the requirement that KiCad not have files open, the KiCad 10.0 requirement, UUID assignment and pin-ordering behavior, and a 256-entry save cache. It also enumerates refuse conditions in detail, which is exactly the behavioral context an agent needs for a destructive update.

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

Conciseness3/5

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

The purpose is front-loaded and the refuse conditions are bulleted, which helps, but the prose is dense, non-native, and verbose, with parenthetical C++ references and some hard-to-parse sentences. Much of the length is justified by complexity, yet a meaningful portion could be tightened without losing information.

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?

For a high-complexity, destructive, environment-dependent operation, the description covers preconditions, atomicity, failure modes, and KiCad-version constraints, and an output schema exists so return values need not be explained. Nothing an agent needs to invoke it safely appears to be 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 baseline is 3, but the description adds real meaning beyond the schema: it explains what an empty 'fields' value expands to (Footprint, Datasheet, Description plus user fields, excluding Reference and Value), that private fields are always updated, and how update_field_positions interacts with fields_autoplaced. The match/pattern semantics are left to the schema, which is fine given its coverage.

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 description states a specific verb and resource (update placed symbols from their library symbols) and anchors it to the KiCad 10 "Update Symbols from Library" dialog, so the operation is unambiguous. It does not, however, contrast itself with adjacent tools such as check_library_links or check_symbol_fields, so an agent gets no sibling differentiation.

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 is implied rather than stated: the tool is the schematic-editor dialog's equivalent, and the long 'refuses these updates' list defines the preconditions under which it will not run. There is no explicit when-to-use / when-to-prefer-an-alternative guidance, so an agent must infer the appropriate context.

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