Skip to main content
Glama

run_workflow

Execute resumable DAG workflows automatically: run ready steps in parallel batches, validate outputs, retry failed steps, and advance gates until completion or blockage.

Instructions

自动执行工作流:编译 READY 步骤,互不依赖的 auto 步骤批内并行、批间串行;跑完自动推进门条件,循环直到完成/卡住,全程可断点续跑(已 done 的步骤绝不重跑)。每个 auto 步骤由服务器内 agent 循环执行(多轮工具调用:读写文件/列目录/grep/bash/fetch_url,限定在沙箱内),之后过 outputSchema/verify 质量关;配了 finalVerify 且全部落定后做整体一致性检查。方案A(配置了 LLM_BASE_URL/LLM_API_KEY 时)直调 LLM API,支持 OpenAI 与 Anthropic 兼容端点(LLM_PROTOCOL 或按 URL 识别);未配置密钥或 mode=dispatch 时自动退化为方案B(返回派发批次,由宿主并行执行后 complete_step 回填)。某步失败(含质量关未过)按 maxRetries 重试后仍失败则只标记该步 failed(视为落定、门条件中为 false),其余分支照常推进,不会整条流崩;manual 步骤不会被代跑,会提示待人工处理。同一条流同时只允许一个执行,运行中可用 cancel_run 打断。

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": {
      "id": "<id>"
    },
    "name": "run_workflow"
  }
}

Input Schema

NameRequiredDescriptionDefault
idYes
modeNoauto=强制方案A(需密钥);dispatch=强制方案B;缺省=有密钥走A否则B
maxConcurrencyNo并行上限(默认取 LLM_MAX_CONCURRENCY 环境变量,缺省 4;硬上限 32)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A4.5/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so thoroughly: idempotent resumption ('已 done 的步骤绝不重跑'), per-step agent loops confined to a sandbox, outputSchema/verify and finalVerify quality gates, retry via maxRetries with only the failing step marked failed and gates evaluating false, and failure isolation so the whole run does not collapse. It also discloses the concurrency lock and cancellation route.

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 core behaviour (execute the workflow, then loop on gates) is front-loaded, and every clause contributes operational detail. It is delivered as one dense block of semicolon-separated clauses, which is information-efficient but harder to scan than a short structured list would be.

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 complex orchestrator with no output schema and no annotations, the description covers execution model, mode fallback, quality gates, retry and failure semantics, and resumption. It does not describe what an auto-mode invocation returns, though dispatch mode's return is characterised.

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 67%, and the description adds meaning beyond the field docs: it explains that mode governs plan A versus plan B and what dispatch actually yields (batches returned for the host to execute and backfill via complete_step), and that parallelism applies only to mutually independent auto steps. The maxConcurrency defaults and hard limit remain only in 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?

The description opens with a specific verb+resource ('自动执行工作流') and then defines the execution model precisely: compiling READY steps, parallelising independent auto steps within a batch and serialising across batches, advancing gates until completion or stall, with resumability. It is clearly distinguishable from siblings such as cancel_run (named for interruption) and dispatch_batches (surfaced via mode=dispatch).

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?

It gives explicit selection logic between the two execution modes: plan A when LLM_BASE_URL/LLM_API_KEY are configured (or mode=auto), plan B when keys are absent or mode=dispatch. It also states exclusions such as manual steps not being auto-run and the single-execution lock, naming cancel_run as the interrupt path. It stops short of explicitly contrasting with next_step or complete_step as alternatives.

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