Skip to main content
Glama
anhhung04

DNSDumpster MCP Server

by anhhung04

get_txt_records

Retrieve TXT records for any domain to analyze DNS configurations, verify domain ownership, or check for security settings like SPF and DMARC policies.

Instructions

Get TXT records for a domain.

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

Returns: Formatted string containing TXT records

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
domainYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'get_txt_records' tool. It validates the domain, fetches DNS records from DNSDumpster API using the client, extracts TXT records, formats them, and returns as a string. Includes the @mcp.tool() decorator which registers it as an MCP tool.
    @mcp.tool()
    async def get_txt_records(domain: str, ctx: Context) -> str:
        """Get TXT records for a domain.
    
        Args:
            domain: The domain name to query (e.g., example.com)
            ctx: Request context
    
        Returns:
            Formatted string containing TXT 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 TXT records for {domain}")
                result = await client.get_dns_records(domain)
    
                if "txt" not in result or not result["txt"]:
                    return f"No TXT records found for {domain}"
    
                output_lines = [f"TXT Records for {domain}:"]
    
                for txt in result["txt"]:
                    output_lines.append(f"\n{txt}")
    
                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 mentions that it returns a 'Formatted string containing TXT records,' which gives some output context, but lacks details on error handling, rate limits, authentication needs, or whether it's a read-only operation (implied by 'Get' but not explicit). For a tool with no annotations, this is insufficient.

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 structured with clear sections (Args, Returns) and is front-loaded with the core purpose. It's concise at three sentences, but the inclusion of 'ctx' (not in schema) adds unnecessary complexity. Overall, it's efficient with 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 (implied by 'Has output schema: true'), the description is somewhat complete. It covers the basic purpose and return format, but gaps remain in usage guidelines and behavioral transparency, especially with no annotations. It's adequate but has clear room for improvement.

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 explains the 'domain' parameter with an example ('e.g., example.com'), which is helpful since schema description coverage is 0%. However, it doesn't clarify the 'ctx' parameter mentioned in the description but not in the schema, creating confusion. With 1 parameter and low schema coverage, this is a baseline score.

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: 'Get TXT records for a domain.' It specifies the verb ('Get') and resource ('TXT records'), making it easy to understand. However, it doesn't explicitly differentiate from sibling tools like get_a_records or get_cname_records, which follow the same pattern for 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?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention sibling tools like query_domain (which might be more general) or when TXT records specifically are needed (e.g., for SPF, DKIM, or other text-based DNS entries). This leaves the agent without context for 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/anhhung04/mcp-dnsdumpster'

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