Skip to main content
Glama

import_image

Draw an image file into a sprite layer at the given x/y coordinates, compositing it over existing pixels and clipping anything outside the canvas.

Instructions

Draw an image file into a layer at (x, y), over the pixels already there.

Transparent pixels of the image leave the layer as it is; a GIF gives its first frame. Parts outside the canvas are dropped: placed and clipped count the image's non-transparent pixels drawn and dropped. The cel is created or grown as needed (a linked cel is unlinked first). Indexed sprites get the nearest palette entry for each colour (partly transparent pixels become opaque), grayscale ones the luma. For indexed sprites, the number of different RGB colours drawn times the palette size may be at most 67108864 (reduce the colours of photo-like images first); nothing changes when it is more. Locked layers, groups and tilemap layers are refused. Images up to 4096x4096. Not available in batch.

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": {
      "path": "<path>",
      "image": "<image>",
      "layer": "<layer>"
    },
    "name": "import_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
xNoCanvas x of the image's left edge
yNoCanvas y of the image's top edge
pathYesSprite file. Relative paths resolve against the server root.
frameNo1-based frame
imageYesImage file to draw in (png, gif, bmp, jpg, webp, ...)
layerYesLayer name, or a 'group/child' path for nested layers

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior5/5

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

With no annotations supplied, the description carries the full burden and does so: transparency is a no-op, GIFs contribute only the first frame, out-of-canvas pixels are clipped, a cel is created or grown and linked cels are unlinked, indexed sprites snap to nearest palette entries with partly transparent pixels becoming opaque, and there is a hard 67108864 colour-product ceiling that causes a no-op when exceeded. Refusal cases and the size limit are also disclosed, so an agent knows the destructive surface and the failure modes before calling.

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?

The primary action is front-loaded and each following sentence adds a distinct operational fact, but the indexed-colour sentence is a dense run-on that packs a numeric limit, a parenthetical workaround, and an edge case into one clause. Slightly heavy, yet nothing is padding.

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 six-parameter mutation tool with no annotations, the description covers compositing, clipping, cel lifecycle, colour-space conversion, a size cap, a colour-product cap with defined no-op behaviour, and batch incompatibility. An output schema exists, so the absence of return-value description is not a gap.

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 would be 3, but the description adds real meaning: it clarifies that x/y place the image's left/top edge, that the layer argument may cause cel creation/growth or unlinking of a linked cel, and that the image argument's format affects behaviour (GIF first frame, indexed vs grayscale palette mapping). No extra detail is given for the frame parameter beyond 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?

The description opens with a specific verb+resource+destination: 'Draw an image file into a layer at (x, y), over the pixels already there.' That distinguishes it from the draw_* siblings, which paint shapes/pixels rather than importing an external image file, and it names the compositing model up front.

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?

Usage context is implied rather than stated: it tells you the tool refuses locked layers, groups and tilemap layers, caps images at 4096x4096, and is 'Not available in batch'. But it never names an alternative (e.g. draw_pixels or draw_ascii) or states the condition that would send an agent elsewhere.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.