Skip to main content
Glama
szeider
by szeider

python_exec

Execute Python code in a persistent MiniZinc solving kernel to keep variables and imports across calls; set timeout up to 300s for long solver runs.

Instructions

Execute Python code in the persistent solving kernel.

Runs in the kernel set up by select_backend unless kernel_id overrides it. State persists across calls (variables, imports). Raise timeout (seconds, max 300) for long solver runs.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
timeoutNo
kernel_idNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv4.1.0

TDQS

A3.6/5.0
Behavior3/5

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

No annotations, so the description carries the full burden. It usefully discloses that state (variables, imports) persists across calls and that timeout caps at 300 seconds, but says nothing about error behavior, sandboxing, or how execution output is captured/returned.

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?

Four short lines, purpose front-loaded, with each remaining sentence adding a distinct operational fact (kernel source, state persistence, timeout cap). No filler or restated name text.

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

Completeness3/5

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

No output schema exists, yet the description never describes what an execution returns (stdout, errors, result value), which is a meaningful gap for a code-execution tool. Kernel selection, persistence, and timeout behavior are covered, so the definition is workable but not complete.

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, and it does for two of three params: kernel_id is explained as overriding the kernel established by select_backend, and timeout is defined in seconds with a max of 300. The 'code' param is left implicit but is self-evident from the tool purpose.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb+resource ('Execute Python code') and adds the key qualifier that it runs in the persistent solving kernel, which differentiates it from a one-shot execution. It references select_backend for kernel setup, but never contrasts itself with submit_code, so sibling distinction is only partial.

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?

Gives implied usage guidance: raise the timeout for long solver runs, and rely on state persisting across calls. However, it never says when to prefer this over submit_code or when to instead use python_interrupt/python_reset, so the caller must infer routing.

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