run Python
run-pythonRun custom Python code to inspect, validate, report on, and export IFC/BIM files, or create new ones.
Instructions
Execute LLM-created Python in the SDK Node/Pyodide IFC runtime. Use this tool for IFC inspection, validation, reports, exports, and creating new IFC files.
Runtime context: Pyodide uses the bundled Pyodide 0.28.2 runtime. The package set includes micropip, ifcopenshell, numpy, pandas, matplotlib, shapely, and typing-extensions. The Python code is passed directly to the SDK.
File inputs: pass IFC/IFCXML/IFCZIP file paths in the files array. In the desktop Node server these are local filesystem paths; in a browser host they are browser-defined paths resolved by that host. Generated Python can open those files by name, e.g. ifcopenshell.open("model.ifc") or open("model.ifc", "rb").
Return contract: this tool exposes stdout, stderr, saved_files, uploaded_files, and any result returned by the raw SDK. Generated files are returned as temporary localhost download URLs in saved_files. Do not assume files were written to the user's working directory.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Raw Python code to execute through the SDK. Files passed through files can be opened by name, e.g. ifcopenshell.open("model.ifc") or open("model.ifc", "rb"). | |
| files | No | Optional array of IFC/IFCXML/IFCZIP file paths. Desktop hosts use local filesystem paths; browser hosts use browser-defined paths. | |
| timeout_seconds | No | Timeout in seconds. |