py_eval
Execute Python code directly in IDA Pro's context with full access to IDA API modules, enabling automation and dynamic analysis of binaries.
Instructions
Execute Python code in IDA context. Returns dict with result/stdout/stderr. Has access to all IDA API modules. Supports Jupyter-style evaluation. WARNING: IDA executes on a single main thread. Long-running operations will block ALL subsequent requests and make IDA unresponsive. Do NOT iterate all functions, bulk decompile, or run heavy loops. Use decompile_to_file for batch decompilation instead.
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>",
"instance_id": "<instance_id>"
},
"name": "py_eval"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Python code | |
| instance_id | Yes | Target IDA instance ID (required) |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||