Skip to main content
Glama

ACTION_ASSERT

Assert a condition and fail the current workflow node when it is false, routing execution into error handling catchable by on_error, try/catch, or retry.

Instructions

断言:条件为假时让本节点失败,进入错误处理。失败按节点出错处理,可被 on_error、ACTION_TRY_CATCH、ACTION_RETRY 捕获。运算符 ==、!=、>、<、>=、<=(无 contains);两边先按变量名取值,取不到当字面值;不支持 ${var},值不加引号。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。

Input Schema

NameRequiredDescriptionDefault
messageNo失败时的错误信息(写入 last_error)
requireNo执行后要求为 true 的变量名(如 click_success),不满足按出错处理
on_errorNo节点出错时:skip=跳过继续(默认),stop=停止整个工作流
conditionYes条件:变量名 运算符 值(如 x == 6),或布尔变量名
node_timeout_msNo单节点超时毫秒,0=不限;默认 30 分钟

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.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, the description carries the full burden and does substantial work: it discloses failure semantics, the catch mechanisms, the supported operator set (and that contains is absent), operand resolution order (variable first, then literal), and the return shape (variable snapshot JSON). Missing pieces are permission/timeout behavior, but node_timeout_ms is documented in the schema, so the gap is small.

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 purpose and failure consequence are front-loaded in the first clause, and the description is compact for the amount of rule detail it conveys. It is marred by a doubled full stop ('。。') and by packing operator rules, resolution order, and interpolation into one dense run, which slightly hurts readability.

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 five-parameter, mutation-of-control-flow tool with no annotations and no output schema, the description covers the essentials: what failure means, how it is caught, how operands are evaluated, and that results come back as a variable snapshot. Only minor gaps remain, such as interaction with the require parameter, which the schema already documents.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so all five parameters already carry descriptions and the baseline is 3. The description adds real meaning about the condition syntax and the variable-vs-literal resolution rule, but that overlaps with the schema's own condition description, and it never explains require or message beyond what the schema says.

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 opens with a specific verb+resource: an assertion that fails the node when the condition is false and routes to error handling. That is clearly distinguishable from data-manipulation siblings like ACTION_SET_VARIABLE or ACTION_MATH. It stops short of naming CONDITION_SWITCH/CONDITION_ADVANCED_SWITCH, the closest alternatives, so it doesn't earn a 5.

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?

It explains the failure path concretely (on_error, ACTION_TRY_CATCH, ACTION_RETRY can catch it), which tells an agent how this fits into control flow. However, there is no explicit statement of when to choose ASSERT over CONDITION_SWITCH, nor any when-not guidance. Usage is implied rather than prescribed.

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