fusion_execute_python
Execute Python scripts within Autodesk Fusion to automate modeling, assembly, CAM, and inspection tasks. Supports idempotent operations and read-only mode for safe scripted control.
Instructions
Run Python defining run(context) inside Fusion. Supports all installed API namespaces.
Mutations require document id from fusion_inspect and a unique operation_id. Repeat the same id/request to retrieve its prior result without executing again. Exceptions may leave partial changes. Inspect results separately; succeeded means the script returned, not that geometry or machining correctness was verified. Script code is trusted local code, not sandboxed. Use explicit units in scripts.
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": {
"script": "<script>"
},
"name": "fusion_execute_python"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes | ||
| read_only | No | ||
| operation_id | No | ||
| expected_document_id | No |