Skip to main content
Glama

Add a question from a description

limesurvey_add_question_from_spec

Insert one new question into a group of an inactive survey, described as a question spec (the format limesurvey_get_survey_spec returns at level question; every text is one string for all survey languages or a map per language).

Instructions

Insert one new question into a group of an inactive survey, described as a question spec (the format limesurvey_get_survey_spec returns at level question; every text is one string for all survey languages or a map per language). position is the 1-based place in the group, { before: code } or { after: code }; without it the question goes to the end. The spec is checked against the survey first (its languages; the code must be free in the whole survey, case ignored): SPEC_INVALID, CODE_CONFLICT, SURVEY_ACTIVE, GROUP_SURVEY_MISMATCH and POSITION_INVALID write nothing. The question is imported (import_question) and only the new question is moved to its place; no other question is changed. It is then read back and compared with the spec. Returns { survey_id, group_id, question_id, code, position { index }, verification { ok, differences, differences_total, truncated }, side_effects, warnings }; a difference is a finding, not an error. import_question fills every text of the survey that has no row in an additional language with the base-language text, which cannot be undone: if the survey has such gaps, the tool answers TRANSLATION_GAPS (the gaps with path, language and question or group) and writes nothing, unless acknowledge contains fill_translation_gaps; side_effects then lists the filled gaps (paths as after the insertion). If a step after the import fails, the new question is deleted again (nothing else) and ADD_QUESTION_FAILED reports failed_step, rolled_back, manual_cleanup and cause_code. If the outcome of the import itself is unknown (lost answer, an error after the creation), nothing is deleted: created is "unknown" and candidates and cleanup_hint say what to check. An active survey is refused. A whole group goes with limesurvey_add_group_from_spec. A Ranking question makes the tool read the LimeSurvey generation once (entries as subquestions on 7, as answers on 6). Needs the write scope content.

Input Schema

NameRequiredDescriptionDefault
group_idYesID of the group of this survey that gets the question.
positionNo1-based place in the group, { before: code } or { after: code }; default: the end of the group.
questionYesThe new question as a question spec, for example the spec of limesurvey_get_survey_spec at level question with a new code.
survey_idYesNumeric LimeSurvey survey ID.
acknowledgeNoConfirmed risks. fill_translation_gaps: the import may fill texts of the survey that have no row in an additional language with the base-language text (otherwise such gaps answer TRANSLATION_GAPS).

Output Schema

NameRequiredDescriptionDefault
resultYes
workflowYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv1.6.0

TDQS

A4.7/5.0
Behavior5/5

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

Goes far beyond the annotations (readOnlyHint=false, destructiveHint=false, idempotentHint=false): it enumerates validation codes that write nothing (SPEC_INVALID, CODE_CONFLICT, SURVEY_ACTIVE, etc.), the import_question side effect on translation gaps that 'cannot be undone', the rollback behavior on post-import failure (delete-and-report), and the unknown-outcome path where nothing is deleted. It also names the required write scope, which the annotations do not convey.

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 is front-loaded, but the remainder is a dense, comma-chained wall of edge cases and error codes with little structural separation. Every clause is informative, yet the run-on delivery makes it hard for an agent to parse; bullets or grouping of the failure paths would help.

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 complex mutation tool with nested spec objects, validation, rollback, and irreversible side effects, the description is thorough. Return-shape detail is somewhat redundant given the output schema exists, but completeness for correct invocation is not in question.

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 description coverage is 100%, so the schema already documents all parameters. The description nonetheless adds meaning the schema lacks: the code must be free across the whole survey case-insensitively, the spec is one string or a per-language map, and the acknowledge/fill_translation_gaps semantics. This is above the baseline but position formatting largely repeats the schema.

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?

Opens with a precise verb+resource+constraint: 'Insert one new question into a group of an inactive survey, described as a question spec.' It also distinguishes itself from the relevant sibling by noting 'A whole group goes with limesurvey_add_group_from_spec,' so an agent can separate this from add_group_from_spec and update_question_from_spec.

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 preconditions and routing: 'an inactive survey' is required, 'An active survey is refused,' the spec must come from limesurvey_get_survey_spec at level question, and whole-group insertion is redirected to limesurvey_add_group_from_spec. The acknowledge flag is also tied to a specific risky condition, making the when-to-use conditions clear.

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

Deploy Server

Other Tools