Skip to main content
Glama

pcb_auto_place_force_directed

Optimize PCB component placement with a force-directed spring-embedder algorithm based on net connectivity. Get computed X/Y positions to apply as placement suggestions.

Instructions

Run a force-directed spring-embedder placement algorithm on a set of components.

This tool computes optimised X/Y positions for components based on their net connectivity without requiring KiCad to be open. Use it to get a placement suggestion, then apply the result with pcb_move_footprint for each component.

Args: component_positions: List of component dicts with keys: ref (str), x (float, mm), y (float, mm), w (float, mm, optional default 2), h (float, mm, optional default 2), fixed (bool, optional default false). nets: List of net dicts with keys: name (str), refs (list[str]), weight (float, optional default 1.0). board_width_mm: Soft boundary width in mm (default 100). board_height_mm: Soft boundary height in mm (default 80). iterations: Number of spring-embedder iterations (default 300). k_spring: Spring attraction coefficient (default 0.4). k_repel: Coulomb repulsion coefficient (default 80.0).

Returns: JSON string with optimised positions for each component.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
netsYes
k_repelNo
k_springNo
iterationsNo
board_width_mmNo
board_height_mmNo
component_positionsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden. It clarifies the tool is non-mutating ('computes optimised X/Y positions', 'Returns: JSON string') and does not apply changes directly, contrasting with tools that modify the board. It also notes it doesn't require KiCad to be open, but does not describe side effects or edge cases (e.g., handling of fixed components).

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

Conciseness5/5

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

The description is well-structured with a front-loaded purpose sentence, a usage note, and a clear Args section. Every sentence adds value: the intro explains the algorithm and non-KiCad benefit, the usage note directs next steps, and the Args block documents all parameters. No filler or repetition.

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

Completeness5/5

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

Given the tool's complexity (7 parameters, algorithm coefficients), the description is fully complete: it explains the input structure, the algorithm behavior, the return format, and how to apply the result. The output schema presence is supplemented by the 'Returns' line, and the lack of annotations is offset by the explicit non-mutating nature. It provides all necessary context for an agent to select and invoke the tool correctly.

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

Parameters5/5

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

The input schema has zero descriptions for its 7 parameters, but the description's 'Args' section comprehensively documents each key, including types, units, defaults, and optionality (e.g., 'w (float, mm, optional default 2)', 'fixed (bool, optional default false)'). This fully compensates for the schema gap and adds meaning beyond the raw JSON schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb+resource: 'Run a force-directed spring-embedder placement algorithm on a set of components.' It clarifies this tool only computes positions ('computes optimised X/Y positions') and does not apply them directly, explicitly pointing to pcb_move_footprint for applying results. This distinguishes it from placement tools that actually move components, such as pcb_auto_place_by_schematic.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description gives clear usage context: 'Use it to get a placement suggestion, then apply the result with pcb_move_footprint for each component.' This states when to use the tool and how to proceed, and it notes the tool works 'without requiring KiCad to be open' as a benefit. However, it does not explicitly state when not to use it or mention alternative placement algorithms.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Valxyria/kicad-mcp-pro'

If you have feedback or need assistance with the MCP directory API, please join our Discord server