Skip to main content
Glama

rotate

Turn an entire sprite or a specified layer clockwise by 90, 180, or 270 degrees, optionally applying it only to selected frames.

Instructions

Turn the whole sprite, or one layer, clockwise by 90, 180 or 270 degrees.

Without a layer the canvas turns too (90 and 270 swap width and height) along with every layer in every frame; frames must then cover all frames. With a layer its cels turn about the canvas centre and the canvas keeps its size: on a non-square canvas, content that ends up off the canvas stays in the cel. With ox = floor((w - h) / 2) and oy = floor((h - w) / 2), 90 maps pixel (x, y) to (ox + h - 1 - y, oy + x) and 270 maps it to (y - oy, oy + w - 1 - x): an odd w - h rounds the half pixel of a 90 turn towards the top-left and 270 undoes 90 exactly. A background layer turns by 90/270 only on a square canvas. Slices are not moved. The whole-sprite turn ignores layer locks; a named layer must not be locked.

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>",
      "angle": "<angle>"
    },
    "name": "rotate"
  }
}

Input Schema

NameRequiredDescriptionDefault
pathYesSprite file. Relative paths resolve against the server root.
angleYesDegrees clockwise
layerNoLayer name or 'group/child' path; leave out for every layer
framesNoFrames: a number, "1-4", "1-4,7" or "all" (1-based)all

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations, the description carries the burden and does it well: it discloses the canvas resize and frame-coverage requirement for whole-sprite turns, that off-canvas content is retained in the cel, that background layers only turn on square canvases, that slices are not moved, and the layer-lock rule. What it omits is whether the file is written or saved in place and what happens on locked-cel or invalid-frame input.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The core purpose is front-loaded and the mode contrast is well organized, but the pixel-mapping formulas with ox/oy and the odd w-h rounding note are implementation detail an agent rarely needs to act on. Useful sentences are mixed with math that bloats the definition.

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 4-parameter mutation tool with an output schema, the description covers geometry, frame constraints, layer locks, and unaffected elements such as slices. The only real gap is persistence semantics (in-place file change vs unsaved state), which is a minor omission.

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 is 3, but the description adds semantics beyond the schema: `layer` gains the lock restriction and canvas-size behavior, and `frames` gains the rule that whole-sprite turns must cover all frames. `angle` and `path` are left to the schema, which documents them adequately.

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?

Opens with a specific verb and resource ('Turn the whole sprite, or one layer, clockwise by 90, 180 or 270 degrees'), naming both supported scopes and the allowed angles. No sibling in this catalog does rotation, so the agent can see immediately this is the rotation tool.

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?

The with-layer vs without-layer paragraphs function as mode-selection guidance and state the consequence of each (canvas resize plus all frames vs canvas kept at size). It stops short of explicit trigger language or naming alternatives such as a crop or transform tool for off-canvas content.

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