Skip to main content
Glama
cenemil

DNS MCP Server

by cenemil

dns_trace

Trace DNS resolution paths from root servers to final results to diagnose DNS issues and understand domain delegation chains.

Instructions

Trace the DNS resolution path from root servers to the final result

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYesThe domain to trace DNS resolution path
recordTypeNoThe record type to traceA

Implementation Reference

  • The core handler function traceDns in DnsResolver class that performs DNS tracing from root servers through delegation chain to final resolution.
    async traceDns(domain: string, recordType: DnsRecordType = 'A'): Promise<any> {
      const trace: any[] = [];
      
      try {
        const rootServers = await this.resolver.resolveNs('.');
        trace.push({ level: 'root', servers: rootServers });
        
        const parts = domain.split('.').reverse();
        let currentDomain = '';
        
        for (const part of parts) {
          currentDomain = currentDomain ? `${part}.${currentDomain}` : part;
          try {
            const nsRecords = await this.resolver.resolveNs(currentDomain);
            trace.push({ level: currentDomain, servers: nsRecords });
          } catch (error) {
            break;
          }
        }
        
        const finalResult = await this.lookup(domain, recordType);
        trace.push({ level: 'final', result: finalResult });
        
        return trace;
      } catch (error: any) {
        throw {
          code: 'TRACE_FAILED',
          message: error.message || 'DNS trace failed',
          domain,
          recordType
        } as DnsError;
      }
    }
  • Zod schema defining input for dns_trace tool: domain (required) and optional recordType.
    export const DnsTraceSchema = z.object({
      domain: z.string().min(1).describe('The domain to trace DNS resolution path'),
      recordType: DnsRecordTypeSchema.default('A').describe('The record type to trace')
    });
  • src/index.ts:132-151 (registration)
    Tool registration in TOOLS array, defining name, description, and inputSchema for dns_trace.
    {
      name: 'dns_trace',
      description: 'Trace the DNS resolution path from root servers to the final result',
      inputSchema: {
        type: 'object',
        properties: {
          domain: {
            type: 'string',
            description: 'The domain to trace DNS resolution path'
          },
          recordType: {
            type: 'string',
            enum: ['A', 'AAAA', 'CNAME', 'MX', 'TXT', 'NS', 'SOA', 'PTR', 'SRV', 'CAA'],
            default: 'A',
            description: 'The record type to trace'
          }
        },
        required: ['domain']
      }
    }
  • Dispatcher handler case in CallToolRequestSchema that parses input, calls dnsResolver.traceDns, and formats response.
    case 'dns_trace': {
      const input = DnsTraceSchema.parse(args) as DnsTraceInput;
      const trace = await dnsResolver.traceDns(
        input.domain,
        input.recordType as DnsRecordType
      );
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              domain: input.domain,
              recordType: input.recordType,
              trace,
              timestamp: new Date().toISOString()
            }, null, 2)
          }
        ]
      };
    }
Behavior2/5

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

No annotations are provided, so the description carries the full burden. It mentions the action ('Trace') but does not disclose behavioral traits such as whether this is a read-only operation, potential rate limits, authentication needs, or what the output format looks like (e.g., list of DNS servers, timing). For a tool with no annotation coverage, this is a significant gap in 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?

The description is a single, efficient sentence that is front-loaded with the core purpose. There is no wasted language, and it directly communicates the tool's function without unnecessary elaboration.

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?

Given the tool's complexity (tracing DNS paths), lack of annotations, and no output schema, the description is incomplete. It does not explain what the output contains (e.g., steps in resolution, error handling), behavioral aspects, or how it differs from siblings in practical use. This leaves gaps for an AI agent to understand the tool fully.

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?

Schema description coverage is 100%, so the schema already documents both parameters ('domain' and 'recordType') with descriptions and enum values. The description does not add meaning beyond what the schema provides, such as explaining parameter interactions or usage nuances. Baseline 3 is appropriate when the schema does the heavy lifting.

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 tool's purpose with a specific verb ('Trace') and resource ('DNS resolution path'), specifying the scope ('from root servers to the final result'). It distinguishes from siblings like 'dns_lookup' (likely a simple lookup) and 'reverse_dns' (reverse resolution) by emphasizing the tracing of the full resolution path.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for tracing DNS resolution paths, but does not explicitly state when to use this tool versus alternatives like 'dns_lookup' or 'batch_dns'. It provides context (tracing from root to final result) but lacks explicit guidance on exclusions or specific scenarios where this tool is preferred over others.

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/cenemil/dns-mcp-server'

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