Skip to main content
Glama

reaper_eval_lua

Execute arbitrary ReaScript Lua code in REAPER's main thread and return a JSON-serializable result for advanced project automation and custom actions.

Instructions

Advanced escape hatch: execute arbitrary ReaScript Lua code inside REAPER's main thread and return its JSON-serializable result.

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_eval_lua"
  }
}

Input Schema

NameRequiredDescriptionDefault
codeYes
undo_labelNoReaperAgent Lua

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.1.0

TDQS

A3.6/5.0
Behavior3/5

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

With no annotations supplied, the description must carry the full behavioral burden, and it does disclose two valuable traits: code runs on REAPER's main thread (a meaningful concurrency/blocking constraint) and results must be JSON-serializable. It is silent on whether execution is sandboxed, how errors or timeouts surface, whether an undo block is actually created, and how destructive arbitrary code can be — significant omissions for an arbitrary-code tool.

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?

A single front-loaded sentence with no filler; the most decision-relevant qualifiers (advanced, escape hatch, main thread, JSON-serializable result) all appear before any elaboration.

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

Completeness3/5

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

An output schema exists, so return-value explanation is legitimately omitted, and the description covers purpose and execution context. However, for an unannotated arbitrary-code execution tool it should still say more about safety, undo behavior, and error surfacing before an agent commits to using it.

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

Parameters2/5

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

Schema description coverage is 0% and the description never mentions either parameter. The second parameter, undo_label, is semantically non-obvious (undo block label, default "ReaperAgent Lua") and is precisely the kind of detail the description should explain, especially its relationship to undo grouping. Only the meaning of code is inferable from the sentence.

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 (execute), a specific resource (arbitrary ReaScript Lua code), the execution context (REAPER's main thread), and the return contract (JSON-serializable result). The phrase "advanced escape hatch" positions it against the entire catalog of named operation tools without needing to enumerate them.

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

Usage Guidelines3/5

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

"Escape hatch" strongly implies last-resort usage when the dedicated sibling tools cannot accomplish the task, but this is inferred rather than stated. There is no explicit when-not guidance, no examples of what the named tools cover versus what requires raw code, and no prerequisite checks (e.g., trust or permission needed to run arbitrary code).

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