Skip to main content
Glama

Resize Canvas

photopea_resize_canvas
DestructiveIdempotent

Resizes the canvas without scaling image content: larger sizes add empty or colored space, smaller sizes crop edges, and the anchor determines which side stays fixed.

Instructions

Change the canvas size without scaling the content: larger adds empty space, smaller cuts off edges. The anchor decides which side stays fixed. Use resize_document to scale the content instead.

Input Schema

NameRequiredDescriptionDefault
widthYesNew canvas width in pixels
anchorNoWhere the existing content stays, e.g. 'center' adds space equally on all sides, 'top-left' adds it to the right and bottomcenter
heightYesNew canvas height in pixels
fillColorNoColor for the added area, e.g. #ffffff for a white border. Adds a solid 'Canvas Fill' layer at the bottom. Omit for transparent.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv0.2.1

TDQS

A4.4/5.0
Behavior4/5

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

The annotations already flag destructiveHint=true and idempotentHint=true, and the description earns credit by explaining what the destruction concretely is ("smaller cuts off edges") and what growth does ("larger adds empty space"). It adds the spatial mechanics via the anchor sentence. It stops short of saying whether the cut-off is recoverable via undo or what happens to layers beyond the boundary.

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 short sentences, front-loaded with the core semantics, then the anchor mechanic, then the disambiguation. Every clause carries information; nothing is repeated from structured fields verbatim.

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 a destructive, idempotent canvas operation with no output schema and fully documented parameters, the description covers the essential mental model: growth adds space, shrinkage clips, anchor controls placement. A note on recoverability or interaction with existing layer bounds would close the remaining gap.

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 description coverage is 100%, including a detailed anchor enum explanation and the fillColor layer behavior, so the baseline is 3. The description's "the anchor decides which side stays fixed" reframes anchor meaningfully but largely restates what the schema already documents; it adds no syntax, units, or constraints beyond it.

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?

"Change the canvas size without scaling the content" names a specific verb (resize/change) and resource (canvas), and immediately rules out the confusable operation (scaling content). It is directly distinguishable from the sibling photopea_resize_document without opening either 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?

Explicitly routes the agent: "Use resize_document to scale the content instead." That is a named alternative plus the exact condition (scale content vs. change canvas) that selects between them, which is the strongest form of guidance available here.

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