pi_result
Retrieves the final result of an asynchronous task dispatched with async=true, returning progress while it runs or the complete result when finished, with optional waiting and persisted storage.
Instructions
取回异步任务的最终结果。(pi_execute 带 async=true 派发的那些)
按任务当前状态返回不同内容: · 还在跑 → 返回进度(当前阶段/当前工具),可加 waitMs 就地等一会再返回 · 已完成 → 返回完整结果:验收结论、证据链、返工/升档轨迹、工具轨迹 —— 与同步模式一字不差
【结果会存住】写内存 + 磁盘(~/.pi-bridge/tasks/,滚动保留最近 200 个)。
所以:进程重启、换了会话,照样能取回 —— 不会出现『任务跑完了但结果丢了』。
【典型用法】 · 派完先干别的:pi_execute(..., async=true) → (干自己的活)→ pi_result(taskId="t-xxx") · 派完就地等: pi_execute(..., async=true) → pi_result(taskId="t-xxx", waitMs=180000) · 汇报进度: pi_result(taskId="t-xxx") → 若在跑,返回当前阶段
注意:同步派发的任务不需要用本工具 —— 结果在 pi_execute 返回时就给你了。
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": {
"taskId": "<taskId>"
},
"name": "pi_result"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| purge | No | 可选:取完后从内存表移除(磁盘记录仍按最近 200 个滚动保留)。默认 false。 | |
| taskId | Yes | 异步任务的 taskId(来自 pi_execute(async=true) 的返回,或 pi_status 的 asyncTasks 一节)。 | |
| waitMs | No | 可选:任务还在跑时就地等待的毫秒数(1–600000,默认 0=不等,立刻返回进度)。 |