302AI Sandbox MCP Server

Official

runCode

Execute code in a secure sandbox environment with specified language and environment variables. Retrieve text output directly; for file operations, use dedicated viewing and export endpoints.

Instructions

Run code on a specific sandbox. This returns text output only. For operations that generate files, you'll need to use separate file viewing and export endpoints. Default file saving path is /home/user.

Input Schema

NameRequiredDescriptionDefault
codeYesThe code to run
envsNoEnvironment variables to set when running the code
languageNoThe programming language to use. If not specified or if the value is not in the allowed range, it will be treated as Python code.python
sandbox_idYesThe ID of the sandbox to run the code on
timeoutNoThe timeout for code execution in seconds

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "code": { "description": "The code to run", "type": "string" }, "envs": { "additionalProperties": { "type": "string" }, "description": "Environment variables to set when running the code", "type": "object" }, "language": { "default": "python", "description": "The programming language to use. If not specified or if the value is not in the allowed range, it will be treated as Python code.", "enum": [ "python", "r", "java", "bash", "js" ], "type": "string" }, "sandbox_id": { "description": "The ID of the sandbox to run the code on", "type": "string" }, "timeout": { "default": 5, "description": "The timeout for code execution in seconds", "type": "integer" } }, "required": [ "code", "sandbox_id" ], "type": "object" }

You must be authenticated.

Other Tools from 302AI Sandbox MCP Server

Related Tools

ID: n4r8aw20s4