add_hierarchical_label
Adds a hierarchical label to a component pin in a KiCad sub-sheet, connecting its net to the matching pin on the parent sheet symbol.
Instructions
Add a hierarchical label on a pin of a component.
A hierarchical label in a sub-sheet connects its net to the pin with the same name of the sheet symbol in the parent sheet. The tool puts the label on the connection point of the pin (with the rotation and the mirror of the symbol). Make sure that the connection is in the netlist: generate_netlist.
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": {
"file_path": "<file_path>",
"reference": "<reference>",
"pin": "<pin>"
},
"name": "add_hierarchical_label"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| x | No | ||
| y | No | ||
| pin | Yes | The pin number. | |
| shape | No | The electrical type of the label: "input" (default), "output", "bidirectional", "tri_state" or "passive". ERC uses it. | input |
| file_path | Yes | The .kicad_sch file of the sub-sheet. | |
| reference | Yes | The reference of the component, for example "U1". | |
| label_name | No | The text of the label. Empty: "<reference>.<pin>" (also with x and y). | |
| snap_to_grid | No | Only for x and y. True: move the label to the nearest point of the connection grid of the project (default 1.27 mm), except on a connection point of the sheet (a pin, a wire, a label). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |