run_kct_handoff
Runs an allow-listed kicad-tools write command on the open KiCad board through a handoff: check session, save when allowed, enforce timeout, and reload only after a successful file change.
Instructions
Run one allow-listed kicad-tools write command (kct) on the board open in KiCad, following the handoff protocol: check the session, save the editor (allow_save=true is needed when dirty state is unknown, as on KiCad 10), run the command with a timeout, then reload the editor from the file only if the command succeeded and changed it. An edit made in KiCad while the command ran makes the reload refuse with document_dirty, and nothing is lost; discard_unsaved=true reloads anyway and discards that edit. command is an argv list without 'kct', and must contain the token {board}, which is replaced by the board's path, e.g. ["route", "{board}", "-o", "{board}"]. Board only on KiCad 10.
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": {
"command": "<command>"
},
"name": "run_kct_handoff"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| command | Yes | ||
| documents | No | ||
| timeout_s | No | ||
| allow_save | No | ||
| discard_unsaved | No |