add_question
Add a new question to an existing BlockSurvey team draft, either appended to the end or inserted at a specific position. Mirrors clicking "Add Question" in the builder and picking a type. For choice-style or matrix questionTypes, you MUST ask the end user for the actual answer choices first — do not invent placeholder options. For questionType 'customerexperience', ask the end user which experience metric they want — NPS, CSAT, or CES — if they haven't already said (don't just default to NPS silently). Then, matching whichever it is: for NPS, ask whether they want a specific scale color theme (Solid / Gradient / 2 Color Bleed via npsTheme) or the default Solid is fine; for CSAT/CES, ask whether they want it shown as a 1-5 Opinion Scale or a Choose Single with text labels (componentType) — the difference is visible to respondents, not a technical detail, so don't pick silently on the user's behalf. Skip asking only if the user has already stated a preference or explicitly says the default is fine.
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>",
"label": "<label>",
"questionType": "<questionType>"
},
"name": "add_question"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| label | Yes | The question text | |
| exType | No | Only for questionType 'customerexperience': which flavor of experience-rating question this is — 'nps' (Net Promoter Score, 0-10 scale), 'csat' (Customer Satisfaction, 1-5 scale), or 'ces' (Customer Effort Score, 1-5 scale). Defaults to 'nps' if omitted. Ignored for every other questionType. | |
| teamId | No | Team workspace the survey belongs to. Optional: defaults to the team that owns the given surveyId. Must be a team you are a member of. | |
| options | No | Answer choices and type-specific settings. REQUIRED — {values: [...]} with 2+ items — for choice-style questionTypes (multiplechoice, checkboxes, dropdown, dropdownmultiple, ranking, colorpicker — for colorpicker, values are text prompts to pick a color for, e.g. "Preferred logo color"; the respondent picks the actual color when answering, there's no way to assign colors to options here). REQUIRED — {rows: [...], columns: [...]}, 2+ each — for matrix questionTypes (matrixrating, matrixratingmultiple, matrixtext, matrixnumber, matrixdropdown, matrixstarrating). The remaining fields (columnOptions/scaleMin/scaleMax/scaleStep/starCount/limitMin/limitMax/dateFormat/timeFormat/fileLimit/listLimit/countryCode/countryName) are each only relevant to specific questionTypes — see each field's own description — and are all optional with sensible defaults if omitted. | |
| npsTheme | No | Only for questionType 'customerexperience' with exType 'nps' (or omitted, since 'nps' is the default): the visual color styling of the 0-10 scale buttons — matches the builder's "NPS theme selection" dropdown. Purely cosmetic, no effect on scoring. Defaults to 'solid' if omitted. Ignored for csat/ces and for every other questionType. | |
| position | No | 0-based index to insert the question at (0 to the survey's current question count, inclusive). Omit to append at the end. An out-of-range value is rejected, not clamped. | |
| required | No | Whether an answer is required. Defaults to true (the builder's own default) if omitted. Not applicable to statement questions — they have no Required toggle in the builder; omit it for those. | |
| surveyId | Yes | The Survey ID to add the question to | |
| description | No | Optional question description/subtext shown below the question text. Omit for none. | |
| questionType | Yes | One of: singletextbox, commentbox, multiplechoice, checkboxes, dropdown, dropdownmultiple, number, email, date, numberrating, slider, starrating, matrixrating, matrixratingmultiple, matrixtext, matrixnumber, matrixdropdown, matrixstarrating, phonenumber, statement, website, consent, country, ranking, fileupload, imagecapture, payment, customerexperience, signature, colorpicker, list. Choice-style types and matrix types require `options` — see that field's description. If the label promises a specific scale ("on a scale of 1-10", "rate 1 to 5 stars", "select up to 3 files"), set the matching field in `options` (scaleMin/scaleMax, starCount, fileLimit, etc.) so the question actually matches what the label says — don't just phrase the label around a default. customerexperience is the one exception: its scale is fixed by exType (NPS 0-10, or CSAT/CES 1-5), not configurable via `options`. | |
| componentType | No | Only for questionType 'customerexperience' with exType 'csat' or 'ces' — matches the builder's "Component Type" dropdown, which only appears for those two (NPS is always numberrating). 'numberrating' (default) renders a plain 1-5 Opinion Scale; 'multiplechoice' renders a Choose Single with the standard fixed labels (csat: Strongly Disagree..Strongly Agree; ces: Very Difficult..Very Easy) — those labels are generated automatically either way, so this only changes which widget the respondent sees. Ignored for exType 'nps' and for every other questionType. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| index | Yes | 0-based position the question ended up at | |
| questionId | Yes | ||
| totalQuestions | Yes | The survey's question count after this add |