get_task_progress
Check the status of PowerPoint generation tasks and retrieve download links when completed. Use this tool to monitor progress for presentations created through the iFlytek PPT service.
Instructions
查询PPT生成任务进度。
使用说明:
1. 用于查询通过create_ppt_task或create_ppt_by_outline创建的任务进度。
2. 需定期轮询本工具直到任务完成。
3. 任务完成后,可从返回结果中获取PPT下载地址。
4. 需先设置环境变量AIPPT_APP_ID和AIPPT_API_SECRET。
参数:
- sid: 任务ID,从create_ppt_task或create_ppt_by_outline工具获取。
返回:
包含任务状态和PPT下载地址的字典。
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sid | Yes |
Implementation Reference
- src/zwppt_mcp/server.py:146-174 (handler)The main handler function for the 'get_task_progress' tool. It takes a task ID (sid) and queries the progress from the xfyun API, returning the raw response text which includes status and download URL when complete. The function signature and docstring provide the input schema.@mcp.tool() def get_task_progress( ctx: Context, sid: str ) -> Dict[str, Any]: """ 查询PPT生成任务进度。 使用说明: 1. 用于查询通过create_ppt_task或create_ppt_by_outline创建的任务进度。 2. 需定期轮询本工具直到任务完成。 3. 任务完成后,可从返回结果中获取PPT下载地址。 4. 需先设置环境变量AIPPT_APP_ID和AIPPT_API_SECRET。 参数: - sid: 任务ID,从create_ppt_task或create_ppt_by_outline工具获取。 返回: 包含任务状态和PPT下载地址的字典。 """ url = f"https://zwapi.xfyun.cn/api/ppt/v2/progress?sid={sid}" headers = get_headers() response = requests.get(url, headers=headers) if response.status_code != 200: raise Exception(f"调用失败: {response.text}") return response.text