Skip to main content
Glama

ACTION_MATH

Performs add, subtract, multiply, divide, modulo, and power calculations on numeric or interpolated operands, returning the result as a workflow variable.

Instructions

两个数的四则、取模、乘方运算。输出:math_result。结果总是小数(如 5.0),CONDITION_SWITCH 用 == 比较时要写 5.0,或改用 > / <;除数为 0 时结果为 0;无法解析的操作数按 0。。字符串参数支持 ${var} 插值;结果以变量快照 JSON 返回。

Input Schema

NameRequiredDescriptionDefault
aNo第一个操作数:数字、${var} 或数字变量名(默认 0)(也认:operand1_var)
bNo第二个操作数:数字、${var} 或数字变量名(默认 0)(也认:operand2、operand2_var)
requireNo执行后要求为 true 的变量名(如 click_success),不满足按出错处理
on_errorNo节点出错时:skip=跳过继续(默认),stop=停止整个工作流
operationYes运算类型
output_varNo结果变量名(默认 math_result)
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 behavioral burden and does well: it discloses that all results are decimals, that division by zero yields 0, that unparseable operands are treated as 0, that ${var} interpolation is supported, and that output is a variable-snapshot JSON. It does not explain the error-flow semantics of require/on_error, but those are documented in 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.

Conciseness4/5

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

Content is front-loaded and dense, with the operation scope first and caveats after; every clause conveys real information. Minor blemishes: a stray doubled period ('。。') and a run-on sentence chained with semicolons that mixes output type, comparison caveats, and error behavior.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 7-parameter math node with no annotations and no output schema, the description covers the essentials an agent needs: output variable, return format, numeric type coercion, interpolation, and zero/parse failure edge cases. The remaining parameters (require, on_error, node_timeout_ms) are fully described in the schema, so nothing critical is missing.

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 every parameter already carries its own description, which sets the baseline at 3. The description adds only marginal extra meaning, notably that string parameters support ${var} interpolation, a point the schema also touches on.

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 precise verb+resource: arithmetic on two numbers covering the four basic operations, modulo, and power, and names the default output variable math_result. An agent can tell this apart from siblings like ACTION_TEXT_OPERATION or ACTION_ASSERT, though it never explicitly contrasts itself with them.

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 guidance is indirect: it warns that results are always floats and that CONDITION_SWITCH must compare with 5.0 under == or use > / <, which is genuinely actionable downstream advice. However, it never states when to pick this tool over alternatives such as ACTION_RANDOM, ACTION_SET_VARIABLE, or ACTION_ASSERT, so guidance is implied rather than explicit.

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