Skip to main content
Glama

run_python_script

Execute Python scripts with command-line arguments, environment variables, and working directory options. Captures stdout/stderr and enforces timeouts for safe subprocess handling.

Instructions

Execute a Python script file with arguments. MCP-safe subprocess handling with captured stdout/stderr.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
cwdNoWorking directory (default: script's directory)
envNoAdditional environment variables
argsNoCommand-line arguments to pass to script
timeout_msNoTimeout in milliseconds (default: 30000, max: 300000)
script_pathYesPath to Python script

Schema Changelog

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

  1. First observedv1.0.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations, the description carries the full burden. It discloses that execution happens via a subprocess and that stdout/stderr are captured, which is useful. However, it does not warn about potential side effects of running arbitrary Python code, how errors are surfaced, or whether execution is blocking—important omissions for a code execution 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 a single sentence with no filler words. It front-loads the primary action and resource, and the subprocess/output detail is brief and relevant.

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

Completeness2/5

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

For a tool that executes arbitrary Python scripts, the description is incomplete. There is no output schema, yet the description does not explain the structure of the captured stdout/stderr result, error return behavior, or timeout implications. Critical safety context (script may have arbitrary side effects) is also missing.

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?

Schema description coverage is 100%, and each parameter (cwd, env, args, timeout_ms, script_path) already has a clear description in the schema. The tool description adds no additional parameter meaning, so the baseline 3 applies.

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 the action ('Execute') and the resource ('a Python script file'), and it differentiates from sibling tools like run_python_code by emphasizing 'script file' rather than inline code. The addition of 'with arguments' and 'captured stdout/stderr' further specifies what the tool does.

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 executing script files, but it does not explicitly state when to use this tool versus run_python_code, check_python_syntax, or the PowerShell siblings. No exclusions or alternative routing are provided.

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/For-Sunny/darkside-mcp'

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