Skip to main content
Glama

Add an image

canvas-add_image

Add an image to the canvas from base64 bytes or a fetchable http(s)/data URL. Bytes are content-addressed and deduped; the created node uses an image fill. Position like canvas-insert_html (x/y top-left; default viewport center).

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>"
    },
    "name": "canvas-add_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNoTop-left x
yNoTop-left y
urlNohttp(s) or data:image/ URL to fetch
mimeNoMIME type when sending dataBase64 (default: sniffed)
nameNoLayer name
parentIdNoFrame to place into (default: page level)
sessionIdYesThe artifact's id (its sessionId), from canvas-get_open or workspace-list_artifacts.
dataBase64NoRaw image bytes, base64 (data: URI prefix allowed)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A3.9/5.0
Behavior4/5

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

Annotations declare a non-read-only, non-destructive, open-world operation; the description adds genuinely new traits beyond them: content-addressed deduplication of bytes and the fact that the created node carries an image fill. It leaves out anything about failure modes when a remote URL cannot be fetched or rate/timeout behavior for the network fetch.

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

Conciseness5/5

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

Three compact sentences, front-loaded with the action and accepted inputs, then behavior (dedup, image fill), then positioning defaults. No sentence repeats structured fields or wastes words.

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?

For an 8-parameter mutation tool with full schema coverage and annotations present, the description covers inputs, defaults, and side effects well. The notable gap is that there is no output schema and the description never says what is returned (e.g. the created node id), which an agent may need for follow-up calls.

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 already 100%, so the baseline is 3; the description earns a bump by adding behavior the schema does not state — x/y default to the viewport center and bytes are content-addressed/deduped, and the resulting node is created with an image fill. It does not clarify how url and dataBase64 interact beyond what the schema already implies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb and resource ('Add an image to the canvas') followed by its two accepted input modes (base64 bytes or http(s)/data URL). It partially differentiates from siblings by referencing canvas-insert_html only for positioning semantics, which implicitly frames this tool as the image-specific counterpart, though it never says outright 'use insert_html for HTML content'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The reference to canvas-insert_html is about shared x/y semantics, not about when to choose one tool over the other. There is no explicit when-to-use or when-not guidance, no prerequisite statement (e.g. an open canvas session is required), and usage is only implied by the purpose sentence.

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.