Skip to main content
Glama

CONDITION_ADVANCED_SWITCH

Evaluate a conditional expression with variable interpolation, then route the workflow to its true or false branch node. Handles numeric and string comparisons plus daytime/nighttime checks.

Instructions

高级条件分支:表达式先插值,两边都可以是变量或字面值。插值后每一侧若是已定义的变量名就取其值,否则当字面值;数字比较只认数字类型变量,字符串变量请写成 ${var}。contains/startswith/endswith 不区分大小写且两侧要有空格;内置 is_daytime / is_nighttime(8:00–17:59 为白天)。分支写在 branches(true/false → 节点 id),不走 next。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。

Input Schema

NameRequiredDescriptionDefault
varNo拆分写法:左侧变量名
valueNo拆分写法:右侧值
requireNo执行后要求为 true 的变量名(如 click_success),不满足按出错处理
on_errorNo节点出错时:skip=跳过继续(默认),stop=停止整个工作流
operatorNo拆分写法:运算符(也认:op)
expressionNo条件表达式,支持 ${var},如 ${score} > 10、is_daytime;不填则用 var/operator/value 组装
node_timeout_msNo单节点超时毫秒,0=不限;默认 30 分钟

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

With no annotations, the description carries the full burden and does so well: it discloses the interpolation-then-resolution rule (defined variable name → value, otherwise literal), that numeric comparisons only accept numeric-typed variables while string variables must be written `${var}`, that contains/startswith/endswith are case-insensitive and require surrounding spaces, that branching uses `branches` rather than `next`, and that results come back as a variable snapshot JSON. It could still say what happens when neither branch key matches or what the snapshot contains.

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 concept is front-loaded in the first clause and every subsequent clause carries usable semantics (typing, operators, built-ins, branching, return shape) rather than filler. It is dense and semi-colon-chained without headings, and it ends with a stray trailing punctuation, so it is packed rather than elegant.

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 7-parameter, zero-required, no-output-schema workflow node with no annotations, the description covers evaluation semantics, operator quirks, built-in predicates, branch routing, and the return form. Gaps remain around the shape of `branches` (no example object) and default routing when a branch key is missing.

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 genuine meaning: it explains how `expression` relates to the `var`/`operator`/`value` trio, how each side of a comparison is resolved after interpolation, and the type pitfalls of numeric vs string variables. The `${var}` escaping rule for string variables is exactly the kind of guidance the schema cannot express.

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?

The description states a specific resource (conditional branch node) and its mechanism: expression interpolation, comparison, and branching via `branches` keys mapped to node ids. It is clearly a conditional-branch tool, but it never mentions the sibling CONDITION_SWITCH, so an agent cannot tell from the text alone why it should pick the 'advanced' variant.

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?

Usage is only implied by the mechanics: use `expression` or the split `var`/`operator`/`value` form, and `require` when asserting a post-condition. There is no explicit statement of when this node should be chosen over CONDITION_SWITCH or over ACTION_ASSERT, and no stated prerequisites.

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