Skip to main content
Glama

pt_apply_hardening

Applies CLI hardening to a router or switch in the active topology, including hostname, MOTD, enable secret, local users, SSH, password encryption, and SSH-only vty access. Use dry run to validate commands.

Instructions

Hardens a router/switch in the active topology.

Applies via CLI: hostname, MOTD banner, enable secret, local users, SSH (domain-name + RSA keys + ip ssh version), service password-encryption, and restricts the vty lines to SSH with local login.

Parameters:

  • device: device name in PT.

  • hostname: new hostname (optional).

  • banner_motd: MOTD banner text (without the '#' character).

  • enable_secret: enable password (it is encrypted).

  • users: list of {username, secret, privilege?}. Needed for SSH/local login.

  • ssh: dict {domain?, modulus?, version?, enable?} to enable SSH. Requires at least one user. modulus<768 raises a warning.

  • service_password_encryption: applies service password-encryption (default True).

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

Example: full hardening of R1 with SSH: pt_apply_hardening(device="R1", hostname="R1", enable_secret="cisco123", users=[{"username":"admin","secret":"adminpass","privilege":15}], ssh={"domain":"lab.local","modulus":1024}, 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": {
      "device": "<device>"
    },
    "name": "pt_apply_hardening"
  }
}

Input Schema

NameRequiredDescriptionDefault
sshNo
usersNo
deviceYes
dry_runNo
hostnameNo
banner_motdNo
enable_secretNo
service_password_encryptionNo

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.12.0

TDQS

A4.3/5.0
Behavior4/5

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

With no annotations supplied, the description carries the full behavioral burden and does so well: it discloses that the tool writes configuration via CLI, that enable_secret is stored encrypted, that SSH requires at least one local user, that modulus<768 triggers a warning, that vty lines end up restricted to SSH with local login, and that dry_run performs validation only. It does not state whether the change is persisted to startup-config, whether it is idempotent, or what happens on a partially failing device, which keeps it below a 5.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Purpose is front-loaded in the first line, followed by a scannable parameter list and one worked example. Every element earns its place: the CLI enumeration sets scope, the parameter notes carry constraints the schema lacks, and the example disambiguates the nested ssh/users shapes.

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 an eight-parameter mutation tool with nested objects and no annotations, the description is nearly complete, and the existence of an output schema relieves it of explaining return values. Remaining gaps are persistence semantics, idempotency, and failure behavior when the device is missing or a CLI line is rejected.

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%, so the description must compensate entirely, and it does: all eight parameters are explained, including the nested ssh keys (domain/modulus/version/enable), the users list shape with optional privilege, the default of True for service_password_encryption, and the non-obvious constraint that banner_motd text must omit the '#' character. This adds genuine meaning beyond the bare schema types.

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?

The description opens with a specific verb and resource ('Hardens a router/switch in the active topology') and then enumerates exactly which CLI items are applied (hostname, MOTD, enable secret, local users, SSH, service password-encryption, vty restriction). That enumeration clearly separates it from siblings like pt_apply_acl, pt_apply_vlan, or pt_apply_stp, which each target a narrower feature.

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 implied by the purpose: use it when you want a full baseline hardening pass rather than a single feature. The dry_run parameter is explained as a validate-only mode, and a full example call is supplied, but there is no explicit statement of when NOT to use it, no named alternative for partial hardening, and no stated prerequisites (device must already exist, must be a router/switch, must be reachable).

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