Skip to main content
Glama
anhhung04

DNSDumpster MCP Server

by anhhung04

get_cname_records

Retrieve CNAME records for a domain to identify canonical name mappings and detect subdomain relationships in DNS infrastructure.

Instructions

Get CNAME records for a domain.

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

Returns: Formatted string containing CNAME records

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The handler function decorated with @mcp.tool(), implementing the logic to fetch and format CNAME DNS records for a given domain using the DNSDumpster API. Includes input validation, error handling, and formatted output.
    @mcp.tool()
    async def get_cname_records(domain: str, ctx: Context) -> str:
        """Get CNAME records for a domain.
    
        Args:
            domain: The domain name to query (e.g., example.com)
            ctx: Request context
    
        Returns:
            Formatted string containing CNAME 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 CNAME records for {domain}")
                result = await client.get_dns_records(domain)
    
                if "cname" not in result or not result["cname"]:
                    return f"No CNAME records found for {domain}"
    
                output_lines = [f"CNAME Records for {domain}:"]
    
                for record in result["cname"]:
                    host = record.get("host", "")
                    target = record.get("target", "")
    
                    output_lines.append(f"\nHost: {host}")
                    output_lines.append(f"Target: {target}")
    
                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 full burden. It mentions a return format ('Formatted string containing CNAME records'), which adds some behavioral context, but fails to disclose critical traits like whether this is a read-only operation, potential rate limits, authentication needs, or error conditions. For a tool with no annotation coverage, this leaves significant gaps.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

The description is front-loaded with the core purpose, but includes redundant sections ('Args:', 'Returns:') that repeat information partially covered elsewhere. The structure is clear but could be more streamlined by integrating details more efficiently without separate headings.

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 somewhat complete but lacks depth. It covers the basic purpose and return format, yet misses usage guidelines and behavioral details, making it adequate but with clear gaps for effective agent invocation.

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 minimal semantics beyond the input schema: it provides an example ('e.g., example.com') for the 'domain' parameter and notes the 'ctx' parameter (though 'ctx' is not in the schema, suggesting inconsistency). With 0% schema description coverage, the description partially compensates but doesn't fully explain parameter usage or constraints, aligning with the baseline expectation.

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 verb ('Get') and resource ('CNAME records for a domain'), making the purpose immediately understandable. However, it doesn't explicitly differentiate from sibling tools like 'get_a_records' or 'get_mx_records' beyond the record type, missing an opportunity to clarify scope distinctions.

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 'query_domain' or 'search_subdomains'. The description implies usage for CNAME records specifically, but lacks context about prerequisites, exclusions, or comparative use cases with sibling tools.

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