Skip to main content
Glama

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

NameRequiredDescriptionDefault
argsNoOptional JSON object exposed as `args` inside the chunk
codeYesLua 5.4 chunk to execute; `return <value>` sends JSON back
undoNoWrap in PrepMultiUndo before running (default: true)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv3.0.0

TDQS

B3.2/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the full burden and does add real behavior: pcall guarding, optional PrepMultiUndo wrapping, and print() log capture. It does not disclose what an error looks like to the caller, whether pcall swallows failures or surfaces them, or any permission/trust requirement for arbitrary code execution.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two dense sentences with the host and scope front-loaded and the safety/logging traits second. No filler, though the telegraphic '+' phrasing is slightly compressed.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 3-parameter, annotation-free tool with no output schema, the description covers scope, error handling, undo behavior, and logging. The remaining gap is error-result semantics and the meaning of the default undo wrapping, which matter for a mutation-capable execution tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents code, args, and undo. The description corroborates that args is exposed in scope and that the chunk runs live in the host, but adds no format or semantics beyond the schema text.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description names a specific verb (execute) and resource (Lua 5.4 code) and scopes it to a concrete host (Moho Pro 14.4), plus enumerates the injected API surface (moho, helpers, json, delaunay, args). It is clear what the tool does, though it does not contrast itself with a sibling such as batch_execute.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It never states when to reach for raw Lua execution versus the many dedicated action_*/bone_* tools, nor any when-not condition or prerequisite. The use case is only implied by the verb 'execute'.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.