Skip to main content
Glama

ACTION_SET_VARIABLE

Set or update a workflow variable, interpolate ${var} in strings, convert to string/int/bool/float, and return a variable snapshot; null or failed conversion deletes it.

Instructions

设置一个变量。含 ${var} 的值插值后是字符串;后续要做数字运算/比较时设 type=int 或 float。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。

Input Schema

NameRequiredDescriptionDefault
nameYes变量名(也认:key)
typeNo类型转换,auto=保持原类型(默认 auto)
valueNo变量值,任意 JSON 值;字符串支持 ${var};为 null 或转换失败时删除该变量
requireNo执行后要求为 true 的变量名(如 click_success),不满足按出错处理
on_errorNo节点出错时:skip=跳过继续(默认),stop=停止整个工作流
node_timeout_msNo单节点超时毫秒,0=不限;默认 30 分钟

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.4/5.0
Behavior3/5

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

With no annotations at all, the description must carry the behavioral load, and it does disclose two non-obvious traits: ${var} interpolation always yields a string, and the result is returned as a variable snapshot JSON. It says nothing about failure handling, overwriting existing variables, or the effect of require/on_error, all of which are mutation-relevant behaviors left entirely to the schema.

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?

Three short clauses, but interpolation is stated twice ("含 ${var} 的值插值后是字符串" and "字符串参数支持 ${var} 插值") and there is a stray double period ("float。。"). The most useful fact — the returned variable snapshot JSON — is buried at the end rather than front-loaded.

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 6-parameter workflow mutation tool with 100% schema coverage and no output schema, the description covers the core semantics plus the return shape (variable snapshot JSON), which is what an agent most needs. The gaps are failure/overwrite behavior and the require/on_error interaction, but those are documented in the schema.

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 description coverage is 100%, so the baseline is 3. The description does add a rationale the schema lacks — that type=int/float is needed specifically for later arithmetic/comparison — and generalizes ${var} interpolation to string parameters, but it never touches name, require, on_error or node_timeout_ms.

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 ("设置一个变量" / set a variable), which unambiguously separates it from data-producing siblings like ACTION_MATH, ACTION_ARRAY or ACTION_PARSE_JSON. It does not, however, name any sibling or state its scope relative to them (e.g. workflow-local vs global variables).

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: the mention that you should set type=int or float when later steps need numeric operations/comparison gives a real decision rule for one parameter. There is no statement of when to use this tool versus alternatives such as ACTION_ARRAY or ACTION_WORKSPACE, and no exclusions or prerequisites.

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