Skip to main content
Glama

update_numeric_expression

Destructive

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

NameRequiredDescriptionDefault
labelNoThe expression's CURRENT name, to identify it if you don't have its id. Provide this OR expressionId.
termsNoReplace the base formula's terms entirely (whole-list replace). Omit to leave the base formula unchanged.
teamIdNoWhich 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.
newLabelNoRename the expression to this. Omit to keep the current name.
surveyIdYesThe Survey ID containing the expression
conditionsNoReplace the whole conditional-override list entirely (whole-list replace). Pass [] to remove all conditions. Omit to leave conditions unchanged.
expressionIdNoThe expression's id, as seen in get_numeric_expression's or add_numeric_expression's output. Provide this OR label.
recalculateFlagNoRecalculate this expression live on the results screen. Omit to leave unchanged.
executeOncePerResponseNoFreeze the computed value after the first time it's set for a given response. Omit to leave unchanged.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.8/5.0
Behavior5/5

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

Annotations already flag destructiveHint=true and idempotentHint=false, and the description backs that up with concrete destruction semantics: `terms` and `conditions` are whole-list replaces, not merges, and `[]` wipes all conditions. It also discloses behavior the annotations cannot: the id and every `{{exp:<id>}}` recall survive the edit, and renames are subject to the same collision rules as add_numeric_expression.

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?

Front-loaded with the single most important fact (the id and its recall tokens survive), then identification, then per-field semantics. It is long but dense and every paragraph carries distinct information; the 'whole-list replace, not a merge' point is restated from the schema and the closing recallToken paragraph could be tightened.

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 9-parameter mutation tool with no output schema, it covers identification (id or label), partial-update behavior, the server's response field (recallToken), and the special pre-seeded case. Nothing an agent needs to invoke it correctly is missing.

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 100%, so per-parameter documentation already exists; the description nonetheless adds the replace-vs-omit distinction, the `[]` clearing idiom, and the 'price' pre-seeded id, none of which are in the schema's expressionId text. Marginal gap: it doesn't add meaning for recalculateFlag or executeOncePerResponse beyond their schema wording.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Edit an existing Numeric Expression in place') and immediately distinguishes it from the sibling add_numeric_expression, including the concrete case where add would refuse (the pre-seeded 'price' expression). An agent can select it without opening the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

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

Explicit when-to-use and when-not: use this tool with expressionId "price" instead of add_numeric_expression, and only paste the returned recallToken into update_question / update_thankyou_screen if the user separately asks. It also forbids self-initiated insertion, which is an unusual and valuable exclusion.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources