set_symbol_fields
Writes confirmed symbol fields such as Value, MPN, and confirmation flags into KiCad schematic references, validating all changes and files before saving all or nothing.
Instructions
Write the fields of placed symbols, as KiCad writes them.
The tool writes each field into each unit of the reference (one package has one Value and one MPN). A field that the symbol does not have becomes a new field, hidden as KiCad 9 and 10 make it (a file of KiCad 8: visible; Value_Confirmed and MPN_Confirmed: always hidden). With a variant (KiCad 10), the tool writes the fields of that variant into each unit: a value equal to the field of the symbol removes the field from the variant. The tool checks all changes and all files first, and writes no file when a check fails. It writes all files or no file: an error of the disk also changes no file. KiCad must not have the files open. A schematic file of the project with an older version than the installed KiCad writes is an error: the user converts it in KiCad first (the output gives the step).
A symbol in a sheet that the hierarchy uses more than one time has one set of fields for all its references (U201 and U301): give the same fields for each of these references, or write different fields through a variant.
Use it for the fields that project_check of datasheet-lens or check_symbol_fields gives (MPN_Confirmed and Value_Confirmed for a confirmation; Value, MPN, MPN_Confirmed and Value_Confirmed for the move of the old convention), after the user confirmed them.
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>",
"changes": "<changes>"
},
"name": "set_symbol_fields"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| changes | Yes | One item for each reference (and variant): the reference, the fields by name, and the variant name (empty: the symbol). | |
| schematic_path | Yes | A .kicad_sch file of the project. The tool finds the references in the full project. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |