Skip to main content
Glama

netmiko.get_command_policy

Retrieve the list of permitted and denied commands for network devices, along with the policy source, to understand why a command was refused and find an allowed alternative.

Instructions

List the commands this server will accept, and where that policy comes from.

CALL THIS AFTER A REFUSAL, BEFORE RETRYING. A Security Error: Command ... is not permitted means the command is outside the operator's policy. Do not guess a variant and do not abbreviate — read the policy here, pick a command that is actually allowed, and if nothing fits, tell the user which command was refused and what the allow list does cover.

Also useful when the user asks what they can run on this deployment.

ANSWERING "which commands are available for Juniper / Huawei / Cisco": the lists are flat, because the operator writes one policy for the whole estate. Filter it yourself by dialect — you know the CLIs, and device_types_in_inventory tells you which platforms are actually present. show route* and show chassis* are Junos, display * is Huawei VRP and HPE Comware, show ip route is Cisco-style, and show version happens to work on several. Under the fallback, allowed_commands_by_platform already carries that split, verbatim and exact — use it as given instead of re-deriving it. Two rules when you answer:

  • Never list a command that is not in allowed_commands. It will be refused.

  • Say when the answer is empty: an allow list written for one vendor covers nothing on another, and that is the operator's doing, not a device fault.

policy_source says who wrote the policy in force:

  • "file" — the operator's allow/deny list, at command_file.

  • "fallback" — no policy file exists on this deployment, so only a small built-in read-only set runs. warning explains it; relay that to the user, because every other refusal follows from it and looks like a device problem otherwise.

How the lists are read (getting this wrong wastes attempts, and every attempt is audited):

  • Deny wins over allow, always.

  • The allow list does NOT cover abbreviations: show version does not permit sh ver. Send full commands.

  • The deny list DOES cover abbreviations of the same word count: a deny on configure also blocks conf.

  • * is a glob and only ever appears at the end. cmd* swallows whatever follows; cmd * requires at least one more word and does not match cmd on its own.

  • Anything the allow list does not name is denied.

Returns: str: JSON with policy_source, command_file, allowed_commands, denied_commands, their counts, a rules object, device_types_in_inventory, and — only under the fallback — allowed_commands_by_platform and a warning.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

No annotations are provided, so the description carries the full burden. It extensively discloses behavior: how the policy lists are read (deny wins, no abbreviations, glob rules), what the return JSON contains, and the meaning of `policy_source` values. This is complete and transparent.

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 description is long but well-structured with clear sections and bullet points. Every sentence adds value, though some content (e.g., repeated warnings about not listing commands not in the allow list) could be slightly more concise. It is front-loaded with the core purpose, making it effective.

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?

Given the tool's complexity (0 parameters, no output schema provided in structured form), the description is exceptionally complete. It explains the return structure, usage interpretation, edge cases (empty lists, fallback warning), and even includes guidance on how to handle the results. No gaps remain.

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?

The tool has zero parameters, and the schema coverage is trivially 100%. The description adds no parameter-level semantics because there are none. Per the guidelines, baseline is 4 for zero-parameter tools, and the description does not need to compensate further.

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 clearly states the tool's purpose: 'List the commands this server will accept, and where that policy comes from.' It uses a specific verb (list) and resource (commands policy), and distinguishes itself from sibling tools like netmiko.send_show_command by focusing on policy rather than executing commands.

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?

The description provides explicit when-to-use guidance: 'CALL THIS AFTER A REFUSAL, BEFORE RETRYING.' It also explains what not to do (don't guess or abbreviate) and gives context for alternative scenarios ('when the user asks what they can run'). This is thorough and actionable.

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/escrimaglia/netmiko-sot_mcp'

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