get_task_progress
Track the progress of PPT generation tasks created via create_ppt_task or create_ppt_by_outline. Poll the tool regularly to retrieve task status and access the PPT download link upon completion.
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 complete implementation of the get_task_progress tool, including registration via @mcp.tool(), type hints serving as schema, and the handler logic that queries the external API for task progress using the sid parameter.@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