add_library_to_table
Add a KiCad library that exists to the project library table, as the table dialog of KiCad 10 does.
Instructions
Add a KiCad library that exists to the project library table, as the table dialog of KiCad 10 does.
The library must be of the KiCad format: a .kicad_sym file or a folder with .kicad_sym files (symbols), a folder with .kicad_mod files (footprints). The tool refuses other formats. A nickname that the project table has is an error. A nickname of the global table gives a warning: the project row hides the global library. A library of an older file version gives a warning with the step for its upgrade; a library of a newer file version is an error. KiCad must not have the project open. The installed KiCad must be KiCad 10.0.
The URI of the new row has a path variable of KiCad when its folder holds the library (the variable with the most folder levels), else ${KIPRJMOD} when the project folder holds it, else the absolute path (NormalizePath). As the table dialog, the tool writes some characters of the nickname as escapes, for example ":" as "{colon}".
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": {
"project_path": "<project_path>",
"kind": "<kind>",
"library_path": "<library_path>"
},
"name": "add_library_to_table"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | Yes | "symbol" or "footprint". | |
| nickname | No | The nickname in the table. Default: the name of the library with no extension, as KiCad gives it. | |
| description | No | The description of the row. | |
| library_path | Yes | The library file or folder: an absolute path, or a path relative to the project folder. | |
| project_path | Yes | The .kicad_pro file or the project folder. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |