Skip to main content
Glama

Enhance

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

TableJSON 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

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior4/5

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

Goes beyond the annotations by disclosing output behavior (returns the committed version and root node without an extra read or render), retry/idempotency semantics (reuse clientToken only when retrying this exact mutation), version-based concurrency (reuse a returned version for subsequent edits), and read discipline (targeted subtree read only when ids are unknown). It does not, however, warn what mode="replace" destroys, which is notable given destructiveHint=true; that omission keeps it out of the top band.

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 first-write sequencing rule are front-loaded, followed by the more situational rules; nearly every sentence is an actionable instruction rather than filler. It is dense and long, with several imperatives packed into single sentences, but no sentence is purely decorative.

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 7-parameter, destructive, non-idempotent mutation with an output schema, the description covers the ambiguous cases an agent would otherwise guess at: unknown starting state, empty canvas, multi-screen sequencing, version reuse, retry tokens, and style constraints that prevent unusable output. Return values need not be spelled out since an output schema exists.

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 by adding operational meaning the schema lacks: targetNodeId "root" when nodeCount is 0, baseVersion reuse across edits, and the content-authoring constraints for html (flex, padding, gap, concrete CSS, layer-name, explicit dimensions, avoid grid/tables/implicit stretch, include real content). mode, idPrefix, and clientToken are mostly left to 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 specific verb+resource+input medium: "Create a populated screen or visual group from safe HTML/CSS." It also explicitly delineates boundaries against siblings, telling the agent to use canvas_edit for small changes and canvas_render at review points, so the tool is distinguishable 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?

Gives explicit when-to-use alternatives (canvas_edit for small changes, canvas_render once at a useful review point), a discovery fallback (call capability_query with capability canvas.read when starting state is unknown), and the nodeCount=0 edge case with its targetNodeId "root" recipe. It also prescribes a sequencing rule for multi-screen authoring (publish each screen before authoring the next).

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