Skip to main content
Glama

Fewer vias, net by net

polish_vias
Destructive

After route_board and prune_vias: rip one net at a time, most vias first, route it alone around everything else at a high via price, and keep the new copper only when KiCad counts fewer vias with no new open item or DRC error (a reroute that cuts a pour into islands first gets one via per island, bridge_islands). Run run_drc and get_score afterwards; a second pass sometimes finds more.

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": "polish_vias"
  }
}

Input Schema

NameRequiredDescriptionDefault
netsNoNet names; * and ? wildcards, e.g. ["USB_D*", "+3V3"].
pairsNoRip and reroute a differential pair (_H/_L, _P/_N, +/-) together (default true: a leg rerouted alone comes back at its own length; a step that degrades a pair is never kept).
poursNoAlso polish the poured nets (default false): the pour and its stitch vias stay, the net is routed as a track tree on top, then its redundant stitch vias are pruned. A lottery: the tree that did this by accident (PCBGolf +3V3 53 -> 32) did not repeat in 2 deliberate tries.
wait_sNoSeconds to wait (default 55); a job still running comes back "running" for get_board_job.
workersNoprune workers for a poured net (default 4).
max_netsNoNets to try, most vias first (default 40).
min_viasNoOnly nets with at least this many vias (default 2).
via_costNoVia price for the lone reroute (default 60).
design_idYesThe design id returned by import_kicad_project or list_designs.
ml_optionsNo
time_budget_sNoRouter budget per net (default 120).
bridge_islandsNo
total_budget_sNoStop starting nets after this (default 1800).

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed7 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}$"
    • removedInput schema / properties / ml_options / propertyNames
      Removed value: -{
      -  "type": "string"
      -}
    • removedInput schema / properties / nets / items / maxLength
      Removed value: -200
    • removedInput schema / properties / nets / items / minLength
      Removed value: -1
    • removedInput schema / properties / nets / maxItems
      Removed value: -500
    • 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
    • removedInput schema / properties / router
      Removed value: -{
      -  "enum": [
      -    "ml",
      -    "ts"
      -  ],
      -  "type": "string"
      -}
  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. 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)."
  4. 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)."
  5. First observed

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the description's job is to add context, and it does: the acceptance/rollback rule (keep new copper only when vias drop with no new opens or DRC errors) is the key behavioral fact an agent needs. It stops short of saying what the tool returns or what happens if the whole run fails mid-way, so not a 5.

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?

It is one dense sentence with several parentheticals, but the ordering and the keep-condition are front-loaded and every clause carries information. Slightly run-on; splitting the post-run guidance into its own sentence would read better.

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?

For a 13-parameter mutating job tool with no output schema, the description covers workflow, safety criterion, and follow-up tools, which is most of what an agent needs. It never indicates what the result payload contains (per-net via deltas, kept/rejected nets), and there is no output schema to cover that gap.

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 description coverage is 85%, so the parameters are already well documented, and the description only loosely gestures at a few of them ('high via price' for via_cost, 'most vias first' for max_nets/min_vias ordering, the pair and pour mechanics). With that coverage the baseline of 3 is correct; the description adds framing rather than new parameter semantics.

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?

States a specific multi-step verb chain (rip one net at a time, route it alone, keep only if KiCad counts fewer vias) on a specific resource (vias, net by net), and the title plus description make it clearly distinct from prune_vias, route_board and bridge_islands. An agent can predict the effect without opening the schema.

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

Usage Guidelines5/5

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

Gives explicit preconditions (after route_board and prune_vias), explicit follow-ups (run_drc and get_score), an iteration hint (a second pass sometimes finds more), and routes the pour-island edge case to bridge_islands. This is when-to-use plus sequencing, not just context.

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