Skip to main content
Glama
rosschurchill

Technitium MCP Secure

dns_query_logs

Retrieve DNS query logs with optional filters for domain, client IP, query type, and response code to analyze server activity.

Instructions

Query DNS server logs with optional filters. Returns recent DNS queries and their responses. Requires the Query Logs app to be installed.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pageNumberNoPage number (default: 1)
entriesPerPageNoEntries per page (default: 25, max: 100)
domainNoFilter by domain name (exact match, e.g. github.com)
clientIpNoFilter by client IP address
queryTypeNoFilter by DNS query type
responseCodeNoFilter by response code

Implementation Reference

  • The handler function that executes the dns_query_logs tool logic. It builds query parameters with optional filters (domain, clientIp, queryType, responseCode) and calls the /api/logs/query endpoint via the TechnitiumClient.
    handler: async (args) => {
      const params: Record<string, string> = {
        name: "Query Logs (Sqlite)",
        classPath: "QueryLogsSqlite.App",
        pageNumber: String(args.pageNumber || 1),
        entriesPerPage: String(
          Math.min(Number(args.entriesPerPage) || 25, 100)
        ),
      };
    
      if (args.domain) {
        // API uses 'qname' (exact match on the DNS question name column)
        params.qname = validateStringLength(
          args.domain as string,
          253,
          "domain"
        );
      }
      if (args.clientIp) {
        params.clientIpAddress = validateIp(args.clientIp as string);
      }
      if (args.queryType) {
        params.type = validateRecordType(args.queryType as string);
      }
      if (args.responseCode) {
        const valid = new Set([
          "NoError",
          "ServerFailure",
          "NxDomain",
          "Refused",
          "FormatError",
        ]);
        const code = args.responseCode as string;
        if (!valid.has(code)) {
          throw new Error(`Invalid response code: ${code}`);
        }
        params.rcode = code;
      }
    
      const data = await client.callOrThrow("/api/logs/query", params);
      return JSON.stringify(data, null, 2);
    },
  • The input schema definition for dns_query_logs. Defines optional parameters: pageNumber, entriesPerPage, domain, clientIp, queryType (with enum of DNS record types), and responseCode (with enum of error codes).
    definition: {
      name: "dns_query_logs",
      description:
        "Query DNS server logs with optional filters. Returns recent DNS queries and their responses. Requires the Query Logs app to be installed.",
      inputSchema: {
        type: "object",
        properties: {
          pageNumber: {
            type: "number",
            description: "Page number (default: 1)",
          },
          entriesPerPage: {
            type: "number",
            description: "Entries per page (default: 25, max: 100)",
          },
          domain: {
            type: "string",
            description: "Filter by domain name (exact match, e.g. github.com)",
          },
          clientIp: {
            type: "string",
            description: "Filter by client IP address",
          },
          queryType: {
            type: "string",
            enum: [
              "A",
              "AAAA",
              "CNAME",
              "MX",
              "NS",
              "PTR",
              "SOA",
              "TXT",
              "ANY",
            ],
            description: "Filter by DNS query type",
          },
          responseCode: {
            type: "string",
            enum: [
              "NoError",
              "ServerFailure",
              "NxDomain",
              "Refused",
              "FormatError",
            ],
            description: "Filter by response code",
          },
        },
      },
    },
  • The tool is registered via the logTools function, imported from './logs.js' and included in the getAllTools array as ...logTools(client).
    import { logTools } from "./logs.js";
    import { appTools } from "./apps.js";
    import { dnssecTools } from "./dnssec.js";
    
    export function getAllTools(client: TechnitiumClient): ToolEntry[] {
      return [
        ...dashboardTools(client),
        ...dnsClientTools(client),
        ...zoneTools(client),
        ...recordTools(client),
        ...blockingTools(client),
        ...cacheTools(client),
        ...settingsTools(client),
        ...logTools(client),
  • src/index.ts:35-35 (registration)
    The tool is registered in the MCP server's toolMap (line 35) and dispatched via CallToolRequestSchema (line 47-124). The definition (name, description, inputSchema) is sent via ListToolsRequestSchema (line 43-45).
    const toolMap = new Map(tools.map((t) => [t.definition.name, t]));
  • The validateStringLength helper used to validate the domain filter length (max 253 chars). Also validateIp (line 19-28) and validateRecordType (line 51-60) are used for clientIp and queryType filters.
    export function validateStringLength(value: string, maxLength: number, fieldName: string): string {
      if (typeof value !== "string") {
        throw new Error(`${fieldName} must be a string`);
      }
      if (value.length > maxLength) {
        throw new Error(`${fieldName} exceeds maximum length of ${maxLength}`);
      }
      return value;
    }
Behavior2/5

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

No annotations are provided, so the description must fully disclose behavioral traits. It mentions the prerequisite ('Requires the Query Logs app to be installed') but omits details on pagination behavior, time range, rate limits, or what 'recent' means. This is insufficient for a tool with no output schema.

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?

Two sentences with no fluff. The first sentence states the action and filters, the second adds output and prerequisite. Efficient and front-loaded.

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?

The tool has 6 parameters and no output schema. The description hints at output ('recent DNS queries and responses') but lacks specifics on return structure, default time range, or pagination limits. It is incomplete for a tool with moderate complexity.

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 for all 6 parameters, so the description adds no new meaning beyond what is already documented. A baseline of 3 is appropriate given the high schema coverage.

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 clearly states the action: 'Query DNS server logs with optional filters' and specifies the output: 'Returns recent DNS queries and their responses.' This is a specific verb-resource combination that distinguishes it from sibling tools like dns_resolve or dns_list_cache.

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 dns_list_cache or dns_resolve. It mentions optional filters but does not clarify the intended use case or distinguish it from other query tools.

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/rosschurchill/technitium-mcp-secure'

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