delete_dns
Remove DNS records from domains managed through Sherlock Domains MCP by specifying domain and record IDs.
Instructions
Delete a DNS record for a domain.
domain_id: Domain UUID (e.g., 'd1234567-89ab-cdef-0123-456789abcdef')
record_id: DNS record ID to delete
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| domain_id | Yes | ||
| record_id | Yes |
Implementation Reference
- src/sherlock_mcp/server.py:198-206 (handler)The main handler function for the 'delete_dns' MCP tool. It is decorated with @mcp.tool() for registration and executes the deletion by delegating to the Sherlock library's _delete_dns_record method, wrapped in handle_response.@mcp.tool() async def delete_dns(domain_id: str, record_id: str): """ Delete a DNS record for a domain. domain_id: Domain UUID (e.g., 'd1234567-89ab-cdef-0123-456789abcdef') record_id: DNS record ID to delete """ return handle_response(get_sherlock()._delete_dns_record(domain_id, record_id))
- src/sherlock_mcp/server.py:19-30 (helper)Helper function used by delete_dns (and other tools) to standardize responses from Sherlock methods, handling both raw HTTP responses and pre-processed data.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-16 (helper)Helper function to lazily instantiate the Sherlock client, used by delete_dns via get_sherlock().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()