Skip to main content
Glama

Insert HTML

canvas-insert_html

Insert content from HTML — one undoable action. Accepts three kinds of markup: (1) canvas layers, the data-ac-* format canvas-read action=html returns: every layer element carries data-ac-type (frame | group | rect | ellipse | line | polygon | star | vector | text | image | component | instance | section) and its data-ac-model JSON; data-ac-id is optional (ids are minted; the ones you send come back in idMap). Give every layer you want back an id of its own, across copies too (title-1, title-2, …): a repeated id is mapped for its first layer only. Several top-level layers land together, relative positions kept. To copy layers that already exist, use canvas-duplicate_nodes instead. Markup with data-ac-type, data-ac-model or data-ac-id attributes that holds no layer is refused with the reason, never inserted as a page. (2) raw (becomes native vector/shape layers), (3) any other web HTML incl. full pages. Generic HTML at page level (no parentId) on a live canvas — the default in the Anima Canvas app — becomes a live page: one artboard that keeps the HTML exactly as written and runs it, scripts included, like an HTML file dropped into the canvas. Send a complete document (…) with inline / or absolute URLs; relative files do not resolve. Its layers are a snapshot of the running page, so change it with canvas-replace_html on its artboard (canvas-read action=html returns its HTML). Otherwise (into a parentId, or on a canvas without live pages) generic HTML is rendered off-screen without scripts and converted to native layers. Position: x/y = top-left in world coords, or parent-local when parentId is given; omitted = viewport center. A top-level frame inserted at page level becomes a new artboard. Returns rootIds, idMap (layer markup), bounds (x/y parent-local, w/h after layout — hug and auto-layout sizes included, no canvas-read action=outline needed) and warnings; unmeasured lists any the canvas did not lay out (on another page, or far outside the view): those keep the model's sizes, which a hugging text or auto-layout frame there may not match until it is shown. You cannot measure text: to center or align it, put it in an auto-layout frame (data-ac-layout justify/align) and let it hug (data-ac-text autoResize "auto-wh", or "auto-h" for a fixed width) rather than guessing a width.

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": {
      "sessionId": "<sessionId>",
      "html": "<html>"
    },
    "name": "canvas-insert_html"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNoTop-left x (world, or parent-local with parentId)
yNoTop-left y
htmlYesThe markup to insert
nameNoName for the created root (one root; a live page defaults to its <title>)
parentIdNoFrame/group/section to insert into (default: page level)
sessionIdYesThe artifact's id (its sessionId), from canvas-get_open or workspace-list_artifacts.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=false, destructiveHint=false and openWorldHint=true; the description reinforces this with 'one undoable action', which is genuinely useful. It goes further than the annotations by disclosing that live pages execute scripts and that relative URLs will not resolve — a real behavioral risk an agent must know. However, it does not discuss auth/permission requirements or rate/size limits, so it stops short of full behavioral coverage.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The content is front-loaded and almost every sentence carries operational detail, but it is delivered as one dense paragraph with heavy parenthetical nesting, including a thirteen-value enumeration of data-ac-type that reads like schema documentation. An agent can extract the rules, yet the lack of structure makes it harder to scan than it needs to be.

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?

There is no output schema, and the description compensates fully by documenting the return shape (rootIds, idMap, bounds, warnings) and explaining what 'unmeasured' means and why those layers keep model sizes. For a tool with six parameters, three input modes and a live-page side effect, nothing an agent needs in order to call it correctly appears to be missing.

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 100%, so the baseline is 3, but the description adds meaning the schema lacks: omitted x/y defaults to viewport center, coordinates are parent-local when parentId is given, and a top-level frame at page level becomes a new artboard. It also explains that name applies to a single root and that a live page defaults to its <title>, and that ids sent inside the markup return in idMap with repeated ids mapped only once.

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 ('Insert content from HTML') and immediately enumerates the three accepted markup kinds (canvas layers, raw <svg>, other web HTML). It names the siblings it is not — canvas-duplicate_nodes for copying existing layers and canvas-replace_html for editing a live page — so an agent can route correctly without opening another 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 branching guidance: use canvas-duplicate_nodes to copy existing layers, use canvas-replace_html to change a live page on its artboard, and the rule for when generic HTML becomes a live page (page level, no parentId, live canvas) versus being rendered off-screen into native layers. It also states a negative case — markup carrying data-ac-* attributes but holding no layer is refused with a reason rather than inserted.

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.