Skip to main content
Glama
cenemil

DNS MCP Server

by cenemil

batch_dns

Perform multiple DNS lookups simultaneously to resolve domain records efficiently in a single operation.

Instructions

Perform multiple DNS lookups in a single operation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queriesYesArray of DNS queries to perform
parallelNoExecute queries in parallel
timeoutNoQuery timeout per request

Implementation Reference

  • Core implementation of batch DNS lookups. Flattens multiple queries into individual lookups executed in parallel (default) or sequentially, collecting results and errors.
    async batchLookup(
      queries: { domain: string; recordTypes: DnsRecordType[] }[],
      parallel: boolean = true
    ): Promise<{ results: DnsLookupResult[]; errors: DnsError[] }> {
      const results: DnsLookupResult[] = [];
      const errors: DnsError[] = [];
      
      const performQuery = async (domain: string, recordType: DnsRecordType) => {
        try {
          const result = await this.lookup(domain, recordType);
          results.push(result);
        } catch (error) {
          errors.push(error as DnsError);
        }
      };
      
      const allQueries = queries.flatMap(q => 
        q.recordTypes.map(rt => ({ domain: q.domain, recordType: rt }))
      );
      
      if (parallel) {
        await Promise.all(
          allQueries.map(q => performQuery(q.domain, q.recordType))
        );
      } else {
        for (const q of allQueries) {
          await performQuery(q.domain, q.recordType);
        }
      }
      
      return { results, errors };
    }
  • Zod schema for validating batch_dns tool inputs, defining queries array, parallel flag, and timeout.
    export const BatchDnsSchema = z.object({
      queries: z.array(z.object({
        domain: z.string().min(1),
        recordTypes: z.array(DnsRecordTypeSchema).min(1)
      })).min(1).max(50).describe('Array of DNS queries to perform'),
      parallel: z.boolean().default(true).describe('Execute queries in parallel'),
      timeout: z.number().min(100).max(30000).optional().describe('Query timeout per request')
    });
  • src/index.ts:93-131 (registration)
    Tool registration in the TOOLS array, specifying name, description, and JSON schema for MCP tool listing.
    {
      name: 'batch_dns',
      description: 'Perform multiple DNS lookups in a single operation',
      inputSchema: {
        type: 'object',
        properties: {
          queries: {
            type: 'array',
            items: {
              type: 'object',
              properties: {
                domain: {
                  type: 'string'
                },
                recordTypes: {
                  type: 'array',
                  items: {
                    type: 'string',
                    enum: ['A', 'AAAA', 'CNAME', 'MX', 'TXT', 'NS', 'SOA', 'PTR', 'SRV', 'CAA']
                  }
                }
              },
              required: ['domain', 'recordTypes']
            },
            description: 'Array of DNS queries to perform'
          },
          parallel: {
            type: 'boolean',
            default: true,
            description: 'Execute queries in parallel'
          },
          timeout: {
            type: 'number',
            description: 'Query timeout per request'
          }
        },
        required: ['queries']
      }
    },
  • MCP server request handler for batch_dns tool call: parses input with schema, invokes DnsResolver.batchLookup, formats and returns results with timing.
    case 'batch_dns': {
      const input = BatchDnsSchema.parse(args) as BatchDnsInput;
      const startTime = Date.now();
      const { results, errors } = await dnsResolver.batchLookup(
        input.queries.map(q => ({
          domain: q.domain,
          recordTypes: q.recordTypes as DnsRecordType[]
        })),
        input.parallel
      );
      return {
        content: [
          {
            type: 'text',
            text: JSON.stringify({
              results,
              errors,
              totalTime: Date.now() - startTime,
              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 of behavioral disclosure. It mentions 'multiple DNS lookups in a single operation,' implying batch processing, but lacks details on performance traits (e.g., rate limits, error handling for partial failures), authentication needs, or output format. For a tool with 3 parameters and no annotations, this leaves significant gaps in understanding its behavior.

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: 'Perform multiple DNS lookups in a single operation.' It is front-loaded with the core purpose, has zero waste, and is appropriately sized for the tool's complexity, making it easy to parse quickly.

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 (3 parameters, batch operation) and lack of annotations and output schema, the description is incomplete. It doesn't address key aspects like error handling, output structure, or performance implications, which are crucial for a batch tool. The description alone is insufficient for an agent to fully understand how to use this tool effectively.

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 schema description coverage is 100%, meaning all parameters are documented in the input schema. The description adds no additional meaning about parameters beyond the general batch operation context. Since the schema handles the heavy lifting, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

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?

The description clearly states the tool's purpose: 'Perform multiple DNS lookups in a single operation.' It specifies the verb ('perform'), resource ('DNS lookups'), and scope ('multiple...in a single operation'), which is clear and specific. However, it doesn't explicitly distinguish this batch operation from the sibling 'dns_lookup' tool, which likely handles single lookups, missing full sibling differentiation.

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. It doesn't mention the sibling tools (dns_lookup, dns_trace, reverse_dns) or clarify scenarios like handling bulk queries versus single lookups. Without such context, users must infer usage, which is inadequate for effective tool selection.

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