Skip to main content
Glama
songzhifei512

multi-agent-bridge

agent_invoke

Invoke any registered agent by name to run a task, with automatic retries and session resumption for long-running jobs.

Instructions

Invoke any registered agent by name to run a task. Generic path over the Agent Registry — same driver as the run_* tools but name-driven, so new agents (e.g. qwen) need no per-agent tool. Non-blocking. Auto-tracks task. Pass session_id to resume a prior session (the captured id is returned for reuse). auto is honored by agents that support it (codex, qwen); others ignore it. Use agent_list to see available names. Retries automatically on 429/rate-limit/timeout with exponential backoff (default 2 retries, 3 total attempts); set max_retries=0 to disable. 【后台契约】调用可立即返回/被调用方撤回:server 端 Promise 不会因调用方撤回而终止,worker 继续在后台跑到完成,结果落 task.result(及 trace,若 capture_trace);调用方随时可用返回的 task_id 经 task_list 或面板 /api/state 取最终产物,无需阻塞等本次调用返回。给长任务(评估/设计/重构, prompt>2000字)显式传 timeout_sec 600~900 防误杀;传 plan_mode 只读调研不落盘。【默认worker】name 可选:省略 或 指定==控制主控(BRIDGE_CONTROLLER) 时,改从空闲 worker 池轮询派一个(排主控,不压 main;全忙回退主控/或 qwen),返回文案标注实际 worker。【备路】name 明确且该 worker 已忙(agent_live busy/有 running 任务)时自动改派空闲备路 worker(排控制主控,不压 main),返回文案标注改派;same_worker:true 强制精确同名、auto_fallback:false 关备路。

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
autoNo
nameNoagent_invoke 默认worker:可选,省略或==BRIDGE_CONTROLLER 时从空闲 worker 池轮询派一个(排主控)而非固定压主控
modelNo
promptYes
task_idNo
workdirNo
plan_modeNo Plan 模式:只读调研,强制关 auto,产出方案不落盘
session_idNo
max_retriesNo
same_workerNoagent_invoke 备路:true 强制精确同名,不自动改派
timeout_secNo
fork_on_failNo A 失败自动 fork:真失败时父 superseded + 生成备选子任务给此 agent 承接(仅工作流任务,≤3 上限)。不传不自动 fork。
retry_max_msNo
auto_approvalNo 成功时对产物跑 blocklist 硬扫,命中即自动放行被拒(auto_refused)。默认关。
auto_fallbackNoagent_invoke 备路:false 关闭忙时自动改派
capture_traceNo 捕获完整推理 step 流存 task.trace,默认 false
retry_base_msNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure, and it delivers extensively. It discloses that invocation is non-blocking, auto-tracks tasks, retries with exponential backoff (default 2 retries), continues running in the background even if the caller detaches, and persists results to task.result/trace. It also details worker-pool assignment, busy-worker fallback, and the semantics of same_worker/auto_fallback — far beyond what annotations would have provided.

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?

The description is quite long, but it is front-loaded with the core purpose and uses labeled Chinese sections (【后台契约】,【默认worker】,【备路】) to organize complex behavioral rules. Dense parentheticals and mixed-language phrasing reduce readability slightly, but most content earns its place given the tool's 17 parameters and intricate dispatch behavior.

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?

Given no output schema and no annotations, the description does a strong job covering return semantics: it mentions the returned task_id for reuse, task.result for final output, and the panel /api/state endpoint for retrieval. It also covers retries, timeouts, worker selection, and fallback. However, a few parameters remain undocumented (model, workdir, task_id, retry timing), and the description never states what exactly the invocation response contains beyond the task_id, leaving some gaps for such a complex tool.

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 description coverage is only 41%, so the description must compensate. It does explain many parameters: session_id resumption, max_retries default/disable, timeout_sec for long tasks, plan_mode, same_worker, auto_fallback, fork_on_fail, auto_approval, and capture_trace. However, several parameters — model, workdir, task_id, retry_max_ms, and retry_base_ms — are left unexplained in both the schema and the description, leaving semantic gaps.

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?

The description opens with a specific, unambiguous statement: 'Invoke any registered agent by name to run a task.' It further distinguishes itself from the run_* sibling tools by calling itself the 'Generic path over the Agent Registry' and name-driven, which clearly separates it from per-agent tools like run_codex. The reference to agent_list for discovering names adds practical purpose context.

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?

The description explicitly frames when to use this tool versus alternatives: use the generic name-driven path when a new agent (e.g. qwen) lacks a per-agent tool, and consult agent_list to see available names. It also gives clear operational guidance: pass session_id to resume, set timeout_sec for long tasks, use plan_mode for read-only research, and control fallback with same_worker/auto_fallback. This is strong, actionable routing guidance.

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