Skip to main content
Glama

Clean up tracks and vias

cleanup_board
Destructive

Sweep the routing: zero-length and duplicate tracks, stub tracks (a free end, and everything the track touches stays joined without it), and vias that meet their net on fewer than two layers. Contact is copper overlap, as KiCad judges it. Refills the zones first so pours count as connections. Locked items stay. The board is put back if the unconnected count or the DRC errors rise. A track running on past its last junction is cut back to it (trim_overhangs). list_removed names every item that went.

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": {
      "design_id": "<design_id>"
    },
    "name": "cleanup_board"
  }
}

Input Schema

NameRequiredDescriptionDefault
refillNo
wait_sNoSeconds to wait (default 55); a job still running comes back "running" for get_board_job.
design_idYesThe design id returned by import_kicad_project or list_designs.
list_removedNo
trim_overhangsNo
dangling_tracksNo
duplicate_tracksNo
unconnected_viasNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • removedInput schema / $schema
      Removed value: -"http://json-schema.org/draft-07/schema#"
    • removedInput schema / properties / design_id / pattern
      Removed value: -"^[A-Za-z0-9_-]{8,80}$"
    • changedInput schema / properties / wait_s / description
      Previous value: -"Seconds to wait for the job (default 55). A job still running comes back with status \"running\": follow it with get_board_job. A job is allowed the time its budget asks for (time_budget_s, total_budget_s, rounds), and survives a server restart (the op starts over from its snapshot; route_board's pipeline goes on from its last finished stage)."New value: +"Seconds to wait (default 55); a job still running comes back \"running\" for get_board_job."
  2. Changed1 schema field changed
    • changedInput schema / properties / wait_s / description
      Previous value: -"Seconds to wait for the job (default 55). A job still running comes back with status \"running\": follow it with get_board_job. A job is allowed the time its budget asks for (time_budget_s, total_budget_s, rounds), and survives a server restart (the op starts over from its snapshot)."New value: +"Seconds to wait for the job (default 55). A job still running comes back with status \"running\": follow it with get_board_job. A job is allowed the time its budget asks for (time_budget_s, total_budget_s, rounds), and survives a server restart (the op starts over from its snapshot; route_board's pipeline goes on from its last finished stage)."
  3. Changed1 schema field changed
    • changedInput schema / properties / wait_s / description
      Previous value: -"Seconds to wait for the job (default 55). A job still running comes back with status \"running\": follow it with get_board_job."New value: +"Seconds to wait for the job (default 55). A job still running comes back with status \"running\": follow it with get_board_job. A job is allowed the time its budget asks for (time_budget_s, total_budget_s, rounds), and survives a server restart (the op starts over from its snapshot)."
  4. First observed

TDQS

A4.1/5.0
Behavior5/5

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

Beyond the destructiveHint=true annotation the description discloses substantive behavior: zones are refilled first so pours count as connections, locked items are preserved, overhanging tracks are trimmed, and the whole operation is transactional ('The board is put back if the unconnected count or the DRC errors rise'). The 'as KiCad judges it' note on copper contact even clarifies the connectivity model used for the stub judgment.

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?

The item list is front-loaded in the first sentence and every later sentence adds a distinct behavioral fact (refill order, locked items, rollback condition, overhang trimming, reporting). The telegraphic 'Contact is copper overlap' clause is slightly elliptical but does not waste space.

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?

For a destructive bulk-mutation tool with no output schema and low schema coverage, the description supplies the safety model (conditional rollback), the preservation rule (locked items), the interaction ordering (refill before judging connectivity), and how removed items are surfaced via list_removed. Nothing an agent needs to call this correctly without fear of silent data loss is missing.

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

Parameters4/5

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

Schema coverage is only 25%, so the description must carry the toggles, and it largely does: dangling_tracks via the stub-track clause, duplicate_tracks, unconnected_vias, refill, trim_overhangs and list_removed are each explained semantically. The gap is defaults — it never states which categories are on by default or what happens when they are false, leaving the agent to guess the baseline.

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?

The description opens with a specific verb and scope ('Sweep the routing') and enumerates exactly what classes of item are targeted: zero-length and duplicate tracks, stub tracks, and vias touching their net on fewer than two layers. This is far more precise than a restatement of the name, although it never names a sibling such as prune_vias or polish_vias to sharpen the boundary.

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?

Usage is implied by 'Sweep the routing' plus the safety note that the board is reverted if unconnected count or DRC errors rise, which tells an agent this is safe to attempt but not when to prefer it over polish_vias/prune_vias/repair_board. There is no explicit when-not guidance or alternative routing.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources