update_numeric_expression
Edit an existing Numeric Expression in place — its id never changes, so every existing recall of it ({{exp:<id>}} in other expressions, question text/description, Thank You screen text, or a condition's valueRef) keeps resolving correctly afterward. Identify the expression with expressionId or its current label. Only the fields you provide are changed; everything else is left as-is. This is also how "Price" gets its formula set: it already exists on every survey (pre-seeded, id "price", no formula yet) — use expressionId: "price" here rather than add_numeric_expression, which refuses to create a second one. Provide terms to replace the base formula entirely — this is a whole-list replace, not a merge; include every term you want kept. Same term shapes as add_numeric_expression: a question, another expression, a literal value, or a parenthesized group, combined with +/-/*// — full arithmetic, matching the builder's own eval()-based formula box, not just addition/subtraction. Provide conditions to replace the whole conditional-override list ([] removes all conditions and falls back to the base formula only). Provide newLabel to rename it (subject to the same name-collision rules as add_numeric_expression). The response includes recallToken ({{exp:<id>}}) for later use — ONLY if the user separately asks to display the score somewhere, paste it into update_question / update_thankyou_screen. Don't insert it anywhere on your own initiative.
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": {
"surveyId": "<surveyId>"
},
"name": "update_numeric_expression"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | No | The expression's CURRENT name, to identify it if you don't have its id. Provide this OR expressionId. | |
| terms | No | Replace the base formula's terms entirely (whole-list replace). Omit to leave the base formula unchanged. | |
| teamId | No | Which team workspace to act in (ids come from get_account_info or list_surveys). Optional: if omitted, the server uses the team that owns the given surveyId, or your only team. Required for create_survey when you belong to several teams. | |
| newLabel | No | Rename the expression to this. Omit to keep the current name. | |
| surveyId | Yes | The Survey ID containing the expression | |
| conditions | No | Replace the whole conditional-override list entirely (whole-list replace). Pass [] to remove all conditions. Omit to leave conditions unchanged. | |
| expressionId | No | The expression's id, as seen in get_numeric_expression's or add_numeric_expression's output. Provide this OR label. | |
| recalculateFlag | No | Recalculate this expression live on the results screen. Omit to leave unchanged. | |
| executeOncePerResponse | No | Freeze the computed value after the first time it's set for a given response. Omit to leave unchanged. |