Skip to main content
Glama

Krita Run Python

krita_run_python

Execute custom Python scripts in Krita to automate painting tasks, manipulate the active document, and access selection or view objects directly.

Instructions

Execute arbitrary Python inside Krita (escape hatch). The namespace provides: krita module, Krita/app, doc (active Document), view, InfoObject, Selection, QImage, os, json, math. print() is captured into the result's output field; assign to a variable named result to return a value (repr'd).

WARNING: executes unrestricted code inside the running Krita process. Only pass code you trust.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.7/5.0
Behavior5/5

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

The description discloses critical behavioral traits beyond any annotations: it executes unrestricted code inside the running Krita process, captures print() output into the result's output field, and requires assigning to a variable named 'result' to return a value. It also includes a prominent security warning. This is exemplary transparency for a high-risk tool.

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?

The description is compact and front-loaded with the core purpose, followed by essential namespace details, output behavior, and a security warning. Every sentence earns its place; there is no filler or repetition of schema information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a single-parameter escape-hatch tool with an output schema, the description covers everything an agent needs: what code can do, what namespace is available, how to capture output, how to return a value, and the risk involved. The output schema handles return-value structure, so no further description is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate for the single 'code' parameter. It does so by explaining what the code can access (namespace objects), how output is captured, and how to return a value. It doesn't provide syntax examples, but the parameter is self-evident as a Python code string and the description gives enough context for correct invocation.

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?

The description states a specific verb ('Execute arbitrary Python inside Krita') and identifies it as an escape hatch, which clearly distinguishes it from the many sibling tools that perform specific Krita operations. It also enumerates the available namespace objects, making the tool's purpose and scope immediately understandable.

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?

The description implies when to use this tool: when no dedicated sibling tool exists for the needed operation, since it is an 'escape hatch' for arbitrary Python. It does not explicitly name alternatives or state when not to use it, but the framing as an escape hatch plus the warning about unrestricted code provides clear contextual guidance.

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

Deploy Server

Other Tools