Skip to main content
Glama

pcb_calc_trace_width_for_impedance

Calculate trace width needed to hit a target impedance (like 50 Ω single-ended or 100 Ω differential) for microstrip or stripline geometries, inverting IPC-2141 closed forms to find the width.

Instructions

Trace WIDTH to hit a target impedance (inverse of pcb_calc_impedance).

The design-time complement: instead of "what impedance does this width give?", it answers "I need 90 ohm USB / 100 ohm HDMI differential, or 50 ohm single-ended; how wide?". Inverts the same IPC-2141 / Wadell closed forms, so it round-trips with the forward calc. Pure math, no Altium. Same +/-10 % caveat -- a fab field solver refines the stackup; read the real dielectric heights / er with pcb_get_layer_stackup.

Args: target_ohms: Single-ended Z0 for microstrip/stripline, or the differential Zdiff for microstrip_diff/ stripline_diff. geometry: One of microstrip, microstrip_diff, stripline, stripline_diff. dielectric_height_mils: Trace-to-plane height (microstrip) or full between-plane thickness (stripline). dielectric_constant: er (default 4.2 FR-4). copper_oz: Copper weight for trace thickness (default 1.0). spacing_mils: Edge-to-edge gap (required for *_diff).

Returns: {"ok": True, "width_mils", "single_ended_z0_ohms", "feasible", ...} (feasible False when the target needs a width <= 0: raise the dielectric height or lower the target), or {"ok": False, ...}.

Input Schema

NameRequiredDescriptionDefault
geometryYes
copper_ozNo
target_ohmsYes
spacing_milsNo
dielectric_constantNo
dielectric_height_milsYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4.9/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 so: 'Pure math, no Altium' tells the agent it does not mutate the PCB document (critical in a suite where nearly everything else writes), it discloses the +/-10% accuracy limit and that a fab field solver refines the stackup, and it spells out the failure mode (feasible=False when width would be <= 0, plus the remedy).

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 core purpose and scope in the first two lines, and the Args block is justified by zero schema coverage. The Returns block partially restates the existing output schema, so a little length is redundant, though the feasible=False guidance is behavioral rather than schema-derived.

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 6-parameter, 3-required numeric calculator with no annotations, everything an agent needs is present: parameter meanings, unit conventions, validity caveats, the failure case, and which sibling tool supplies trustworthy inputs. An output schema exists, so return-value detail is a bonus rather than a gap.

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% and the schema has no enum for geometry, so this is where the description earns its keep: it enumerates the four geometry values, explains that target_ohms means Z0 for single-ended but Zdiff for *_diff variants, distinguishes trace-to-plane vs between-plane meaning of dielectric_height_mils, and flags spacing_mils as required for *_diff despite its schema default of 0.

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?

Opens with a specific verb+resource+goal: 'Trace WIDTH to hit a target impedance', immediately qualified as the 'inverse of pcb_calc_impedance'. That single parenthetical distinguishes it from the forward-calc sibling in a suite with ~300 tools.

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?

Frames the exact usage scenario ('design-time... I need 90 ohm USB / 100 ohm HDMI differential, or 50 ohm single-ended; how wide?') and names the alternative it inverts (pcb_calc_impedance). It also prescribes a prerequisite step: read real dielectric heights/er via pcb_get_layer_stackup rather than relying on defaults.

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