get_task_status
Check the status of a presentation generation task by ID, and retrieve the request ID upon completion to obtain the download URL.
Instructions
Get the current task status and result by task ID.
When the task completes, the result will contain a request_id.
Use the request_id with the downloadPresentation tool to get the download URL.
Possible statuses:
- PENDING: Task is queued
- SENT: Task has been sent for processing
- PROCESSING: Task is being processed
- SUCCESS: Task completed — result contains presentation_id and request_id
- FAILED: Task failed — result contains error details
If status is PENDING, SENT, or PROCESSING, poll again in a few seconds.Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| task_id | Yes |
Implementation Reference
- slidespeak.py:336-384 (handler)The get_task_status MCP tool handler function. It takes a task_id, calls the SlideSpeak API at /task_status/{task_id} to check the status, and returns a formatted response. Handles statuses: PENDING, SENT, PROCESSING, SUCCESS, and FAILED.
@mcp.tool() async def get_task_status(task_id: str) -> str: """ Get the current task status and result by task ID. When the task completes, the result will contain a request_id. Use the request_id with the downloadPresentation tool to get the download URL. Possible statuses: - PENDING: Task is queued - SENT: Task has been sent for processing - PROCESSING: Task is being processed - SUCCESS: Task completed — result contains presentation_id and request_id - FAILED: Task failed — result contains error details If status is PENDING, SENT, or PROCESSING, poll again in a few seconds. """ if not API_KEY: return "API Key is missing. Cannot process any requests." status = await _make_api_request("GET", f"/task_status/{task_id}", timeout=POLLING_TIMEOUT) if not status: return f"Failed to fetch status for task {task_id}." task_status = status.get("task_status") task_result = status.get("task_result") if task_status == "SUCCESS": request_id = None if isinstance(task_result, dict): request_id = task_result.get("request_id") result_str = json.dumps(status) if request_id: result_str += ( f"\n\nThe presentation is ready! Use downloadPresentation with " f"request_id '{request_id}' to get the download URL." ) return result_str elif task_status == "FAILED": return f"Task {task_id} failed. Details: {json.dumps(status)}" elif task_status in ("PENDING", "SENT", "PROCESSING"): return ( f"Task {task_id} is still {task_status.lower()}. " f"Please call getTaskStatus again in a few seconds." ) return json.dumps(status) - slidespeak.py:336-336 (registration)The @mcp.tool() decorator on line 336 registers get_task_status as an MCP tool with the FastMCP server.
@mcp.tool()