run_python
Execute Python code snippets in a secure sandboxed environment with configurable timeouts, memory limits, and network restrictions. Returns the output of the executed code.
Instructions
Ejecuta un fragmento de código Python y devuelve su salida.
El código corre en un subproceso separado con:
Timeout configurable (por defecto 10 segundos).
Sin acceso a red (variables de entorno anuladas).
Límite de memoria de 256 MB en Linux.
El módulo sys.exit() termina el proceso sin errores.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"code": "<code>"
},
"name": "run_python"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Código Python a ejecutar. | |
| timeout | No | Tiempo máximo de ejecución en segundos (máximo 60). | |
| stdin | No | Texto a pasar como entrada estándar al programa. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |