Skip to main content
Glama

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

NameRequiredDescriptionDefault
purgeNo可选:取完后从内存表移除(磁盘记录仍按最近 200 个滚动保留)。默认 false。
taskIdYes异步任务的 taskId(来自 pi_execute(async=true) 的返回,或 pi_status 的 asyncTasks 一节)。
waitMsNo可选:任务还在跑时就地等待的毫秒数(1–600000,默认 0=不等,立刻返回进度)。

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.2.0

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the full burden, and it does substantial work: it explains that behavior varies by task state (running → progress info; completed → full result identical to sync mode) and that results persist in memory and on disk under ~/.pi-bridge/tasks/ with a rolling retention of 200, surviving process restarts and session changes. It does not cover failure behavior, such as what happens with an unknown or expired taskId, which is the main remaining gap.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded headline in bold, followed by clearly labeled sections (state-dependent returns, persistence, typical usage, caveat). The three dated example call sequences repeat async=true redundantly and could be compressed, but no section is filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no annotations, no output schema, and three parameters, the description supplies what the structured fields cannot: state-dependent return content, persistence guarantees, and waiting semantics. It stops short of describing the concrete result envelope, but it enumerates the completed-result components (acceptance conclusion, evidence chain, rework/escalation trace, tool trace), which is enough to call and interpret the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds meaning beyond the schema by showing waitMs used concretely (pi_result(taskId="t-xxx", waitMs=180000)) as the "wait in place instead of polling" pattern, and by framing taskId's provenance in terms of the overall workflow. Purge is left entirely to the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

State a specific verb and resource ("取回异步任务的最终结果"), and immediately scope it to tasks dispatched by pi_execute with async=true, which distinguishes it from pi_status and pi_cancel. The parenthetical routing note lets an agent identify the tool without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides three explicit usage patterns (dispatch-then-work, dispatch-then-wait-in-place, progress reporting) and an explicit exclusion: synchronous dispatches do not need this tool because pi_execute already returned their results. When-to-use and when-not-to-use are both stated.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools