get_domain_status
Monitor a domain purchase order by polling the backend every 3 seconds for up to 120 seconds, until the order completes or fails.
Instructions
Get the status of a domain purchase order.
Polls the backend every 3 seconds (up to 120 seconds) until the order reaches a terminal state (complete or failed).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| order_id | Yes | The order ID returned from buy_domain (e.g. "ord_abc123"). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- instadomain/mcp_server.py:96-126 (handler)The get_domain_status MCP tool handler. Polls the backend /status/{order_id} endpoint every 3 seconds (up to 120s) until the order reaches a terminal state (complete, failed, or expired). Returns the status dict or a timeout message.
@mcp.tool() async def get_domain_status(order_id: str) -> dict: """Get the status of a domain purchase order. Polls the backend every 3 seconds (up to 120 seconds) until the order reaches a terminal state (complete or failed). Args: order_id: The order ID returned from buy_domain (e.g. "ord_abc123"). """ terminal_statuses = {"complete", "failed", "expired"} deadline = asyncio.get_running_loop().time() + POLL_TIMEOUT_SECONDS async with httpx.AsyncClient(base_url=BACKEND_URL, timeout=15) as client: while True: resp = await client.get(f"/status/{order_id}") resp.raise_for_status() data = resp.json() if data.get("status") in terminal_statuses: return data if asyncio.get_running_loop().time() >= deadline: data["_poll_timeout"] = True data["_message"] = ( f"Order {order_id} did not reach a terminal state " f"within {POLL_TIMEOUT_SECONDS}s. Current status: {data.get('status')}" ) return data await asyncio.sleep(POLL_INTERVAL_SECONDS) - instadomain/mcp_server.py:96-97 (registration)The tool is registered via the @mcp.tool() decorator on line 96, which registers it with the FastMCP server instance (mcp) defined on line 30.
@mcp.tool() async def get_domain_status(order_id: str) -> dict: - instadomain/mcp_server.py:96-105 (schema)Input schema: single parameter 'order_id' (str). The return type is dict, documented to contain status, and on timeout includes _poll_timeout and _message fields.
@mcp.tool() async def get_domain_status(order_id: str) -> dict: """Get the status of a domain purchase order. Polls the backend every 3 seconds (up to 120 seconds) until the order reaches a terminal state (complete or failed). Args: order_id: The order ID returned from buy_domain (e.g. "ord_abc123"). """ - instadomain/mcp_server.py:22-23 (helper)Polling constants used by get_domain_status: POLL_INTERVAL_SECONDS (3) and POLL_TIMEOUT_SECONDS (120).
POLL_INTERVAL_SECONDS = 3 POLL_TIMEOUT_SECONDS = 120 - instadomain/mcp_server.py:21-21 (helper)Backend URL constant used by get_domain_status to make HTTP requests to the /status/{order_id} endpoint.
BACKEND_URL = os.environ.get("INSTADOMAIN_BACKEND_URL", "https://instadomain.fly.dev")