Skip to main content
Glama

reaper_execute_lua

Destructive

Run custom ReaScript Lua code inside REAPER for tasks the built-in tools do not cover. Captures print output and groups edits into a single undo step unless read-only.

Instructions

Run arbitrary ReaScript Lua inside REAPER for anything the other tools don't cover. Runs as a single undo step unless read_only. print() output is captured and returned.

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": "reaper_execute_lua"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYesLua 5.4 ReaScript code; `reaper` API is available, `return` a value to get it back
read_onlyNoTrue for code that only reads; skips the undo point

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A4.2/5.0
Behavior4/5

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

Annotations already declare destructiveHint=true and readOnlyHint=false, so the description's job is to add nuance, which it does: it discloses undo granularity ('single undo step unless read_only') and output handling ('print() output is captured and returned'). It does not discuss sandboxing, execution timeouts, or error propagation for arbitrary code, which would round this out.

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

Conciseness5/5

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

Two short sentences, front-loaded with purpose before behavior. Every clause carries information: fallback scope, undo granularity, and output capture.

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 two-parameter, no-output-schema tool, the description covers what it does, the undo consequence, and how results come back. Missing only edge-case behavior (errors, timeouts, permission/model state) that an agent running arbitrary code might want to know.

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 both `code` and `read_only` are already documented. The description adds only a light reinforcement by tying read_only to the undo behavior; it contributes no new syntax or API-surface detail beyond the schema's note about the `reaper` API and `return`.

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

Purpose5/5

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

States a specific verb ('Run') and resource ('arbitrary ReaScript Lua inside REAPER') and immediately positions itself relative to the rest of the toolset with 'for anything the other tools don't cover'. An agent can tell this is the escape hatch versus the focused siblings like reaper_run_action or reaper_add_marker.

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

Usage Guidelines4/5

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

The clause 'for anything the other tools don't cover' gives a clear selection rule: reach for this only when no dedicated tool fits. It stops short of naming a concrete sibling or stating when not to use it, but the fallback framing is unambiguous.

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