gimp_run_python
Execute Python scripts inside GIMP to automate image editing, access Gimp/Gegl/GLib APIs, and persist state across calls. Wrap operations in a single undo step by passing an image_id.
Instructions
Run Python inside GIMP. Gimp, Gegl, Gio, GLib and helpers image_by_id/item_by_id/make_color are available; the namespace persists between calls. Returns stdout plus the expression value or result. Pass image_id to wrap the call in 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": {
"code": "<code>"
},
"name": "gimp_run_python"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | ||
| image_id | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||