Skip to main content
Glama

toggle_blocklist_entry

Enable or disable a DNS blocklist entry in OPNSense by specifying the UUID of the entry using the MCP server for efficient firewall management.

Instructions

Enable/disable a DNS blocklist entry

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
uuidYesUUID of the blocklist entry

Implementation Reference

  • The core handler function that toggles the enabled/disabled state of a specific DNS blocklist entry identified by its UUID. It fetches the current entry, flips the 'enabled' flag between '0' and '1', updates it via the OPNSense API client, and applies the changes.
    async toggleBlocklistEntry(uuid: string): Promise<void> { try { const entry = await this.client.getUnboundHost(uuid); if (!entry?.host) { throw new Error('Blocklist entry not found'); } const updated = { ...entry.host, enabled: entry.host.enabled === '1' ? '0' : '1' }; await this.client.setUnboundHost(uuid, updated); await this.applyChanges(); } catch (error: any) { console.error('Failed to toggle blocklist entry:', error); throw new Error(`Failed to toggle blocklist entry: ${error.message}`); } }

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