Skip to main content
Glama

add_display_logic

Add Display Logic to a question, or to the submit screen — the "Display the question only, If..." / "Display the submit button only, If..." conditions in the builder's Logic tab. This is NOT Jump/Skip Logic (that's add_jump_logic — controls where the respondent goes next, never whether something is shown) and NOT Answer Logic (that's add_answer_logic — controls one specific answer choice, not the whole question/button). The only outcome here is visibility: the target is shown when the condition(s) match, hidden otherwise — nothing else happens. Identify the TARGET (the thing that will be shown/hidden) with questionId or position, OR pass submitScreen: true to target the submit button instead (displayLogics[survey.submit.id] — same map, same rules, just a different target; exactly one of questionId/position/submitScreen). Omit entryIndex to create the target's first "if" block; provide entryIndex: 0 (from get_display_logic) to append the given condition(s) to it instead, combined via each condition's own conidition. Both a question and the submit screen can only ever have ONE entry — confirmed for both directly in the builder source, no "add another" affordance either way — so omitting entryIndex when one already exists is refused outright (no force override; there's nothing legitimate to force through), pointing you at entryIndex: 0 instead. Use insertAfterConditionIndex to control WHERE a condition lands within an existing entry (omit to append at the end). This is additive, not destructive — no confirmation needed beyond that one refusal. Creating a QUESTION's first entry also auto-disables Question Randomization if it was on (matches the builder's own side effect) — check randomizationDisabled in the result and mention it to the user if true; this never happens for the submit screen (confirmed: its own "Add Display Logic" click has no such side effect), and never happens when appending to an existing entry either way. Question/submit-level Display Logic ONLY — does not cover Answer Logic (that's add_answer_logic) or thank-you-screen display logic (that's add_thankyou_screen_logic). The call is refused outright (no force override, nothing added) if a condition's source question comes after the target question in the survey — its answer wouldn't exist yet at that point, so the condition can never be satisfied, not just risky (this never applies to a submit target, since submit always comes after every question). Reorder the questions (reorder_questions) or pick an earlier source question first, then retry.

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>",
      "conditions": "<conditions>"
    },
    "name": "add_display_logic"
  }
}

Input Schema

NameRequiredDescriptionDefault
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.
positionNo0-based position of the target question. Provide this OR questionId OR submitScreen.
surveyIdYesThe Survey ID containing the question
conditionsYesOne or more conditions to add — to a new entry, or appended to entryIndex's existing entry.
entryIndexNoExisting display-logic entry index to append condition(s) to — always 0, since a question or the submit screen can only ever have one entry each. Omit only to create that first entry; if one already exists, omitting this is refused (a second entry would be silently inert, not an alternate rule).
questionIdNoThe TARGET question's id — the question that will be shown/hidden. Provide this OR position OR submitScreen.
submitScreenNotrue to target the submit screen's Display Logic instead of a question — controls whether the submit button shows. Mutually exclusive with questionId/position.
insertAfterConditionIndexNoOnly used together with `entryIndex` (appending to an existing entry): where the new condition(s) land within that entry's condition list. -1 inserts at the very start, N inserts right after condition N. Omit to append at the end (the default). Ignored when creating the first entry.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnlyHint=false, destructiveHint=false, idempotentHint=false, openWorldHint=true) by disclosing concrete behaviors: omitting entryIndex when an entry exists is refused with no force override, creating a question's first entry auto-disables Question Randomization with a randomizationDisabled result flag to surface, and the ordering refusal for source questions after the target. It also confirms the submit screen has no randomization side effect.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

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

Purpose and sibling disambiguation are front-loaded, which is good, but the body is a single dense paragraph and several parentheticals ('confirmed for both directly in the builder source', 'confirmed: its own Add Display Logic click has no such side effect') repeat the same confidence claim rather than adding callable information. The content mostly earns its place, but the packaging is heavier than needed.

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 an 8-parameter mutation tool with no output schema, the description covers the mutation's safety profile, its refusal conditions, its side effects (including which result field to surface), and the entry-creation vs append distinction. An agent has everything needed to call it correctly and to report outcomes, without needing return-value docs.

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 the floor is 3; the description nonetheless adds cross-parameter meaning beyond the per-field schema text — 'exactly one of questionId/position/submitScreen', entryIndex=0 as the append path, and insertAfterConditionIndex only mattering when appending. It stops short of expanding operator/value syntax, which it defers to the schema and get_survey_details.

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 ('Add Display Logic to a question, or to the submit screen') and immediately anchors it to the builder's 'Display the question only, If...' affordance. It explicitly names and disambiguates against add_jump_logic, add_answer_logic, and later add_thankyou_screen_logic, so the agent can route without opening sibling schemas.

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?

Gives explicit when-to-use, when-NOT-to-use with the named alternatives (jump logic = where the respondent goes next, answer logic = one answer choice), and states the single outcome here is visibility. It also prescribes remedies for the refusal path ('reorder_questions or pick an earlier source question first, then retry').

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