Skip to main content
Glama

Get Layout

get_layout
Read-onlyIdempotent

Returns 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

NameRequiredDescriptionDefault
codeYesSurvey publication code — the 8-character code from the survey's public link (e.g. 1a2b3c4d). Returned by list_surveys.

Output Schema

NameRequiredDescriptionDefault
tokensNoThe 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.
customCSSNoFull text of the custom CSS (Layout Editor → edit source → CSS); empty when none. Edit this text and send it back whole.
jsVersionNoVersion of customJavascript. Pass it as jsVersion when sending customJavascript.
cssVersionNoVersion of customCSS (SHA-256 of the text). Pass it as cssVersion when sending customCSS to apply_layout.
surveyCodeNo
templateIDNoThe 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.
customLayoutNoFull text of the custom HTML layout scaffold; empty when none.
templateNameNoName of that template ('API Layout {code}' for the survey's dedicated copy).
layoutVersionNoVersion of customLayout. Pass it as layoutVersion when sending customLayout.
isDedicatedCopyNotrue = the survey already has its dedicated layout copy; false = still a shared or system template, the first apply_layout write creates the copy.
customJavascriptNoFull text of the custom JavaScript; empty when none.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare this a safe idempotent read, and the description goes well beyond them: it discloses the template resolution rule (dedicated 'API Layout {code}' copy, or the shared template the copy will be created from), that the text blocks are returned in FULL rather than truncated, and that each block carries a version field (cssVersion, jsVersion, layoutVersion) that the companion write depends on. That version coupling is exactly the non-obvious behavior an agent needs before calling apply_layout.

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 return contents and the call-before-writing rule, dense but purposeful. The closing sentence mapping the blocks and tokens to the Layout Editor's 'Quellcode bearbeiten' panel and property controls is useful for user-facing phrasing but is the least load-bearing part and could be trimmed.

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 read tool feeding a destructive whole-block replacement, the description covers what is returned, version semantics, the fallback template logic, and the ordering requirement relative to apply_layout. With an output schema present it needn't document the response shape, and nothing required to call it correctly is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% and the single `code` parameter is fully documented in the schema, including its 8-character format and where to obtain it (list_surveys). The description adds no parameter-level detail of its own, so the baseline 3 applies — correct behavior, but no extra meaning contributed.

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 ("Returns the survey's current layout") and then enumerates exactly what the payload contains: the resolved template, design tokens with current values, and the full text plus versions of customCSS/customJavascript/customLayout. The framing "as apply_layout will see it" distinguishes it from a raw config read and ties it to a named sibling.

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 an explicit precondition: "Call it before changing any of those blocks," and explains why — apply_layout replaces a block whole and requires the version of the text being replaced. It also sets the expectation that the returned customCSS is the starting point for the text sent back, so the agent knows the intended read-then-write loop rather than guessing.

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