execute_script
Run custom Python scripts in FreeCAD to create objects, modify properties, run macros, or access APIs not exposed by other tools.
Instructions
Execute arbitrary Python code in FreeCAD's interpreter context.
The script has access to: FreeCAD, FreeCADGui, App, Gui, doc (active document). Stdout and stderr are captured and returned.
Use this as an escape hatch for operations not covered by the specific tools above. For example: creating objects, modifying properties, running macros, or accessing FreeCAD APIs not yet exposed as tools.
Args: script: Python code to execute.
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": "execute_script"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script | Yes |