Skip to main content
Glama

pt_apply_stp

Configures Spanning-Tree on a Cisco switch in the active topology, including root primary VLANs, priorities, PortFast, and BPDU Guard, with optional dry-run validation.

Instructions

Configures Spanning-Tree on a switch in the active topology.

Parameters:

  • switch: switch name in PT (e.g. "SW1").

  • mode: "rapid-pvst" (default) or "pvst".

  • root_primary_vlans: list of VLANs where this switch is root primary (generates spanning-tree vlan N root primary).

  • priority: dict {vlan_id: priority}. The priority must be 0-61440 and a multiple of 4096.

  • portfast_ports: access ports with spanning-tree portfast.

  • bpduguard_ports: ports with spanning-tree bpduguard enable.

  • dry_run: if True, only validates and returns the CLI/payload.

Example: SW1 root for VLAN 10 + portfast on Fa0/1: pt_apply_stp(switch="SW1", root_primary_vlans=[10], portfast_ports=["FastEthernet0/1"], dry_run=True)

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": {
      "switch": "<switch>"
    },
    "name": "pt_apply_stp"
  }
}

Input Schema

NameRequiredDescriptionDefault
modeNorapid-pvst
switchYes
dry_runNo
priorityNo
portfast_portsNo
bpduguard_portsNo
root_primary_vlansNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full burden, and it does disclose real behavior: the exact CLI each option generates and that dry_run only validates and returns the payload rather than applying it. It is silent on idempotency, required device state, failure modes, and whether unspecified settings are preserved.

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 one-line purpose is front-loaded, followed by a scannable parameter list and a concrete call example; every entry earns its place. The trailing example partly restates the parameter docs, which is the only redundancy.

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 7-parameter mutation tool with no annotations and an output schema, the definition covers parameter meaning, constraints, generated CLI, and a safe dry_run path. It falls short on prerequisites and error/partial-application behavior, which matter for a config-applying tool.

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 description coverage is 0%, and the description compensates fully: all seven parameters are explained, including defaults (mode="rapid-pvst"), the undocumented enum values "rapid-pvst"/"pvst", the priority range and 4096 multiple constraint, the {vlan_id: priority} key semantics, and per-parameter CLI output.

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 first sentence gives a specific verb+resource ("Configures Spanning-Tree on a switch") and scopes it to the active topology, so an agent knows exactly what changes. It does not differentiate itself from the read-only sibling pt_read_stp, leaving the agent to infer that inspection belongs elsewhere.

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 active-topology framing and the dry_run validation path hint at the intended workflow, but there is no explicit "use this when / don't use this when" and no pointer to pt_read_stp for verifying current STP state first.

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