Skip to main content
Glama

Slice a PNG into parts for rigging

riv_slice_image

Cut polygon regions from a character PNG into separate part images and a base image, returning bounding boxes for parts-based cutout rigging and placement.

Instructions

Cut polygon regions out of a character PNG for parts-based rigging (cutout animation). Writes each part as .png plus base.png (source with parts erased) into outDir, and returns each part's bbox for placement. Use with riv_create: images per part + groups as pivots.

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": {
      "pngPath": "<pngPath>",
      "outDir": "<outDir>",
      "regions": "<regions>"
    },
    "name": "riv_slice_image"
  }
}

Input Schema

NameRequiredDescriptionDefault
outDirYesDirectory to write part PNGs into
pngPathYesSource PNG path
regionsYesPolygon regions to cut out, one per part

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv0.8.0
    • addedInput schema / properties / regions / description
      Added value: +"Polygon regions to cut out, one per part"
    • addedInput schema / properties / regions / items / properties / name / description
      Added value: +"Part name; the output file is <name>.png"
  2. Changed1 schema field changedv0.6.1
    • changedInput schema / properties / regions / items / properties / polygon / items / items
      Previous value: -[
      -  {
      -    "type": "number"
      -  },
      -  {
      -    "type": "number"
      -  }
      -]New value: +{
      +  "type": "number"
      +}
  3. First observedv0.5.0

TDQS

A3.8/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It usefully discloses file outputs (each part as <name>.png plus base.png with erased parts) and bbox returns, but omits overwrite behavior, error conditions, and permission requirements.

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 with zero waste, front-loaded with the core action and followed by output behavior and integration guidance. Every sentence earns its place.

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?

Given a rich input schema and no output schema, the description adequately explains what is produced and returned (part PNGs, base.png, bboxes). Minor gaps around overwrite/error behavior remain, but an agent can call the tool correctly.

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%, so the schema already documents all three parameters. The description adds minor context about output naming and base erasure, but does not add syntax or format details beyond the schema.

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+resource: cut polygon regions out of a character PNG for parts-based rigging. It is clear what the tool does and what artifacts it produces, though it does not explicitly distinguish itself from potentially similar sibling tools such as riv_extract_assets.

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 clear usage context: parts-based rigging and use with riv_create for images and pivots. It does not state when to avoid this tool or name alternatives, but the intended workflow is explicit.

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