Run Python on a board
pico_python_runExecute Python code or run a file on a connected MicroPython or CircuitPython board, with timeout handling to interrupt long-running programs.
Instructions
Run a Python file as main or execute Python code. Provide exactly one of path or code. This can change any state accessible to code on the board. A program still running after timeout_ms is interrupted with Ctrl-C.
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": {
"board_id": "<board_id>"
},
"name": "pico_python_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | No | ||
| path | No | Path on the board filesystem, relative to its root. | |
| board_id | Yes | Stable board UID returned by pico_boards_list, or its current serial device path. | |
| timeout_ms | No | Execution timeout in milliseconds (default 30000, max 600000). |