Skip to main content
Glama
songzhifei512

multi-agent-bridge

run_qwen

Execute tasks with Qwen CLI via OpenAI-compatible endpoint, including document writing and image analysis. Supports auto file edits, session resumption, and automatic retries on rate limits.

Instructions

Async call Qwen CLI (qwen --auth-type openai, Qwen Code) to run a task. For writing/iterating docs & PPT (complements opencode) and image analysis (complements vision_analyze). Uses the qwen 端点 OpenAI-compatible endpoint via QWEN_ENV. --approval-mode auto-edit lets write_file land to disk (auto). Non-blocking. Auto-tracks task. Pass session_id to resume a prior Qwen session (preserves context — qwen has real resume via --resume, unlike opencode); the new session id is captured from JSON output and returned for later resumption. Retries automatically on 429/rate-limit/timeout with exponential backoff (default 2 retries, 3 total attempts); set max_retries=0 to disable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
autoNoqwen honors auto via --approval-mode auto-edit (write_file lands to disk). Default true.
modelNo
promptYes
task_idNo
workdirNo
plan_modeNo Plan 模式:只读调研,强制关 auto,产出方案不落盘
session_idNo
max_retriesNo
timeout_secNo
fork_on_failNo A 失败自动 fork:真失败时父 superseded + 生成备选子任务给此 agent 承接(仅工作流任务,≤3 上限)。不传不自动 fork。
retry_max_msNo
capture_traceNo 捕获完整推理 step 流存 task.trace,默认 false
retry_base_msNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.5/5.0
Behavior5/5

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

With zero annotations, the description carries the full behavioral burden and delivers extensively: async/non-blocking execution, automatic task tracking, auto-edit approval mode that lands write_file to disk, session resumption semantics with id capture, and automatic retry with exponential backoff on 429/timeout (default 2 retries, 3 attempts). This far exceeds the sparse schema's 31% coverage.

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 with purpose and use cases before behavioral details; nearly every sentence carries distinct information about invocation, sessions, or retry policy. Minor defects: the mixed-language 'qwen 端点' typo and slight redundancy where the OpenAI-compatible endpoint is mentioned twice.

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?

For a 13-parameter async tool with no output schema, the description covers invocation-critical behavior well: async semantics, session id capture/return for resumption, retry tuning, and file-landing approval mode. It omits semantics for several undocumented params and the task-tracking mechanism, but an agent can invoke the tool correctly with what is provided.

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 only 31%, so the description must compensate — and it does for the key params: session_id (resume with preserved context), max_retries (set to 0 to disable retries), and auto (maps to --approval-mode auto-edit). However, model, task_id, workdir, timeout_sec, and prompt have neither schema descriptions nor description coverage, leaving notable 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?

States a specific operation and resource ('Async call Qwen CLI (qwen --auth-type openai, Qwen Code) to run a task'). Names two concrete use cases — docs/PPT writing and image analysis — and explicitly maps one to a sibling complement ('complements vision_analyze'). An agent can tell this apart from the other run_* tools.

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

Usage Guidelines4/5

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

Provides clear context for when to use the tool ('For writing/iterating docs & PPT', 'image analysis (complements vision_analyze)') and a comparative differentiator ('qwen has real resume via --resume, unlike opencode'). Stops short of explicit when-not-to-use statements or routing to the run_codex/run_claude siblings.

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