dns_records
Retrieve DNS records for a specified domain, including record type, name, value, and TTL. Input the domain's UUID to access detailed DNS information.
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)Primary handler for the 'dns_records' tool. Decorated with @mcp.tool() for registration. Describes input schema in docstring (domain_id: str) and expected output structure. Delegates execution to Sherlock instance's _dns_records method wrapped in handle_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:10-17 (helper)Helper function that provides the Sherlock client instance used by the dns_records handler 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()
- src/sherlock_mcp/server.py:19-31 (helper)Helper function that normalizes responses from Sherlock methods for MCP tool output, handling both JSON and raw HTTP responses.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:209-210 (registration)Entry point that runs the FastMCP server, which registers and serves all decorated tools including dns_records.def main(): mcp.run()
- src/sherlock_mcp/server.py:153-164 (schema)Function signature and docstring defining the input schema (domain_id: str) and output schema (list of DNS records with id, type, name, value, ttl).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 """