Skip to main content
Glama

opnsense_api_request

Destructive

Call any OPNsense API endpoint directly to cover features outside dedicated tools, such as NAT rules, traffic shaping, and IDS. Returns raw JSON.

Instructions

Call any OPNsense API endpoint directly. Use this only for endpoints the other tools do not cover.

The dedicated tools shape their output, handle pagination and explain their failures; this returns raw JSON. Reach for it when you need something outside their scope, for example NAT rules (firewall/source_nat, firewall/d_nat), traffic shaping, IDS/Suricata, captive portal, certificates, or plugin endpoints such as CrowdSec.

Endpoint naming: the published reference lists commands in snake_case but URLs use camelCase, so get_interface_names becomes getInterfaceNames and query_states becomes queryStates.

GET is always permitted. POST requires both OPNSENSE_ALLOW_WRITE=true and confirm=true. A small set of endpoints is refused outright regardless of settings: reboot, halt, factory reset, configuration revert, snapshot activation and user account changes. Those need a human who can reach the console if it goes wrong.

Args: params (ApiRequestInput): Validated input containing: - module (str): e.g. "firewall" - controller (str): e.g. "source_nat" - command (str): camelCase command, e.g. "searchRule" - method (str): "GET" or "POST" (default: "GET") - segments (list[str]): Extra path segments (default: []) - params (dict): Query parameters (default: {}) - body (dict): JSON body for POST (default: {}) - confirm (bool): Required true for POST (default: False) - response_format (ResponseFormat): 'markdown' or 'json'

Returns: str: The endpoint's JSON response, pretty-printed. Responses longer than 20000 characters are truncated with a note; narrow the query rather than relying on the truncated tail.

Examples: - Use when: "List NAT port forwards" -> module="firewall", controller="source_nat", command="searchRule" - Use when: "What log filter fields exist?" -> module="diagnostics", controller="firewall", command="logFilters" - Don't use when: A dedicated tool exists; it will give better-structured output

Error Handling: - Refuses forbidden endpoints with an explanation - Returns a write-disabled explanation for POST when writes are off - Returns a confirm-required message for POST without confirm=true

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
paramsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior5/5

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

Beyond the annotations (readOnlyHint=false, destructiveHint=true), the description discloses raw JSON return, truncation at 20000 characters, camelCase naming conversion, refusal of specific dangerous endpoints, and error-handling behavior. This adds valuable behavioral context that annotations alone do not provide, and there is no contradiction.

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 section earns its place: purpose, when-to-use, naming, permissions, args, returns, examples, and error handling are clearly separated and front-loaded with the core advisory. It is structured for quick scanning and contains no filler or redundancy.

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 generic nature and high complexity, the description covers all necessary aspects: scope, endpoint naming, write permissions, forbidden operations, return format/truncation, and error handling. The output schema exists, so the description does not need to enumerate fields, and it still provides complete guidance for an agent to invoke the tool correctly.

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?

The Args section explains each sub-parameter with types, defaults, and concrete examples (e.g., 'List NAT port forwards' -> module='firewall', command='searchRule'). This goes beyond the input schema and compensates for the lack of top-level parameter description, showing how to map user intent to valid parameter values.

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 explicitly states 'Call any OPNsense API endpoint directly' and distinguishes itself from siblings with 'Use this only for endpoints the other tools do not cover.' It lists concrete examples (NAT rules, traffic shaping, IDS/Suricata) and names the sibling tool style ('dedicated tools'), making the tool's unique scope unmistakable.

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?

Provides explicit when-to-use and when-not-to-use guidance: 'Reach for it when you need something outside their scope' and 'Don't use when: A dedicated tool exists; it will give better-structured output.' Also explains the permission conditions for writes (OPNSENSE_ALLOW_WRITE, confirm) and forbidden endpoints, which helps the agent decide whether this tool is appropriate.

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/aesaganda/opnsense-mcp'

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