Skip to main content
Glama

Scale layer

gimp_scale_layer
Destructive

Resample a layer or group to specified width and height in pixels while preserving a center or top-left anchor and selecting an interpolation method.

Instructions

Resample a layer or group to width x height pixels. anchor='center' keeps its center, 'top-left' keeps its top-left corner. Lossy. 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": {
      "item": "<item>",
      "width": "<width>",
      "height": "<height>"
    },
    "name": "gimp_scale_layer"
  }
}

Input Schema

NameRequiredDescriptionDefault
itemYesItem id (layer, group, mask...) e.g. 'item:5@a1b2c3d4'.
widthYesPixels.
anchorNocenter
heightYesPixels.
interpolationNoResampling: none (nearest neighbour, hard edges), linear, cubic, nohalo, lohalo.cubic

Output Schema

NameRequiredDescriptionDefault
xYesOffset of the layer's top-left corner in image pixels.
yYes
idYes
kindYes
maskYes
modeYesGIMP layer mode nick, e.g. 'normal', 'multiply'.
nameYesLayer name. GIMP keeps names unique within an image ('Title #1').
locksYes
widthYes
heightYes
parentYesId of the parent group, null at the top level.
opacityYes0-100.
visibleYes
childrenNoChild layers of a group, top-most first; null for non-groups.
has_alphaYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.6.0
    • changedOutput schema / $defs / LayerNode / properties / kind / enum
      Previous value: -[
      -  "layer",
      -  "group",
      -  "text"
      -]New value: +[
      +  "layer",
      +  "group",
      +  "text",
      +  "vector",
      +  "link"
      +]
    • changedOutput schema / properties / kind / enum
      Previous value: -[
      -  "layer",
      -  "group",
      -  "text"
      -]New value: +[
      +  "layer",
      +  "group",
      +  "text",
      +  "vector",
      +  "link"
      +]
  2. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, but the description adds genuinely new behavioral facts: the resampling is "Lossy" (quality degradation is permanent) and it consumes exactly "One undo step" (undo granularity). The one thing left unstated is what happens to group children when a group is scaled, which matters for the "layer or group" scope.

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?

Four short sentences with the operation and its output dimensions front-loaded, followed by anchor behavior and the two critical caveats. No sentence is redundant with the name or title, and nothing is padded.

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 no explanation, and the description covers the destructive/lossy nature plus undo scope for a mutation tool. Completeness would be higher if it clarified whether scaling a group implicitly scales its child layers and whether the item id can be a mask as the schema suggests.

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 80%, so width, height, and interpolation are already documented by the schema. The description adds meaning the schema lacks by explaining the anchor enum semantics — 'center' keeps its center, 'top-left' keeps its top-left corner — since the anchor property in the schema carries no description at all.

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?

"Resample a layer or group to width x height pixels" gives a specific verb (resample), a specific resource (layer or group), and the resulting dimension, which separates it from siblings like gimp_flip_layer or gimp_rotate_layer that also transform geometry but do not resample. The width x height phrasing makes the operation's outcome concrete.

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 is only implied: an agent can infer this is the tool for resizing pixel dimensions of a layer, and the anchor sentence hints at positioning choices. There is no explicit when-to-use/when-not guidance and no naming of alternatives such as gimp_set_layer_properties for non-geometric changes, so the agent must derive selection logic itself.

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