Skip to main content
Glama
Josusanz
by Josusanz

Replace layer pixels

replace_layer_image
DestructiveIdempotent

Swaps a pixel layer's image with another file, preserving its transform, mask, and properties. Use it to replace layer content with an externally edited or generated image.

Instructions

Swaps the source pixels of a pixel layer with another image file, keeping its transform, mask and properties. Use it to round-trip a layer through an external editor or a generated image.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pathYesPath to the .comp project package (a directory ending in .comp)
layerYesLayer UUID or its exact name
imagePathYes
keepDisplaySizeNotrue keeps the on-canvas size; false shows the new image 1:1

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.1

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already flag the operation as destructive and idempotent; the description adds what is destroyed (source pixels) and what survives (transform, mask, properties). This behavioral precision goes beyond the annotation hints without contradicting them.

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?

Two sentences: the first states the core operation and invariants, the second gives the intended workflow. Every sentence contributes and there is no redundant 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?

The description covers purpose, scope (pixel layer), preservation semantics, and a motivating use case, with the schema covering required parameters. A small gap is the lack of any statement about what the call returns or side effects for unsupported layer types.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 75% because imagePath has no description, and the description only refers to it as 'another image file.' It adds some meaning but does not fill the gap with formats, path semantics, or other constraints.

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 uses a specific verb ('Swaps'), identifies the exact resource ('source pixels of a pixel layer'), and specifies what is preserved ('transform, mask and properties'). This clearly separates it from layer-structure siblings such as set_layer_mask and add_image_layer.

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

Usage Guidelines4/5

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

It gives an explicit trigger ('Use it to round-trip a layer through an external editor or a generated image'), which tells an agent when to select this tool. It does not, however, state exclusions or name alternative tools.

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