Skip to main content
Glama

Design editable canvas content

canvas_write_html
Destructive

Create a populated screen or visual group from safe HTML/CSS. For multiple screens, publish the first populated screen before authoring the next, then publish each subsequent screen separately so the user can see and steer progress. Prepare only what that screen needs; do not prepare the whole set before the first write. Returns the committed version and root node without an extra read or render. If starting state is unknown, call capability_query with {"capability":"canvas.read","input":{"canvasId":""}}. When nodeCount is 0, use targetNodeId "root" and the returned version. Use flex, padding, gap, concrete inline CSS and layer-name. Give important rows/cards/buttons explicit dimensions; avoid implicit stretch, margins, grid, tables and inline badge backgrounds. Include real content, not an empty shell. Reuse a returned version for subsequent edits; read a targeted subtree only when its ids or structure are unknown. Use canvas_edit for small changes, then canvas_render once at a useful review point. The schema here is executable; no search or describe is required.

Input Schema

NameRequiredDescriptionDefault
htmlYesExactly one safe top-level HTML/CSS visual group to compile into editable nodes.
modeNoinsert-children
canvasYesCanvas UUID or complete canvas/page/selection URL. Preserve every supplied page and selection.
idPrefixNoOptional namespace for generated IDs. Choose a fresh prefix for each new import or replacement; reuse only for an identical retry.
baseVersionYes
clientTokenNoReuse only when retrying this exact mutation.
targetNodeIdYesStable container id for insert-children, or subtree root id for replace.

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed3 schema fields changed
    • removedInput schema / properties / html / maxLength
      Removed value: -1000000
    • removedInput schema / properties / idPrefix / maxLength
      Removed value: -100
    • removedInput schema / properties / targetNodeId / maxLength
      Removed value: -200
  2. First observed

TDQS

A4.5/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true, idempotentHint=false and openWorldHint=false. The description adds real value beyond them — it states the return is the committed version and root node without an extra read/render, and prescribes an incremental multi-screen workflow that avoids blocking the user. It stops short of explaining what a destructive replace actually overwrites or how baseVersion conflicts surface, which is the notable remaining gap.

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?

Purpose and the core sequencing rule are front-loaded, and almost every sentence carries actionable content. It is dense and long — several clauses could be split or trimmed (e.g. the styling-prescription sentence) — but there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

An output schema exists, so return values need not be spelled out, yet the description still confirms what comes back. It covers prerequisites, workflow sequencing, version reuse, ID/prefix discipline and styling constraints. What is missing is any treatment of the mode enum's destructive 'replace' branch relative to the destructiveHint annotation.

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 71% and the description compensates usefully: it tells the agent to use targetNodeId 'root' with the returned version when nodeCount is 0, to reuse a returned version for subsequent edits, and to reuse clientToken only for identical retries. It also constrains the html content (flex, padding, gap, inline CSS, layer-name, explicit dimensions), which the schema only describes as 'exactly one safe top-level HTML/CSS visual group'.

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?

Specific verb+resource: 'Create a populated screen or visual group from safe HTML/CSS', and it explicitly routes to siblings ('Use canvas_edit for small changes, then canvas_render once at a useful review point'). An agent can distinguish this from canvas_edit/canvas_render without opening a schema.

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?

Explicit when-to-use rules: publish each screen before authoring the next, prepare only what that screen needs, call capability_query when starting state is unknown, read a subtree only when ids/structure are unknown, and prefer canvas_edit for small changes. Alternatives and conditions are named rather than implied.

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