Skip to main content
Glama

Resize canvas

gimp_resize_canvas

Resize the canvas without resampling image content; optionally shift or resize layers to fit the new dimensions.

Instructions

Change the canvas size without resampling. Layers move by (offset_x, offset_y) and keep their size, unless resize_layers is 'all' or 'image-sized' (layers that covered the old canvas): those grow or shrink to the canvas, new areas transparent or fill_color. One undo step.

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": {
      "image": "<image>",
      "width": "<width>",
      "height": "<height>"
    },
    "name": "gimp_resize_canvas"
  }
}

Input Schema

NameRequiredDescriptionDefault
imageYesImage id from gimp_status, e.g. 'image:1@a1b2c3d4'.
widthYesPixels.
heightYesPixels.
offset_xNo
offset_yNo
fill_colorNoFill new layer areas (default: transparent).
resize_layersNonone

Output Schema

NameRequiredDescriptionDefault
dirtyYes
imageYes
widthYes
heightYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.0
    • addedInput schema / properties / fill_color
      Added value: +{
      +  "anyOf": [
      +    {
      +      "type": "string"
      +    },
      +    {
      +      "type": "null"
      +    }
      +  ],
      +  "default": null,
      +  "description": "Fill new layer areas (default: transparent).",
      +  "title": "Fill Color"
      +}
    • addedInput schema / properties / resize_layers
      Added value: +{
      +  "default": "none",
      +  "enum": [
      +    "none",
      +    "all",
      +    "image-sized"
      +  ],
      +  "title": "Resize Layers",
      +  "type": "string"
      +}
  2. First observedv0.1.0

TDQS

A3.8/5.0
Behavior4/5

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

Annotations only declare that this is a non-destructive write, so the description carries the real behavioral load: layers keep their size and shift by the offset, resize_layers 'all'/'image-sized' regrow layers to the canvas, new areas are transparent or fill_color, and the whole operation is a single undo step. That is the context an agent needs before mutating a document.

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?

Everything is front-loaded and tightly written, with the resampling distinction first and layer behavior second. The second sentence is dense with parentheticals and could be split for readability, but no sentence is 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?

An output schema exists, so return values need not be explained, and the description covers the meaningful mutation semantics and undo behavior for a 7-parameter canvas operation. Only minor gaps remain, such as the exact offset direction convention and the behavior when resize_layers is 'none'.

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 57%, and the description compensates by explaining how offset_x/offset_y actually move layers rather than the canvas, what the resize_layers enum values mean in practice, and that fill_color fills only new layer areas. It stops short of documenting units or the 'none' case explicitly.

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?

The description states a specific verb and resource ('Change the canvas size') and immediately scopes it with 'without resampling', which separates it from image-scaling siblings such as gimp_resize_image. It does not name an alternative explicitly, so it falls short of 5.

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?

'Without resampling' implies the canvas-only use case versus image scaling, but there is no explicit when-to-use/when-not-to-use guidance and no named alternative. An agent must infer the routing from the sibling list.

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