search
Find available domains by entering a query without subdomains or spaces. Get results with domain availability, prices in USD cents, and a search ID for purchase requests.
Instructions
Search for available domains matching the query.
Returns search results with available/unavailable domains, their prices in USD cents, and a search ID needed for purchase requests.
The query can be a full domain name with or without the TLD but not subdomains or text.
Valid queries:
- "example"
- "example.com"
- "my-domain"
Invalid queries:
- "www.example.com" # no subdomains
- "this is a search" # no spaces
- "sub.domain.com" # no subdomains
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| q | Yes |
Implementation Reference
- src/sherlock_mcp/server.py:33-50 (handler)The handler function for the MCP 'search' tool. It takes a query string, calls the underlying Sherlock library's _search method, and processes the response using handle_response.@mcp.tool() async def search(q: str) -> str: """ Search for available domains matching the query. Returns search results with available/unavailable domains, their prices in USD cents, and a search ID needed for purchase requests. The query can be a full domain name with or without the TLD but not subdomains or text. Valid queries: - "example" - "example.com" - "my-domain" Invalid queries: - "www.example.com" # no subdomains - "this is a search" # no spaces - "sub.domain.com" # no subdomains """ return handle_response(get_sherlock()._search(q))
- src/sherlock_mcp/server.py:19-30 (helper)Helper function used by the search tool (and others) to standardize responses from Sherlock API calls, 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 initialize and return the Sherlock instance used by the search tool.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()