Skip to main content
Glama

pcb_apply_via_template

Copies a source via's template link, hole, and diameter onto free vias, optionally filtered by net or current size, to align a board with a Routing Via rule in template mode.

Instructions

Make free vias match a source via: its via template, hole and diameter.

Point at a via that already uses the template you want (set one in Altium's Properties panel if none does), and every other free via, or those matching the filters, takes its template link, mode, hole and diameter. This is how to bring a board in line with a Routing Via rule in template mode. Altium Designer 22 or later.

The template link is copied the way Altium's own FormatCopy script does it. Diameter and hole are read back; the link has no member to read back, so check one via's template in the Properties panel afterwards. Growing vias can create clearance violations: run DRC with the rules enabled.

Args: source_x, source_y: A point on the source via, in mils. net: Only vias on this net. from_size_mils, from_hole_mils: Only vias at this size now. dry_run: Report what would change and change nothing.

Returns: source (position, size, hole, net), changed, failed, before/after counted by "diameter/hole" in mils. Refused with LOCAL_STACK for a source with a per-layer stack and NO_ANNULAR_RING for a source without a ring.

Input Schema

NameRequiredDescriptionDefault
netNo
dry_runNo
source_xYes
source_yYes
from_hole_milsNo
from_size_milsNo

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.7/5.0
Behavior5/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: it warns that growing vias can create clearance violations and instructs running DRC, notes the template link cannot be read back so must be verified in the Properties panel, and documents refusal codes LOCAL_STACK and NO_ANNULAR_RING. That is unusually rich disclosure for a mutation tool.

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, then mechanics, caveats, and Args/Returns. Most sentences earn their place, though the FormatCopy provenance sentence and the verbose Returns paragraph add some bulk that could be trimmed.

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 six-parameter mutation tool with no annotations, the description covers trigger, preconditions, filtering, safety warnings, error codes, and a return summary. Even though an output schema exists, the extra failure-mode detail is genuinely additive rather than redundant.

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?

Schema coverage is 0%, so the description must compensate, and it does: all six parameters are explained with units (source_x/source_y in mils, from_size_mils/from_hole_mils as 'only vias at this size now'), and dry_run's contract ('report what would change and change nothing') is spelled out. The filter semantics of net are also stated.

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 concrete verb and resource with scope: 'Make free vias match a source via: its via template, hole and diameter.' It is clearly distinguishable from neighboring tools like pcb_normalize_vias, pcb_place_via, or pcb_set_via_soldermask_relief because it names the exact properties propagated (template link, mode, hole, diameter) and the 'free via' target set.

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?

Gives a clear precondition ('Point at a via that already uses the template you want') and a motivating scenario ('bring a board in line with a Routing Via rule in template mode'). It stops short of explicitly naming alternatives to use instead when no template-mode rule exists or when vias are not free, so it's clear context without full exclusion guidance.

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

Deploy Server

Other Tools