opnsense_diag_log_resolver
Fetch recent Unbound DNS resolver log entries from OPNsense to diagnose and troubleshoot DNS resolution issues.
Instructions
Retrieve recent Unbound DNS resolver log entries.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Number of log entries (1-5000, default 500) |
Implementation Reference
- src/tools/diagnostics.ts:350-354 (handler)Handler case for 'opnsense_diag_log_resolver' — parses args via LogQuerySchema, calls GET /diagnostics/log/core/resolver?limit=<limit> API, returns JSON result.
case "opnsense_diag_log_resolver": { const parsed = LogQuerySchema.parse(args); const result = await client.get(`/diagnostics/log/core/resolver?limit=${parsed.limit}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }] }; } - src/tools/diagnostics.ts:33-35 (schema)LogQuerySchema used for input validation of the resolver tool (and other log tools). Accepts optional 'limit' (coerced number, 1-5000, default 500).
const LogQuerySchema = z.object({ limit: z.coerce.number().int().min(1).max(5000).optional().default(500), }); - src/tools/diagnostics.ts:174-183 (registration)Tool definition registration in diagnosticsToolDefinitions array — declares name, description, and inputSchema (with optional limit param) for the ListTools response.
{ name: "opnsense_diag_log_resolver", description: "Retrieve recent Unbound DNS resolver log entries.", inputSchema: { type: "object" as const, properties: { limit: { type: "number", description: "Number of log entries (1-5000, default 500)" }, }, }, }, - src/index.ts:61-61 (registration)Tool handler registration — maps the tool name from diagnosticsToolDefinitions to handleDiagnosticsTool in the toolHandlers Map.
for (const def of diagnosticsToolDefinitions) toolHandlers.set(def.name, handleDiagnosticsTool); - src/index.ts:42-42 (registration)All tool definitions array includes diagnosticsToolDefinitions (which contains the resolver tool definition).
...diagnosticsToolDefinitions,