Skip to main content
Glama
NetBox MCP Server

NetBox MCP Server

by mhajder

Netbox Run Script

netbox_run_script
Destructive

Run a NetBox custom script and return its log and output. By default, changes are rolled back; set commit to keep them after confirming.

Instructions

Run a NetBox custom script and return its log and output.

Runs with commit=false (changes rolled back) unless commit is set. The script runs as a background job; if it is still running after wait_seconds, poll it with netbox_get_object('core.job', job id). Confirm with the user before commit=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": {
      "script": "<script>"
    },
    "name": "netbox_run_script"
  }
}

Input Schema

NameRequiredDescriptionDefault
dataNoValues for the script's input variables, e.g. {'site': 3, 'dry_run_note': 'test'}. Object variables take IDs.
commitNoKeep the script's database changes. False (default) runs it and rolls its changes back - use that first.
scriptYesScript ID, or 'module.ClassName' (e.g. 'cleanup.StaleIPs'). List scripts with netbox_get_objects on 'extras.script'.
wait_secondsNoHow long to wait for the result. 0 returns as soon as the job is queued.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.3.0

TDQS

A4.3/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and openWorldHint=true; the description goes beyond them by disclosing the rollback default (commit=false), the background-job lifecycle, and the required user confirmation before a destructive commit. It does not cover permission/auth requirements for script execution, which is the only meaningful remaining gap.

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?

Four short sentences with zero filler; the core action and default safety posture are front-loaded, and each following sentence adds a distinct operational fact (rollback default, async polling, confirmation).

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?

An output schema exists, so return values need no explanation, and the description still covers the two things an agent must know before calling: changes are rolled back unless commit is set, and long runs must be polled as a job. Complete for a destructive, open-world tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so all four parameters are already documented, including commit's rollback semantics and script's ID-or-module.ClassName forms. The description adds no parameter detail beyond the schema, so the baseline 3 is appropriate.

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?

States a specific verb and resource ("Run a NetBox custom script") plus the return payload ("its log and output"). No sibling tool in the list executes scripts, so it is trivially distinguishable from get_objects/update_object/etc.

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

Usage Guidelines4/5

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

Gives concrete operational guidance: dry-run by default, confirm before commit=true, and an explicit fallback ("poll it with netbox_get_object('core.job', job id)") when the job outlives wait_seconds. Lacks an explicit statement of when to prefer an alternative over running a script at all, so it falls short of a 5.

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