Skip to main content
Glama

create_workflow

Build deterministic, resumable DAG workflows from named steps with dependencies, boolean gates, and sandboxed auto-agent execution, validating structure and cycles on creation.

Instructions

新建工作流。steps 为数组,每项 {id?, title, instruction?, dependsOn?, gate?, mode?, agentPrompt?, model?, timeoutMs?, maxRetries?, tools?, maxTurns?, outputSchema?, verify?, sandboxCwd?};gate 是布尔表达式(支持 && || ! 和括号),只允许引用该步骤的直接依赖,依赖落定后求值为假则该步骤被自动跳过。mode=auto 的步骤可被 run_workflow 自动执行:每个 auto 步骤由服务器内 agent 循环驱动(多轮工具调用:读/写文件、列目录、grep、bash、fetch_url,全部限定在 sandboxCwd 沙箱内);tools 为该步工具白名单,maxTurns 为循环轮数上限(默认取 WORKFLOW_MAX_TURNS,8),outputSchema 为结果 JSON Schema(不符自动重试一轮),verify 为完成后的质量关(JS 布尔断言或 reviewer 提示词),sandboxCwd 覆盖该步沙箱目录。顶层 finalVerify(提示词)在全部步骤落定后做整体一致性检查。创建时即做结构、环与 id 合法性校验。

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": {
      "name": "<name>",
      "steps": "<steps>"
    },
    "name": "create_workflow"
  }
}

Input Schema

NameRequiredDescriptionDefault
nameYes工作流名称(用于生成 id,非唯一)
stepsYes
descriptionNo目标/总纲,一句话
finalVerifyNo流程级整体一致性检查提示词;全部步骤落定后由模型审核,结论记入 flow.finalVerifyResult(不改步骤状态)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.1.0

TDQS

A3.7/5.0
Behavior4/5

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

With no annotations at all, the description carries the full burden and does much of it: creation-time structural, cycle, and id validation; gate expressions evaluated after dependencies settle with automatic skipping; auto steps driven by a server-side agent loop confined to sandboxCwd; fetch_url requiring WORKFLOW_ALLOW_NET=1; outputSchema mismatches retrying once then failing; verify failures counting toward maxRetries. What is missing is the response (e.g., whether a generated workflow id is returned) and any permission/auth requirements.

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

Conciseness3/5

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

The purpose is front-loaded and every clause conveys substance, but it is a single semicolon-chained paragraph with no breaks, making it hard to scan. For a tool this complex the length is defensible; the formatting is not.

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 nested-configuration tool with no annotations and no output schema, the definition covers step execution modes, sandboxing, retries, verification, and validation thoroughly. The notable remaining gap is the return value — the description never says what a successful creation yields (such as a workflow id) that later tools would need.

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 75%, which already sets a 3 baseline; the description adds real meaning beyond it, notably that gate supports && || ! and parentheses and may only reference direct dependencies, that a false gate skips the step, and that finalVerify records into flow.finalVerifyResult without changing step statuses. It also restates the step field list, which is somewhat redundant with the schema.

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

Purpose4/5

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

"新建工作流" gives a specific verb+resource, and the description immediately scopes what a workflow is (named, ordered steps with gates, manual/auto modes). It distinguishes itself from run_workflow by explaining that auto steps are what run_workflow executes, but it never contrasts itself with validate_workflow despite claiming creation-time structure/cycle/id validation.

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

Usage Guidelines3/5

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

There is no explicit "use this when / not when" statement, but usage is strongly implied: the definition lays out the creation-time contract and the manual vs auto step distinction, so an agent can infer this is the entry point for defining a workflow before running it. No guidance is given on when to prefer validate_workflow or how this relates to editing an existing workflow.

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