Skip to main content
Glama

ACTION_TRY_CATCH

Branches workflow execution into success or error paths based on whether the immediately preceding node failed, and captures the error details for later steps.

Instructions

按上一个节点是否失败走 success / error 分支。输出:exception_msg。只看紧挨着的上一个节点:失败指抛异常、超时或 require 不满足;多数节点出错只是 xxx_success=false,要在上一节点加 require(如 file_success)才算失败。分支写在 branches(success/error → 节点 id),不走 next,success 分支也要写,缺的分支即该路径结束。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。

Input Schema

NameRequiredDescriptionDefault
requireNo执行后要求为 true 的变量名(如 click_success),不满足按出错处理
on_errorNo节点出错时:skip=跳过继续(默认),stop=停止整个工作流
catch_varNo出错时写入错误信息的变量名(默认 exception_msg)
node_timeout_msNo单节点超时毫秒,0=不限;默认 30 分钟

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.3/5.0
Behavior5/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: it discloses the branch topology (branches map, not next), that the success branch is mandatory, that a missing branch terminates that path, that only the immediately preceding node is inspected, and that string params support ${var} interpolation with results returned as a variable-snapshot JSON. These are exactly the non-obvious behaviors that cause misconfiguration.

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

Conciseness5/5

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

It is dense but every sentence carries information — scoping rule, failure definition, the require workaround, branch structure, and interpolation/output format. The key constraint (only the previous node) is front-loaded. There is a stray duplicated punctuation mark ('。。') but no wasted content.

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 control-flow node with four optional parameters, no output schema, and no annotations, the definition covers branching semantics, failure detection, required upstream setup, and return shape. The only gap is the interaction between the catch node's own error handling and the on_error parameter, which is left to the schema field description.

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 real semantic depth the schema does not convey — specifically why `require` matters (errors that only set xxx_success=false are not treated as failures unless required upstream) and that catch_var's output is surfaced as exception_msg. The branches construct is also explained even though it is not an input property.

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 first sentence states a specific control-flow action — branch to success/error based on whether the previous node failed — and immediately scopes it to 'the immediately preceding node', which is non-obvious. It does not explicitly distinguish itself from sibling control-flow tools such as CONDITION_SWITCH, CONDITION_ADVANCED_SWITCH, or ACTION_RETRY, so an agent must infer the boundary.

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 concrete when-to-use mechanics: failure means exception, timeout, or an unsatisfied require, and it warns that most node errors only set xxx_success=false so an upstream require (e.g. file_success) is needed. That is actionable guidance an agent could not derive from the schema. It lacks explicit guidance on when to prefer CONDITION_SWITCH or ACTION_RETRY over this node.

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