Scripting Tools
These tools let the assistant (and external MCP clients) create new Grasshopper script components, update existing script components on your canvas, or review script code for bugs and API misuse. They support Python 3, C#, VB.NET, and IronPython.
Creating, editing, and reviewing scripts
When you ask the assistant to write or fix a script, it uses the canvas-aware tools below. Every generated script is checked by SmartHopper's static script validator before it is proposed on your canvas.
| Tool | What it does |
|---|---|
script_generate_and_place_on_canvas | Generates a complete Grasshopper script component — including input and output parameters, type hints, access modes (item, list, tree), and code — from natural-language instructions, and proposes placing it on your canvas. |
script_edit_and_replace_on_canvas | Reads an existing script component on your canvas by GUID, updates its code and parameters according to your instructions, and replaces it in place while preserving its wires. |
script_review | Runs deterministic static code checks plus an AI code review on an existing script component by GUID — catching bugs, RhinoCommon/Grasshopper API mistakes, and performance issues without executing the script. |
Component-level helper tools
The AI Script Generate and AI to Script components also use two non-placing variants under the hood:
script_generate— generates the GhJSON for a new script component without placing it on the canvas.script_edit— takes an existing script component's GhJSON and instructions and returns the updated GhJSON without modifying the canvas.