get_job_status
Retrieve the current status and completed result of a SPARKIT job by providing its job ID. Use this to check if a prior research task has finished or to revisit a previous result.
Instructions
Fetch the current status (and result if done) of a SPARKIT job.
Use this when research returned before the job finished, or to
revisit a previous result by id.
Args:
job_id: The id returned by a prior research call.
Returns the cited Markdown report if the job has completed, a status line if it's still running, or a failure message otherwise.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| job_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- sparkit_mcp/server.py:213-239 (handler)The tool handler for get_job_status. Fetches job by ID via SparkitClient and returns the Markdown report (if completed), failure message (if failed/cancelled), or a status line (if still running).
@mcp.tool() async def get_job_status(job_id: str) -> str: """Fetch the current status (and result if done) of a SPARKIT job. Use this when ``research`` returned before the job finished, or to revisit a previous result by id. Args: job_id: The id returned by a prior ``research`` call. Returns the cited Markdown report if the job has completed, a status line if it's still running, or a failure message otherwise. """ if not job_id or not job_id.strip(): return "Error: `job_id` is required." try: async with SparkitClient() as client: job = await client.get_job(job_id.strip()) except SparkitAPIError as e: return _format_api_error(e) if job.status == "completed": return _format_completed(job) if job.status in {"failed", "cancelled"}: return _format_terminal_failure(job) return f"Job `{job.job_id}` is currently {job.status}."