add_component
Add a component to a KiCad schematic by specifying its library ID and value. Auto-generates reference designators and positions if not provided.
Instructions
Add a component to the current schematic.
Creates a new component with the specified library ID, value, and optional parameters. If no reference is provided, one will be auto-generated based on the component type (e.g., R1, C1, U1). If no position is provided, the component will be auto-placed.
Args: lib_id: Library identifier (e.g., "Device:R", "Amplifier_Operational:TL072") value: Component value or part description (e.g., "10k", "100nF", "TL072") reference: Component reference designator (e.g., "R1", "U2") - auto-generated if None position: Component position as (x, y) tuple in mm - auto-placed if None rotation: Component rotation in degrees (0, 90, 180, or 270), defaults to 0 footprint: PCB footprint identifier (e.g., "Resistor_SMD:R_0603_1608Metric") ctx: MCP context for progress reporting (optional)
Returns: ComponentInfoOutput with component information, or ErrorOutput on failure
Examples: >>> # Add a resistor with auto-generated reference >>> result = await add_component( ... lib_id="Device:R", ... value="10k", ... position=(100.0, 100.0) ... ) >>> print(f"Added {result.reference}")
>>> # Add a capacitor with specific reference and footprint
>>> result = await add_component(
... lib_id="Device:C",
... value="100nF",
... reference="C1",
... position=(120.0, 100.0),
... footprint="Capacitor_SMD:C_0603_1608Metric"
... )Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| value | Yes | ||
| lib_id | Yes | ||
| position | No | ||
| rotation | No | ||
| footprint | No | ||
| reference | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |