Skip to main content
Glama

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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
image_idNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. First observedv0.2.0

TDQS

A4/5.0
Behavior4/5

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

No annotations exist, so the description carries the full burden — and it delivers: persistence across calls (the single most important behavioral trait for an interpreter tool), the exact return contract (stdout plus expression value or `result`), and undo-step wrapping via image_id. It stops short of disclosing exception/error behavior, which matters for arbitrary code execution.

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?

Three sentences, roughly 40 words, with the core purpose front-loaded. Every sentence earns its place: namespaces, persistence, return format, and undo behavior are each covered without redundancy.

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 high-complexity arbitrary-code-execution tool, the description covers the critical operational facts: what's in scope, cross-call persistence, return value semantics, and transactional undo. The output schema presumably documents the return structure. The remaining gap is error handling — what an agent should expect when the Python code raises an exception — which is notable but not disqualifying given how much else is conveyed.

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?

With 0% schema coverage, the description must compensate. It gives image_id real meaning (one-undo-step wrapping) and hints at code semantics via the expression-value return contract. However, it doesn't explain how `code` accesses the passed image or variables from prior calls, or whether stdin/multiline scripts are supported — leaving the agent to guess the execution model.

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?

"Run Python inside GIMP" is a specific verb+resource statement that immediately distinguishes this from siblings like gimp_pdb_call (single PDB procedure) and gimp_run_recipe (recipe execution). Listing the available namespaces (Gimp, Gegl, Gio, GLib, helpers) further sharpens what the tool executes.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The persistent-namespace and undo-step notes imply a scripting use case, but the description never explicitly says when to choose this over gimp_pdb_call or gimp_run_recipe, nor does it state when not to use it. With 30+ siblings, explicit routing guidance would materially help agent selection.

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

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SarutobiSasuke8/gimp-agent-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server