apply_operations
Applies a batch of drawing and layer operations to an Aseprite document at a specified revision, enabling atomic edits that can be undone in one step.
Instructions
在指定修订执行原子批次,一次撤销。layer={kind:id或ref,value:标识},frame默认1。 支持 create_layer(ref,name)、set_opacity(layer,opacity)、pixel(layer,x,y,rgba)、 rectangle/ellipse(layer,x,y,width,height,rgba,filled=true)、pixels(layer,points=[{x,y,rgba}])、 line(layer,x1,y1,x2,y2,rgba,thickness=1)、clear_region(layer,x,y,width,height)、 write_region(layer,x,y,width,height,encoding=rgba|rle,mode=replace|source_over, pixels=[[r,g,b,a],...]或runs=[{count,rgba},...])。区域像素按行优先,RGBA为0–255整数。
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": {
"session_id": "<session_id>",
"document_id": "<document_id>",
"expected_revision": "<expected_revision>",
"operations": "<operations>"
},
"name": "apply_operations"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operations | Yes | ||
| request_id | No | ||
| session_id | Yes | ||
| document_id | Yes | ||
| expected_context | No | ||
| expected_revision | Yes |