Primitive tool

Code Interpreter

Executes code in an isolated container for calculation and analysis.

1000 specialists use this tool · runtime: sandbox

Capabilities

  • Run Python code with data processing packages such as pandas and NumPy
  • Run JavaScript and Bash as separate environments
  • Capture standard output and standard error of a run separately
  • Catch a timeout or memory limit and stop the run
  • Return syntax errors with the line number
  • Attach a file from a previous run and write result files

Constraints

  • No network access. All socket and DNS calls are denied.
  • Cap CPU, memory, and runtime at the limits of the configuration.
  • Accept code only from the current conversation.
  • Wipe the container at the end of each run.

MCP schema

{
  "name": "code_interpreter",
  "input": {
    "type": "object",
    "required": [
      "language",
      "code"
    ],
    "properties": {
      "code": {
        "type": "string"
      },
      "language": {
        "enum": [
          "python",
          "javascript",
          "bash"
        ]
      },
      "input_files": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "timeout_seconds": {
        "type": "integer"
      }
    }
  },
  "output": {
    "type": "object",
    "properties": {
      "stderr": {
        "type": "string"
      },
      "stdout": {
        "type": "string"
      },
      "exit_code": {
        "type": "integer"
      },
      "duration_ms": {
        "type": "integer"
      },
      "files_written": {
        "type": "array",
        "items": {
          "type": "string"
        }
      }
    }
  },
  "description": "Runs code in an isolated container and returns output, errors, and a run report."
}

See the specialists built on this tool