Skip to main content
Glama

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

NameRequiredDescriptionDefault
xNo
yNo
pinYesThe pin number.
shapeNoThe electrical type of the label: "input" (default), "output", "bidirectional", "tri_state" or "passive". ERC uses it.input
file_pathYesThe .kicad_sch file of the sub-sheet.
referenceYesThe reference of the component, for example "U1".
label_nameNoThe text of the label. Empty: "<reference>.<pin>" (also with x and y).
snap_to_gridNoOnly 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

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.7/5.0
Behavior4/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 disclose real behavior: the label is placed on the pin's connection point, inheriting the symbol's rotation and mirror, and the netlist prerequisite is called out. It omits whether the schematic file is modified in place or what happens on failure, but the placement semantics are genuinely useful context.

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

Conciseness4/5

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

Front-loaded with the action, followed by a compact explanation of hierarchical label semantics and the netlist prerequisite. Every sentence contributes; the parenthetical about rotation and mirror is dense but relevant.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be described. For an 8-parameter mutation tool the description covers purpose, placement behavior, and a prerequisite, leaving only error handling and file-mutation semantics unstated.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 75%, so the schema already documents most parameters including label_name defaults and snap_to_grid behavior. The description adds no parameter-level detail beyond what the schema provides, so the baseline 3 applies.

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?

States a specific verb and resource ("Add a hierarchical label on a pin of a component") and explains what a hierarchical label does in a sub-sheet, which implicitly separates it from plain labels. It never names add_label or add_global_label, so the agent must infer the distinction from the semantics rather than an explicit contrast.

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?

Gives one concrete prerequisite: the connection must be in the netlist, and points to generate_netlist. It offers no guidance on when to choose this over add_label or add_global_label, nor any conditions under which it should not be used.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.