Execute a Python file in the worker
py_exec_fileExecute a Python script file in IDA and return stdout/stderr, using one shared globals dict so top-level definitions are visible to all code in large scripts.
Instructions
Execute a Python script file in IDA context and return stdout/stderr.
Unlike py_eval, this runs the entire file with exec() using a single shared globals dict (no locals split), so top-level definitions are visible to all code in the script. Handles large scripts that would be unwieldy as inline code.
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": {
"file_path": "<file_path>"
},
"name": "py_exec_file"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| file_path | Yes | Absolute path to a Python script to execute | |
| instance_id | No | Optional database instance id. If omitted, use the current target. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes | ||
| stderr | Yes | ||
| stdout | Yes |