Skip to main content
Glama

execute_python

Destructive

Run Python in Hiero's main thread to cover tasks the other tools do not, with hiero pre-imported and JSON-serialisable results, stdout, stderr, and tracebacks returned.

Instructions

Run Python inside Hiero's main thread for anything the other tools do not cover.

`hiero` is pre-imported (hiero.core, hiero.ui). Assign to a variable named `result`
to return a JSON-serialisable value; stdout, stderr and any traceback are returned too.

Input Schema

NameRequiredDescriptionDefault
codeYes

Output Schema

NameRequiredDescriptionDefault

No arguments

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.4/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the description adds real value beyond them: main-thread execution (implying UI blocking), pre-imported hiero.core/hiero.ui, and the `result` capture convention. It does not say that the code is unsandboxed, that mutations are not undoable, or that exceptions are surfaced as errors rather than thrown to the caller.

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 short lines: purpose and scoping first, then the return convention. Zero filler, and the escape-hatch framing is front-loaded.

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 single-parameter, destructive escape hatch with an output schema, the description covers the essentials an agent needs to call it successfully. The notable omission is the blast radius of arbitrary code execution in a live project session — no statement about persistence, undo, or sandboxing.

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 coverage is 0% and the schema only names a 'code' string with no description, so the description must carry the load — and it does, specifying the assignment target `result` that controls what is returned. The stdout/stderr/traceback note is redundant with the output schema and the string-of-source nature of `code` is only implied.

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?

States a specific verb and runtime context ('Run Python inside Hiero's main thread') and defines its role as the catch-all the other ~45 tools don't cover. An agent can immediately place it relative to siblings like add_effect or run_export.

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?

'for anything the other tools do not cover' gives an explicit selection rule favoring the dedicated siblings first, which is exactly the routing an agent needs. It stops short of naming concrete when-not cases (e.g. prefer delete_bin_item over raw code for deletions) or warning against routine use for simple operations.

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