Skip to main content
Glama
anhhung04

DNSDumpster MCP Server

by anhhung04

get_a_records

Retrieve A records for a domain to identify associated IP addresses and analyze DNS infrastructure using the DNSDumpster MCP Server.

Instructions

Get A records for a domain.

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

Returns: Formatted string containing A records

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The @mcp.tool() decorator registers the get_a_records tool, and the function implements its core logic: validates domain, fetches DNS records from DNSDumpster API, filters A records, and formats output with IP details, ASN info, and banner data (HTTP/HTTPS).
    @mcp.tool()
    async def get_a_records(domain: str, ctx: Context) -> str:
        """Get A records for a domain.
    
        Args:
            domain: The domain name to query (e.g., example.com)
            ctx: Request context
    
        Returns:
            Formatted string containing A 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 A records for {domain}")
                result = await client.get_dns_records(domain)
    
                if "a" not in result or not result["a"]:
                    return f"No A records found for {domain}"
    
                output_lines = [f"A Records for {domain}:"]
    
                for record in result["a"]:
                    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}")
    
                        # If banner information is available
                        if "banners" in ip_info:
                            output_lines.append("  Banners:")
                            banners = ip_info["banners"]
    
                            if "http" in banners:
                                http_banner = banners["http"]
                                output_lines.append("    HTTP:")
    
                                if "title" in http_banner:
                                    output_lines.append(
                                        f"      Title: {http_banner['title']}"
                                    )
    
                                if "server" in http_banner:
                                    output_lines.append(
                                        f"      Server: {http_banner['server']}"
                                    )
    
                                if "apps" in http_banner:
                                    output_lines.append(
                                        f"      Apps: {', '.join(http_banner['apps'])}"
                                    )
    
                            if "https" in banners:
                                https_banner = banners["https"]
                                output_lines.append("    HTTPS:")
    
                                if "title" in https_banner:
                                    output_lines.append(
                                        f"      Title: {https_banner['title']}"
                                    )
    
                                if "server" in https_banner:
                                    output_lines.append(
                                        f"      Server: {https_banner['server']}"
                                    )
    
                                if "apps" in https_banner:
                                    output_lines.append(
                                        f"      Apps: {', '.join(https_banner['apps'])}"
                                    )
    
                                if "cn" in https_banner:
                                    output_lines.append(f"      CN: {https_banner['cn']}")
    
                                if "alt_n" in https_banner:
                                    output_lines.append(
                                        f"      Alt Names: {', '.join(https_banner['alt_n'])}"
                                    )
    
                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?

With no annotations provided, the description carries the full burden of behavioral disclosure. It mentions the return format ('Formatted string containing A records'), which adds some value, but lacks details on error handling, rate limits, authentication needs, or whether it's a read-only operation. This is a significant gap for a tool with no annotation coverage.

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 structured 'Args' and 'Returns' sections are efficient, though the inclusion of 'ctx: Request context' without explanation could be considered minor waste.

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) and the presence of an output schema, the description is minimally adequate. It covers the basic purpose and parameter example, but lacks behavioral context and usage guidelines, which are needed for full completeness despite the output schema handling return values.

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 0%, so the description must compensate. It provides an example for the 'domain' parameter ('e.g., example.com'), which adds meaning beyond the bare schema. However, it doesn't cover other potential aspects like format constraints or edge cases, keeping it at a baseline level.

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 ('A records for a domain'), making it immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_cname_records' or 'query_domain', which would require a 5.

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 is provided on when to use this tool versus alternatives like 'get_cname_records' or 'query_domain'. The description only states what it does, not when it's appropriate, leaving the agent to infer usage from context.

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