← All toolsVision & Controlcode_sandboxAll editions

RUN_PYTHON

Run a Python script and get the output.

Parameters

NameTypeRequiredDescription
codestringyesThe python code to execute

How to use it

You normally trigger this by describing what you want in chat — the agent selects RUN_PYTHON automatically. For example:

Try saying
“use code sandbox to run …”

In a workflow

As a step in a multi-step workflow DAG:

json
{
  "id": "s1",
  "agent": "code_sandbox",
  "action": "RUN_PYTHON",
  "args": {
    "code": "…"
  },
  "depends_on": [],
  "outputs": []
}

Direct call

For scripting, call it directly via POST /execute_tool. Every tool returns { success, message, data }.

bash
curl -X POST http://127.0.0.1:8000/execute_tool \
  -H "Content-Type: application/json" \
  -d '{"tool_name":"RUN_PYTHON","args":{"code":"…"}}'

Part of the code_sandbox plugin. Browse the full Plugin & Tool Catalog or the relevant feature guide.