zapcap_mcp_monitor_task
Monitor video processing task progress in the ZapCap API by tracking video and task IDs to check completion status.
Instructions
Monitor task progress
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"request": "<request>"
},
"name": "zapcap_mcp_monitor_task"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| request | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |
Implementation Reference
- src/zapcap_mcp_server/server.py:156-167 (handler)The handler function decorated with @mcp.tool that implements the logic to monitor the task progress by making a GET request to the ZapCap API using the provided video_id and task_id.
@mcp.tool(description="Monitor task progress") def zapcap_mcp_monitor_task(request: MonitorTask) -> Dict[str, Any]: headers = {"x-api-key": get_api_key()} with httpx.Client() as client: response = client.get( f"https://api.zapcap.ai/videos/{request.video_id}/task/{request.task_id}", headers=headers ) response.raise_for_status() return response.json() - Pydantic BaseModel defining the input parameters for the zapcap_mcp_monitor_task tool: video_id and task_id.
class MonitorTask(BaseModel): video_id: str = Field(description="Video ID") task_id: str = Field(description="Task ID") - Helper function to retrieve and validate the ZAPCAP_API_KEY from environment variables, used by the tool handler.
def get_api_key() -> str: api_key = os.getenv("ZAPCAP_API_KEY") if not api_key: raise ValueError("ZAPCAP_API_KEY environment variable is required") return api_key