Skip to main content
Glama

Set expression

cavalry_set_expression
Idempotent

Set or clear a JavaScript expression on a layer attribute to dynamically control its value. Use an empty string to remove the expression.

Instructions

Set (or clear, with an empty string) a JavaScript expression on an attribute.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
attrIdYesAttribute path, e.g. "position.x", "rotation", "material.materialColor".
layerIdYesCavalry layer id, e.g. "basicShape#1". Use cavalry_list_layers to find ids.
expressionYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

B3.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, idempotentHint=true, destructiveHint=false, and openWorldHint=false, so the safety profile is covered. The description adds one genuinely useful behavior beyond them: an empty string clears the expression rather than setting it. It does not disclose what happens to an existing expression, whether errors surface, or permission requirements.

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?

A single front-loaded sentence with no filler and the primary operation stated first, followed by the clear-semantics in parentheses. It is efficient, though arguably terse for a mutation tool with three required parameters.

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

Completeness3/5

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

With no output schema and an existing annotation set, the description covers the essentials but leaves gaps an agent would care about for a write tool: whether an expression replaces an existing one, how expression errors are reported, and whether the attribute must already exist. Adequate but not complete.

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 67%: attrId and layerId are documented (the latter pointing to cavalry_list_layers), but the required 'expression' parameter has no schema description. The description compensates by establishing that the value is a JavaScript expression and that an empty string clears it, which is meaning the schema alone does not provide.

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?

States a specific verb (Set) and resource (a JavaScript expression on an attribute), with a clear secondary operation (clear via empty string). It is distinguishable from cavalry_set_attributes and cavalry_add_dynamic_attribute by acting on expressions specifically, though it never names a sibling to sharpen 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 Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It documents the empty-string clearing trick, which is a usage rule, but gives no when-to-use versus alternatives such as cavalry_set_attributes, cavalry_add_dynamic_attribute, or cavalry_connect. No prerequisites (e.g., needing a layer id from cavalry_list_layers) are stated even though the schema hints at it.

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