Get Layout
get_layoutReturns the survey's current layout as apply_layout will see it: the template a write lands on (the survey's dedicated copy 'API Layout {code}', or the shared template the copy will be created from), its design tokens with current values, and the FULL text of customCSS, customJavascript and customLayout with their versions (cssVersion, jsVersion, layoutVersion). Call it before changing any of those blocks: apply_layout replaces a block whole and accepts it only together with the version of the text it replaces; the customCSS it returns is the starting point for the text you send back. Where the user sees these texts: QUESTIONSTAR Layout Editor → 'Quellcode bearbeiten' (edit source); the tokens are the Layout Editor's property-panel controls.
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": {
"code": "<code>"
},
"name": "get_layout"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Survey publication code — the 8-character code from the survey's public link (e.g. 1a2b3c4d). Returned by list_surveys. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| tokens | No | The template's design tokens (CSS variables of the Layout Editor's property panel) with their current values — the only names apply_layout's inlineTokens may set. | |
| customCSS | No | Full text of the custom CSS (Layout Editor → edit source → CSS); empty when none. Edit this text and send it back whole. | |
| jsVersion | No | Version of customJavascript. Pass it as jsVersion when sending customJavascript. | |
| cssVersion | No | Version of customCSS (SHA-256 of the text). Pass it as cssVersion when sending customCSS to apply_layout. | |
| surveyCode | No | ||
| templateID | No | The layout template apply_layout writes to: the survey's dedicated copy 'API Layout {code}' when it exists, otherwise the shared template the copy will be created from. | |
| customLayout | No | Full text of the custom HTML layout scaffold; empty when none. | |
| templateName | No | Name of that template ('API Layout {code}' for the survey's dedicated copy). | |
| layoutVersion | No | Version of customLayout. Pass it as layoutVersion when sending customLayout. | |
| isDedicatedCopy | No | true = the survey already has its dedicated layout copy; false = still a shared or system template, the first apply_layout write creates the copy. | |
| customJavascript | No | Full text of the custom JavaScript; empty when none. |