Skip to main content
Glama

pt_apply_port_security

Configures port security on a switch access port by limiting allowed MAC addresses and setting a violation action, with optional sticky learning and dry-run CLI validation.

Instructions

Configures port-security on a switch's access port.

Parameters:

  • switch: switch name in PT.

  • port: access port (e.g. "FastEthernet0/1").

  • max_mac: maximum number of allowed MACs (default 1).

  • violation: "shutdown" (default) | "restrict" | "protect".

  • sticky: if True, learns sticky MACs (mac-address sticky).

  • static_macs: static MACs in IOS aaaa.bbbb.cccc format.

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

Example: max 2 sticky MACs on SW1's Fa0/1: pt_apply_port_security(switch="SW1", port="FastEthernet0/1", max_mac=2, 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>",
      "port": "<port>"
    },
    "name": "pt_apply_port_security"
  }
}

Input Schema

NameRequiredDescriptionDefault
portYes
stickyNo
switchYes
dry_runNo
max_macNo
violationNoshutdown
static_macsNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description must carry behavioral disclosure, and it does explain the important dry_run validation mode and its "returns the CLI/payload" effect. It does not state whether the port must already exist or be an access port, whether the config is applied to the running config/startup config, or whether repeat calls are idempotent — meaningful gaps for a mutating tool with zero annotation coverage.

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?

Purpose is front-loaded in one sentence, followed by a compact parameter list and a single concrete example. Every line carries information; the only slight overhead is that the parameter list partially repeats what the schema titles already show.

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 seven-parameter mutation tool with no annotations, the definition covers the parameter semantics and the dry_run escape hatch, and an output schema exists so return values need not be described. Prerequisites (port existence, access-mode requirement) and the persistence of changes are the remaining omissions.

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?

Schema description coverage is 0%, so the description must compensate, and it largely does: all seven parameters are explained, including the port-name format ("FastEthernet0/1"), the violation enum values, static MAC IOS notation (aaaa.bbbb.cccc), and dry_run semantics. Minor misses are the schema defaults for sticky (true) and static_macs, which the description leaves out.

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?

"Configures port-security on a switch's access port" gives a specific verb (configures), resource (port-security) and scope (access port), which cleanly separates it from generic siblings like pt_set_port or pt_apply_acl. It stops short of naming which sibling to use instead when the goal is a security audit versus a security configuration change.

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?

There is no explicit when-to-use / when-not-to-use statement or routing to alternatives such as pt_audit_security or pt_apply_hardening. Usage is only implied, though the worked example ("max 2 sticky MACs on SW1's Fa0/1") does anchor a realistic scenario.

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