Skip to main content
Glama

run_command

Run CLI commands on PNETLab network nodes and return output. Handles telnet login and session management for efficient troubleshooting.

Instructions

Run a single CLI command on a running node and return its output.

Opens a telnet console, handles the IAC handshake, logs in if the device asks (default admin/empty password -- pass credentials for devices that differ), sends the command, and reads until the output goes idle (or wait_for regex matches). The session is pooled and reused across calls; call console_close when finished with a node.

Examples: run_command(1, "/ip address print") on a MikroTik; run_command(1, "ping 10.0.0.2 count 4", wait_for="packet-loss") ; run_command(2, "show ip interface brief") on IOS; run_command(3, "ping 10.0.0.1") on VPCS.

Gotcha: a single ? for help often does not trigger under telnet; use run_command with the full command instead. For long-running monitors, pass wait_for to match the final summary line.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
commandYes
node_idYes
timeoutNo
passwordNo
usernameNoadmin
wait_forNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

With no annotations, the description discloses the full operational behavior: opens telnet console, handles IAC handshake, logs in with default credentials, pools sessions across calls, reads until idle or wait_for regex, and requires console_close. It also exposes the '?' limitation. This goes well beyond any annotation.

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?

The description is long but every sentence carries information: behavior, credentials, examples, lifecycle, and a gotcha. It is front-loaded with the core purpose and structured with examples and an explicit 'Gotcha' section. It earns its length.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 6 parameters, a complex telnet lifecycle, and an output schema, the description covers purpose, usage, behavior, parameter semantics, and edge cases. The existence of an output schema covers return values, so the description doesn't need to restate them. The only minor omission is error handling, but it's not critical.

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 has 0% property descriptions, so the description is the only source of parameter meaning. It explains command via examples, wait_for via 'or wait_for regex matches', and credentials via 'default admin/empty password -- pass credentials for devices that differ.' However, the timeout parameter is not explicitly described, though its default value is in the schema.

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 clear verb and resource: 'Run a single CLI command on a running node and return its output.' It gives platform-specific examples (MikroTik, IOS, VPCS) that distinguish it from sibling tools like console_send or console_read, which handle raw console I/O.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides direct usage examples for different device types and explicitly states a gotcha: 'a single ? for help often does not trigger under telnet; use run_command with the full command instead.' It also instructs to 'call console_close when finished' and explains when to use wait_for for long-running monitors, constituting clear when/when-not guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/raybiko-lab/pnetlab-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server