merge_layer_down
Combine a layer with the one directly below it, returning the target layer name and refusing when no mergeable layer exists beneath.
Instructions
Merge a layer down into the layer directly beneath it.
Refuses rather than doing nothing when there is nothing to merge into. Aseprite's
`MergeDownLayer` is a no-op in five cases, and it raises in none of them, so this used
to report a result indistinguishable from a merge that happened. Measured, naming the
layer stack before and after:
bottom layer of the sprite ['only'] -> ['only']
lowest layer inside a group ['Layer 1', 'grp/a', 'b'] -> unchanged
the layer below is a group ['Layer 1', 'grp', 'a'] -> unchanged
the layer named is a group ['Layer 1', 'grp/a'] -> unchanged
the layer below is a tilemap ['Layer 1', 'tiles', 'px'] -> unchanged
All five returned sprite info describing the stack they had failed to change, which is
the same shape a successful merge returns. Only the ordinary case worked, so an agent
flattening a stack by merging downward in a loop was told the loop had finished when it
had stopped.
Returns `merged_into`, the name of the layer the artwork went into, so the result says
what happened rather than only what the sprite now looks like.
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": {
"filename": "<filename>",
"layer": "<layer>"
},
"name": "merge_layer_down"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| layer | Yes | ||
| filename | Yes |