Skip to main content
Glama

python_run

Run sandboxed Python code snippets in a restricted environment with a timeout, capturing stdout, stderr, and exit status.

Instructions

Voer een kort Python-fragment uit in de geconfigureerde sandboxdirectory.

code is verplichte Python-broncode en wordt met de geconfigureerde interpreter als python -S -c uitgevoerd. De subprocess krijgt alleen een minimale PATH en PYTHONUNBUFFERED, gebruikt sandbox_cwd als werkdirectory en wordt na 8 seconden beëindigd. De code kan binnen de rechten en isolatie van het MCP-serviceproces side effects veroorzaken. Stdout, stderr, exitcode en successtatus worden geretourneerd.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Behavior5/5

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

Without annotations, the description carries full weight. It details execution environment (minimal PATH, PYTHONUNBUFFERED, sandbox_cwd), timeout (8 seconds), side-effect potential within MCP service process rights, and explicit return fields (stdout, stderr, exitcode, success). This exceeds typical transparency.

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, front-loaded with purpose, and each sentence adds essential information (command, environment, timeout, side effects, output). No redundant or missing details.

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?

Given a single required parameter and an assumed output schema, the description provides complete context: input specification, execution behavior, environment constraints, timeout, and output summary. It is self-contained and actionable.

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?

With 0% schema description coverage, the description compensates by stating that `code` is mandatory Python source code executed via `-c`, adding meaning beyond the schema's plain string type. It could further clarify that the code must be a valid Python expression or statement, but the current explanation is sufficient.

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 clearly states it executes a short Python fragment in a configured sandbox directory using a specific interpreter invocation (`python -S -c`). This verb+resource combination distinguishes it from siblings like `execute_shell_command`, which runs arbitrary shell commands.

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 description implies usage for Python code execution but does not explicitly state when to use this tool versus alternatives (e.g., `execute_shell_command`). No exclusion criteria or contextual hints are provided beyond the fact that it runs Python.

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

Install Server

Other Tools

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/gerard-kanters/mcp-linux-tools'

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