execute_ruby
Execute Ruby code in SketchUp to automate 3D modeling tasks and access the complete SketchUp Ruby API.
Instructions
Execute arbitrary Ruby code inside SketchUp. The code runs in the context of the SU_MCP module and has full access to the SketchUp Ruby API (Sketchup, Geom, UI, etc.). Returns the result of the last expression and any puts/print output. Use with care — this can modify or delete model data.
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>"
},
"name": "execute_ruby"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Ruby source code to execute |