opnsense_dns_blocklist_sources_list
List available built-in DNS blocklist sources (AdGuard, EasyList, hagezi, Steven Black, etc.) with their internal IDs and selected state. Read-only.
Instructions
List all available built-in DNSBL block-list sources (curated feeds like AdGuard, EasyList, hagezi, Steven Black, etc.) with their internal IDs and selected state. Read-only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/dns.ts:443-460 (handler)Handler function for the opnsense_dns_blocklist_sources_list tool. Calls /unbound/settings/getDnsbl, extracts blocklist types, and returns a list of sources with id, name, and selected state.
case "opnsense_dns_blocklist_sources_list": { const raw = (await client.get<{ blocklist?: { type?: Record<string, unknown> } }>( "/unbound/settings/getDnsbl", )); const types = raw?.blocklist?.type ?? {}; const sources: Array<{ id: string; name: string; selected: boolean }> = []; for (const [id, v] of Object.entries(types)) { if (v && typeof v === "object") { const o = v as Record<string, unknown>; sources.push({ id, name: String(o.value ?? ""), selected: o.selected === 1 || o.selected === "1", }); } } return { content: [{ type: "text", text: JSON.stringify({ sources, total: sources.length }, null, 2) }] }; } - src/tools/dns.ts:242-246 (schema)Tool definition (schema) for opnsense_dns_blocklist_sources_list in the dnsToolDefinitions array. No input parameters required.
name: "opnsense_dns_blocklist_sources_list", description: "List all available built-in DNSBL block-list sources (curated feeds like AdGuard, EasyList, hagezi, Steven Black, etc.) with their internal IDs and selected state. Read-only.", inputSchema: { type: "object" as const, properties: {} }, }, - src/index.ts:59-59 (registration)Registration mapping: every tool in dnsToolDefinitions (including opnsense_dns_blocklist_sources_list) is mapped to handleDnsTool handler.
for (const def of dnsToolDefinitions) toolHandlers.set(def.name, handleDnsTool); - src/index.ts:83-95 (registration)MCP CallTool request handler: looks up tool name in toolHandlers map and delegates to the registered handler function.
server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; const handler = toolHandlers.get(name); if (!handler) { return { content: [{ type: 'text' as const, text: `Unknown tool: ${name}` }], isError: true, }; } return handler(name, (args ?? {}) as Record<string, unknown>, client); });