Skip to main content
Glama

pcb_get_design_rules

Retrieves every design rule from the active PCB, including names, kinds, enabled status, priorities, scopes, and clearance gaps, to verify constraints and ensure compliance.

Instructions

Get all design rules from the active PCB.

Reports every rule kind, including ones this toolset cannot create, because it iterates rule objects rather than switching on a kind.

rule_kind IS AN ALTIUM ENUM ORDINAL, NOT A NAME. It is the raw integer, so it is only meaningful against the build that produced it and is not worth comparing across versions. Read descriptor instead: Altium composes it for display, so it names the kind and carries the constraint values.

A CLEARANCE-FAMILY RULE ALSO CARRIES gap_mm, read from the rule itself. Trust it over the descriptor for Board Outline Clearance, whose descriptor says Gap=0mil whatever the rule holds (measured on AD 26.10: 0.254 mm and 3 mm both described as 0). That rule's per-object table is not exposed to scripts, so a value set only in the table is visible in Design > Rules alone.

Returns: Dictionary with "rules" array (each with name, rule_kind, enabled, priority, scope_1, scope_2, comment, descriptor, and gap_mm for clearance, component, hole-to-hole and board outline clearance rules) and "count".

Input Schema

NameRequiredDescriptionDefault

No arguments

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.6.1

TDQS

A4/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 unusually well: it warns that rule_kind is a build-specific enum ordinal not to be compared across versions, that descriptor is the stable display string, that gap_mm should be trusted over the descriptor, and documents a specific Altium bug where Board Outline Clearance always reads Gap=0mil. It also flags that the per-object table is not exposed to scripts, which is exactly the kind of limitation an agent otherwise would not discover.

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 one-line purpose, then layered caveats in roughly descending importance. It runs long for a zero-argument getter, and the 'Returns' block partially duplicates the output schema, but the emphasis formatting on the enum warning is justified because misreading rule_kind would corrupt downstream reasoning.

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?

Since an output schema exists, the description need not restate return values, yet it still explains the field semantics an agent cannot infer. The only real gap is the missing routing guidance against related rule-reading tools; otherwise it is complete for a zero-parameter read.

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?

Zero parameters, so the schema baseline of 4 applies. The description does add meaning to the returned fields (rule_kind vs descriptor vs gap_mm) rather than to arguments, which is useful but sits outside this dimension.

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?

States a specific verb and resource ("Get all design rules from the active PCB") and clarifies the scope with "Reports every rule kind, including ones this toolset cannot create." That implicit breadth signal helps separate it from pcb_get_rule_properties and pcb_get_room_rules, but no sibling is named outright.

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 only implied: the note that it "iterates rule objects rather than switching on a kind" tells the agent this is the exhaustive path, but there is no explicit 'use this when... / use pcb_get_rule_properties when...' routing. For a toolset with at least three other rule-reading siblings, that omission matters.

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