Skip to main content
Glama
rafalswiderski

Dynamic Code Executor MCP Server

execute_code

Run Python, JavaScript, or TypeScript code in a secure sandbox, optionally install packages, and get output, errors, and execution time for testing or data processing.

Instructions

Execute code in a secure isolated sandbox. Supports Python, JavaScript, and TypeScript.

The code will be executed in a temporary environment that is cleaned up after execution. You can optionally install packages before execution.

Use this when you need to:

  • Run code to get results or test functionality

  • Process data dynamically

  • Validate code behavior

  • Install and use external packages

Returns execution results including output, errors, and execution time.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesThe code to execute. Code has full read/write access to its workspace directory.
timeoutNoExecution timeout in milliseconds (default: 30000ms, max: 300000ms)
languageYesProgramming language to execute
packagesNoOptional packages to install before execution (must be whitelisted - use list_allowed_packages)
useCacheNoUse persistent cache for identical code (default: true). Cached results are instant.
descriptionNoBrief description of what the code does (e.g., "fetch GitHub API data"). Used for semantic caching - similar tasks may return cached results even if code differs.
allowNetworkingNoAllow network access (default: true)
Behavior3/5

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

With no annotations provided, the description carries full behavioral disclosure. It mentions the sandbox, cleanup, and return values, but omits the default caching behavior (useCache=true) and semantic caching, which can significantly affect execution results.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a clear lead sentence, a details paragraph, and a bulleted list of use cases. It is slightly verbose but each section earns its place.

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?

The description covers core usage, environment cleanup, and return values, which is adequate for an execution tool. The rich schema compensates for parameter details, but missing caching behavior leaves a minor completeness gap.

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 coverage is 100%, so a baseline score of 3 applies. The description adds little beyond the schema, only mentioning optional package installation, which is already documented in the packages parameter.

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 tool executes code in a secure isolated sandbox, supports multiple languages, and lists concrete use cases. This distinguishes it from siblings like validate_code or list_supported_languages.

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?

The description explicitly provides 'Use this when you need to' scenarios, giving clear context for when to use the tool. However, it does not mention when not to use it or alternatives for validation-only tasks, so it lacks exclusions.

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/rafalswiderski/mcp-code-executor'

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