Skip to main content
Glama

MCP Python Interpreter

by yzfly

run_python_code

Execute Python code directly within a specified working directory, returning results for instant use. Supports custom environments and optional code saving for future reference.

Instructions

Execute Python code and return the result. Code runs in the working directory. Args: code: Python code to execute environment: Name of the Python environment to use (default if custom path provided, otherwise system) save_as: Optional filename to save the code before execution (useful for future reference)

Input Schema

NameRequiredDescriptionDefault
codeYes
environmentNodefault
save_asNo

Input Schema (JSON Schema)

{ "properties": { "code": { "title": "Code", "type": "string" }, "environment": { "default": "default", "title": "Environment", "type": "string" }, "save_as": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Save As" } }, "required": [ "code" ], "title": "run_python_codeArguments", "type": "object" }

Other Tools from MCP Python Interpreter

Related Tools

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/yzfly/mcp-python-interpreter'

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