Skip to main content
Glama
rosschurchill

Technitium MCP Secure

dns_get_stats

Retrieve DNS query statistics for a specified period, including total queries, cached, blocked, and failures, with top clients, domains, and blocked domains.

Instructions

Get DNS query statistics for a time period. Returns total queries, cached, blocked, failure counts, plus top clients, top domains, and top blocked domains.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
periodNoTime period for stats (default: LastDay)

Implementation Reference

  • The handler function for the dns_get_stats tool. Calls the /api/dashboard/stats/get endpoint with the given period, then returns stats, topClients, topDomains, and topBlockedDomains.
    handler: async (args) => {
      const period = args.period
        ? validatePeriod(args.period as string)
        : "LastDay";
      const data = await client.callOrThrow("/api/dashboard/stats/get", {
        type: period,
      });
      const stats = data.stats as Record<string, unknown>;
      const topClients = data.topClients as unknown[];
      const topDomains = data.topDomains as unknown[];
      const topBlocked = data.topBlockedDomains as unknown[];
    
      return JSON.stringify(
        { stats, topClients, topDomains, topBlockedDomains: topBlocked },
        null,
        2
      );
    },
  • Input schema for dns_get_stats. Defines 'period' as an optional string enum (LastHour, LastDay, LastWeek, LastMonth, LastYear).
    inputSchema: {
      type: "object",
      properties: {
        period: {
          type: "string",
          enum: [
            "LastHour",
            "LastDay",
            "LastWeek",
            "LastMonth",
            "LastYear",
          ],
          description: "Time period for stats (default: LastDay)",
        },
      },
    },
  • Tool registration: dns_get_stats is registered as a ToolEntry inside the dashboardTools() function array, with definition, readonly=true, and handler.
    return [
      {
        definition: {
          name: "dns_get_stats",
          description:
            "Get DNS query statistics for a time period. Returns total queries, cached, blocked, failure counts, plus top clients, top domains, and top blocked domains.",
          inputSchema: {
            type: "object",
            properties: {
              period: {
                type: "string",
                enum: [
                  "LastHour",
                  "LastDay",
                  "LastWeek",
                  "LastMonth",
                  "LastYear",
                ],
                description: "Time period for stats (default: LastDay)",
              },
            },
          },
        },
        readonly: true,
        handler: async (args) => {
          const period = args.period
            ? validatePeriod(args.period as string)
            : "LastDay";
          const data = await client.callOrThrow("/api/dashboard/stats/get", {
            type: period,
          });
          const stats = data.stats as Record<string, unknown>;
          const topClients = data.topClients as unknown[];
          const topDomains = data.topDomains as unknown[];
          const topBlocked = data.topBlockedDomains as unknown[];
    
          return JSON.stringify(
            { stats, topClients, topDomains, topBlockedDomains: topBlocked },
            null,
            2
          );
        },
      },
  • Aggregated registration: getAllTools() collects all tool entries including dashboardTools which contains dns_get_stats.
    export function getAllTools(client: TechnitiumClient): ToolEntry[] {
      return [
        ...dashboardTools(client),
        ...dnsClientTools(client),
        ...zoneTools(client),
        ...recordTools(client),
        ...blockingTools(client),
        ...cacheTools(client),
        ...settingsTools(client),
        ...logTools(client),
        ...appTools(client),
        ...dnssecTools(client),
      ];
    }
  • The validatePeriod helper function used by the handler to validate the 'period' input parameter.
    export function validatePeriod(period: string): string {
      if (!VALID_PERIODS.has(period)) {
        throw new Error(`Invalid period: ${period}. Valid: ${[...VALID_PERIODS].join(", ")}`);
      }
      return period;
    }
Behavior3/5

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

Description lists returned data fields but does not disclose whether the tool is read-only, requires permissions, or has any side effects. Since no annotations are provided, the description carries full burden, and it only partially addresses behavioral context.

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 short sentences with clear front-loading: first sentence states purpose, second enumerates return values. No extraneous information, each sentence is essential.

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

Completeness4/5

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

Describes what the tool returns and mentions the time period parameter. Missing default value (LastDay) and read-only indicator, but given no output schema and simple single-parameter tool, coverage is largely sufficient.

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?

Input schema already documents the 'period' parameter with enum values and description (100% coverage). The tool description merely repeats 'time period' without adding new usage constraints, examples, or clarification beyond the schema.

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?

Description clearly states it retrieves DNS query statistics for a time period and lists returned data elements. However, it does not differentiate from siblings like dns_query_logs or dns_list_cache, leaving ambiguity about which tool to use for raw logs vs aggregated stats.

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?

No guidance on when to use this tool versus alternatives (e.g., dns_query_logs for raw logs). No mention of prerequisites, typical use cases, or conditions that would make another tool more appropriate.

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