Skip to main content
Glama
vespo92

OPNSense MCP Server

delete_firewall_rule

Remove a specific firewall rule on an OPNSense firewall by providing its UUID. Simplifies firewall rule management and enhances network security.

Instructions

Delete a firewall rule

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYesFirewall rule UUID

Implementation Reference

  • The main handler function for the firewall delete tool. It performs an API POST to delete the rule by UUID, applies changes, emits an event, updates the cache, and returns success status.
    private async deleteRule(params: { uuid: string }): Promise<any> {
      try {
        const response = await this.api.post(`/api/firewall/filter/delRule/${params.uuid}`);
    
        if (response.data?.result === 'deleted') {
          // Apply changes
          await this.applyChanges({});
    
          // Emit event
          this.emit('firewall.rule.deleted', {
            uuid: params.uuid,
          });
    
          // Remove from cache
          this.ruleCache.delete(params.uuid);
    
          return {
            success: true,
            message: 'Firewall rule deleted successfully',
          };
        }
    
        throw new Error('Failed to delete firewall rule');
      } catch (error) {
        this.logger.error(`Error deleting firewall rule ${params.uuid}:`, error);
        throw error;
      }
  • Input schema for the 'firewall_delete_rule' tool, requiring a 'uuid' string parameter.
    inputSchema: {
      type: 'object',
      properties: {
        uuid: {
          type: 'string',
          description: 'Rule UUID',
        },
      },
      required: ['uuid'],
  • Registration of the 'firewall_delete_rule' tool within the getTools() method of the FirewallPlugin, including name, description, schema, and handler binding.
    {
      name: 'firewall_delete_rule',
      description: 'Delete a firewall rule',
      inputSchema: {
        type: 'object',
        properties: {
          uuid: {
            type: 'string',
            description: 'Rule UUID',
          },
        },
        required: ['uuid'],
      },
      handler: this.deleteRule.bind(this),
    },
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action ('Delete') which implies a destructive operation, but doesn't specify whether deletion is permanent, requires admin permissions, affects network traffic immediately, or has confirmation prompts. For a destructive tool with zero annotation coverage, this leaves critical behavioral traits undocumented.

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 a single, efficient sentence with zero wasted words. It's front-loaded with the core action and resource, making it immediately scannable and understandable without unnecessary elaboration.

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

Completeness2/5

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

For a destructive operation tool with no annotations and no output schema, the description is incomplete. It doesn't address behavioral aspects like permanence, permissions, or system impact, nor does it explain what happens after deletion (e.g., success confirmation, error conditions). Given the complexity of firewall rule management, more context would be helpful for safe agent operation.

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?

The input schema has 100% description coverage, with the single parameter 'uuid' clearly documented as 'Firewall rule UUID'. The description adds no additional parameter information beyond what's in the schema, so it meets the baseline of 3 where the schema does the heavy lifting for parameter documentation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('Delete') and resource ('a firewall rule'), making the purpose immediately understandable. It distinguishes itself from siblings like 'create_firewall_rule' and 'update_firewall_rule' by specifying deletion, though it doesn't explicitly differentiate from 'toggle_firewall_rule' which might also affect rule status.

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

Usage Guidelines2/5

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

The description provides no guidance on when to use this tool versus alternatives like 'toggle_firewall_rule' or 'update_firewall_rule'. It doesn't mention prerequisites (e.g., needing the rule UUID from 'find_firewall_rules' or 'list_firewall_rules') or contextual constraints, leaving the agent to infer usage from the tool name alone.

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

Related 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/vespo92/OPNSenseMCP'

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