lua_execute
Run Lua 5.4 code live inside Moho Pro 14.4 to automate project edits, with scoped moho/helpers/json APIs, optional undo protection, and captured print logs.
Instructions
Execute Lua 5.4 code live inside Moho Pro 14.4 with moho, helpers, json, delaunay, and args in scope. Guarded by pcall + optional PrepMultiUndo and captures print() logs.
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": "lua_execute"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| args | No | Optional JSON object exposed as `args` inside the chunk | |
| code | Yes | Lua 5.4 chunk to execute; `return <value>` sends JSON back | |
| undo | No | Wrap in PrepMultiUndo before running (default: true) |