dns_records
Retrieve DNS records for a domain to manage configurations like A, CNAME, MX, and TXT entries, including values and TTL settings.
Instructions
Get DNS records for a domain.
domain_id: Domain UUID (e.g: 'd1234567-89ab-cdef-0123-456789abcdef')
Each DNS record contains:
id (str): Unique record identifier
type (str): DNS record type (e.g. 'A', 'CNAME', 'MX', 'TXT')
name (str): DNS record name
value (str): DNS record value
ttl (int): Time to live in seconds
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain_id | Yes |
Implementation Reference
- src/sherlock_mcp/server.py:152-165 (handler)The MCP tool handler for 'dns_records', decorated with @mcp.tool() for registration. It takes a domain_id and delegates to the Sherlock instance's _dns_records method, handling the response.@mcp.tool() async def dns_records(domain_id: str): """ Get DNS records for a domain. domain_id: Domain UUID (e.g: 'd1234567-89ab-cdef-0123-456789abcdef') Each DNS record contains: id (str): Unique record identifier type (str): DNS record type (e.g. 'A', 'CNAME', 'MX', 'TXT') name (str): DNS record name value (str): DNS record value ttl (int): Time to live in seconds """ return handle_response(get_sherlock()._dns_records(domain_id))
- src/sherlock_mcp/server.py:152-152 (registration)The @mcp.tool() decorator registers the dns_records function as an MCP tool.@mcp.tool()
- src/sherlock_mcp/server.py:19-31 (helper)Helper function to handle responses from Sherlock methods, used by dns_records and other tools.def handle_response(response): """ Handle responses from Sherlock methods. Sherlock methods already process the response using _handle_response, which returns either a processed JSON object for successful requests or the response object itself. """ if hasattr(response, 'status_code'): # This is a raw response object try: return response.status_code, response.json() except: return response.status_code, response.text # This is already processed data (like a dictionary) return response
- src/sherlock_mcp/server.py:10-17 (helper)Helper function to get or create the Sherlock instance, used by dns_records and other tools.def get_sherlock(): """Get or create a Sherlock instance. We want to create the class instance inside the tool, so the init errors will bubble up to the tool and hence the MCP client instead of silently failing during the server creation. """ return Sherlock()