Set expression
cavalry_set_expressionSet 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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"layerId": "<layerId>",
"attrId": "<attrId>",
"expression": "<expression>"
},
"name": "cavalry_set_expression"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| attrId | Yes | Attribute path, e.g. "position.x", "rotation", "material.materialColor". | |
| layerId | Yes | Cavalry layer id, e.g. "basicShape#1". Use cavalry_list_layers to find ids. | |
| expression | Yes |