pt_apply_stp
Configures Spanning-Tree on a Packet Tracer switch, setting root-primary VLANs, priorities, PortFast, and BPDU Guard; use dry_run to validate generated CLI without deploying.
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
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | rapid-pvst | |
| switch | Yes | ||
| dry_run | No | ||
| priority | No | ||
| portfast_ports | No | ||
| bpduguard_ports | No | ||
| root_primary_vlans | No |