get_run_status
Check the status of a Grid run by providing its request ID. Poll every 2-5 seconds until the status is completed or failed.
Instructions
Check the status of a previously triggered Grid run.
Use this after run_grid returns a request_id (either from async mode or when sync mode times out after 120 seconds).
Poll every 2-5 seconds until status is "completed" or "failed". Avoid polling more frequently as requests count toward the rate limit (5 req/sec per workspace).
Args: request_id: The request_id UUID returned by run_grid.
Returns: {mode, status, grid_id, outputs (when completed)}. Status is one of: "running", "completed", or "failed". When completed, outputs contains {column_id: {value, name}} for each enriched column.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- main.py:237-260 (handler)The handler function for the get_run_status tool. It checks the status of a previously triggered Grid run by performing a GET request to /run/status/{request_id} and returning the JSON result.
@mcp.tool() def get_run_status(request_id: str) -> str: """ Check the status of a previously triggered Grid run. Use this after run_grid returns a request_id (either from async mode or when sync mode times out after 120 seconds). Poll every 2-5 seconds until status is "completed" or "failed". Avoid polling more frequently as requests count toward the rate limit (5 req/sec per workspace). Args: request_id: The request_id UUID returned by run_grid. Returns: {mode, status, grid_id, outputs (when completed)}. Status is one of: "running", "completed", or "failed". When completed, outputs contains {column_id: {value, name}} for each enriched column. """ if not request_id: raise ValueError("request_id must not be empty") data = _get(f"/run/status/{request_id}") return json.dumps(data, indent=2) - main.py:237-237 (registration)Registration of the get_run_status tool using the @mcp.tool() decorator on the FastMCP instance named 'mcp' (line 31).
@mcp.tool() - main.py:47-53 (helper)Helper function _get() used by get_run_status to make the authenticated GET request to the BitScale API.
def _get(path: str, params: dict | None = None, timeout: int = 30) -> dict: """Perform an authenticated GET request against the BitScale API.""" url = f"{BITSCALE_API_BASE}{path}" with httpx.Client(timeout=timeout) as client: response = client.get(url, headers=_headers(), params=params) response.raise_for_status() return response.json()