Skip to main content
Glama
glucn

MCP DNS

dns-query

Query DNS records for domain names to retrieve information like IP addresses, mail servers, and text records using the MCP DNS server.

Instructions

Make a DNS query for a given name and type

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesThe domain name to query
typeYesThe DNS record type (A, AAAA, MX, TXT, CNAME, NS, etc.)

Implementation Reference

  • The handler function that performs the DNS query using Node.js dns/promises Resolver, resolves the records for the given name and type, and returns a structured text response with JSON-formatted results.
    async ({ name, type }) => {
      if (!name || !type) {
        // TODO: Validate inputs
      }
      const resolver = new dns.Resolver();
    
      const records = await resolver.resolve(name, type);
    
      return {
        content: [
          {
            type: "text",
            text: JSON.stringify({
              domain: name,
              type: type,
              records: records,
            }),
          },
        ],
      };
    }
  • Zod schema defining the input parameters: 'name' (domain) and 'type' (DNS record type).
    {
      name: z.string().describe("The domain name to query"),
      type: z
        .string()
        .describe("The DNS record type (A, AAAA, MX, TXT, CNAME, NS, etc.)"),
    },
  • src/server.ts:16-46 (registration)
    Registration of the 'dns-query' tool using McpServer.tool(), including description, input schema, and inline handler function.
    server.tool(
      "dns-query",
      "Make a DNS query for a given name and type",
      {
        name: z.string().describe("The domain name to query"),
        type: z
          .string()
          .describe("The DNS record type (A, AAAA, MX, TXT, CNAME, NS, etc.)"),
      },
      async ({ name, type }) => {
        if (!name || !type) {
          // TODO: Validate inputs
        }
        const resolver = new dns.Resolver();
    
        const records = await resolver.resolve(name, type);
    
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify({
                domain: name,
                type: type,
                records: records,
              }),
            },
          ],
        };
      }
    );
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions making a DNS query but fails to disclose critical traits such as network dependencies, potential latency, error handling, authentication needs, or rate limits. The description is minimal and does not compensate for the absence of annotations, leaving significant gaps in understanding the tool's 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 extremely concise, consisting of a single sentence that directly states the tool's function without any extraneous information. It is front-loaded and efficiently communicates the core purpose, making it easy to parse and understand quickly. Every word earns its place, adhering to best practices for brevity.

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 (a network query with potential dependencies) and the absence of both annotations and an output schema, the description is insufficiently complete. It does not explain what the query returns, error conditions, or operational constraints. For a tool that interacts with external systems, more context is needed to ensure reliable use by an AI agent.

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, clearly documenting both parameters ('name' and 'type') with their purposes. The description adds no additional semantic meaning beyond what the schema provides, as it only restates the parameters generically. According to the rules, with high schema coverage, the baseline score is 3, which is appropriate here since the description does not enhance parameter understanding.

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 action ('Make a DNS query') and the target ('for a given name and type'), which is specific and unambiguous. It distinguishes the tool's function well, though without sibling tools, differentiation isn't applicable. The purpose is not vague or tautological, but it could be slightly more detailed about the scope (e.g., network query vs. local lookup).

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, prerequisites, or context for invocation. It simply states what the tool does without indicating scenarios, limitations, or comparisons to other methods. This lack of usage context leaves the agent without direction on optimal application.

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

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