Skip to main content
Glama
anhhung04

DNSDumpster MCP Server

by anhhung04

get_ns_records

Retrieve nameserver (NS) records for any domain to identify DNS infrastructure and hosting providers.

Instructions

Get NS (nameserver) records for a domain.

Args: domain: The domain name to query (e.g., example.com) ctx: Request context

Returns: Formatted string containing NS records

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function decorated with @mcp.tool() that implements the logic for retrieving and formatting NS records for a given domain using DNSDumpsterClient. Includes input validation and error handling.
    @mcp.tool()
    async def get_ns_records(domain: str, ctx: Context) -> str:
        """Get NS (nameserver) records for a domain.
    
        Args:
            domain: The domain name to query (e.g., example.com)
            ctx: Request context
    
        Returns:
            Formatted string containing NS records
        """
        if not domain:
            return "Error: Domain is required"
    
        # Validate domain
        if not is_valid_domain(domain):
            return "Error: Invalid domain name format"
    
        try:
            api_key = os.environ.get("DNSDUMPSTER_API_KEY")
            if not api_key:
                return "Error: API key not configured. Set DNSDUMPSTER_API_KEY environment variable."
    
            client = DNSDumpsterClient(api_key)
    
            try:
                ctx.info(f"Querying NS records for {domain}")
                result = await client.get_dns_records(domain)
    
                if "ns" not in result or not result["ns"]:
                    return f"No NS records found for {domain}"
    
                output_lines = [f"NS Records for {domain}:"]
    
                for record in result["ns"]:
                    host = record.get("host", "")
                    output_lines.append(f"\nHost: {host}")
    
                    for ip_info in record.get("ips", []):
                        ip = ip_info.get("ip", "")
                        country = ip_info.get("country", "Unknown")
                        asn = ip_info.get("asn", "")
                        asn_name = ip_info.get("asn_name", "")
                        asn_range = ip_info.get("asn_range", "")
    
                        output_lines.append(f"  IP: {ip}")
                        output_lines.append(f"  Country: {country}")
                        if asn:
                            output_lines.append(f"  ASN: {asn}")
                        if asn_name:
                            output_lines.append(f"  ASN Name: {asn_name}")
                        if asn_range:
                            output_lines.append(f"  ASN Range: {asn_range}")
    
                return "\n".join(output_lines)
            finally:
                await client.close()
    
        except Exception as e:
            return f"Error: {str(e)}"
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 states what the tool does (gets NS records) and the return format (a formatted string), but lacks critical details such as whether this is a read-only operation, potential rate limits, authentication needs, error handling, or how the formatted string is structured. For a tool with no annotation coverage, 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.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded, with the core purpose stated first. The additional sections (Args, Returns) are structured but slightly verbose for a single parameter; they could be more integrated. Overall, it's efficient with little waste, though minor improvements in flow are possible.

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

Completeness3/5

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

Given the tool's low complexity (1 parameter, no annotations, but has an output schema), the description is somewhat complete but has gaps. The output schema existence means return values don't need explanation, but the description lacks context on behavioral aspects like error cases or performance. It's adequate for basic use but not fully comprehensive.

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 description adds some meaning beyond the input schema by explaining the 'domain' parameter with an example (e.g., example.com). However, with 0% schema description coverage and only 1 parameter, the description compensates minimally but adequately—it clarifies the parameter's purpose but doesn't detail constraints like domain format validation. The baseline is appropriate given the low parameter count.

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 with a specific verb ('Get') and resource ('NS records for a domain'), making it immediately understandable. However, it doesn't explicitly distinguish this tool from its sibling tools (like get_a_records, get_mx_records), which all follow a similar pattern but query different DNS record types.

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. With sibling tools like query_domain (which might return multiple record types) and other specific record-type tools, there's no indication of whether this is preferred for NS records or when a broader query might be better. Usage is implied by the tool name but not explicitly stated.

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/anhhung04/mcp-dnsdumpster'

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