Skip to main content
Glama

run_script

Run Lua inside REAPER with the full ReaScript API: pass code (source text) or path (a .lua file; relative paths resolve under the daemon folder, then REAPER's Scripts folder).

Instructions

Run Lua inside REAPER with the full ReaScript API: pass code (source text) or path (a .lua file; relative paths resolve under the daemon folder, then REAPER's Scripts folder). The script's return value and anything it printed with ShowConsoleMsg come back in the reply; reaper.defer is not available (the script must finish in one pass) and it is stopped after timeout_seconds (default 30). Project changes land in one undo block. Off until allow_script_execution is true in bridge_config.json (python3 setup/install.py --allow-script-execution).

Input Schema

NameRequiredDescriptionDefault
argsNoPassed to the chunk as ... and as the global args.
codeNo
pathNo
dry_runNoPreview: return what would run without changing the project.
timeout_secondsNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv3.23.1

TDQS

A4.5/5.0
Behavior5/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 so well: it discloses the return channel (script return value plus ShowConsoleMsg output), the execution model (single-pass, no defer), the hard stop at timeout_seconds (default 30), atomicity (all project changes in one undo block), and the gating/auth requirement via bridge_config.json. These are non-obvious traits an agent could not infer from the schema.

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?

Front-loaded with the core capability and the code/path choice, then constraints in decreasing order of importance. Slightly dense — the final setup-command clause is useful but reads like an appendix — yet no sentence is redundant.

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?

Covers the information most likely to cause a failed or surprising call: execution limits, output capture, undo behavior, and the enablement flag, despite having no annotations and no output schema. Minor gaps remain — whether code and path are mutually exclusive and what a failure reply looks like — but the critical unknowns are addressed.

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

Parameters4/5

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

At only 40% schema coverage, the description compensates for the undocumented parameters: it explains `code` as source text, `path` as a .lua file with a defined resolution order (daemon folder, then REAPER's Scripts folder), and supplies the default for the otherwise bare `timeout_seconds`. `args` is left entirely to the schema, which does document it, so the description stays above baseline without being exhaustive.

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 and resource ('Run Lua inside REAPER with the full ReaScript API') and immediately disambiguates the two invocation modes (inline `code` vs `path` to a .lua file). An agent can distinguish this from action-based siblings like run_action or raw_command without opening the schema.

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?

Gives concrete operating preconditions — the tool is 'Off until allow_script_execution is true' with the exact install flag to enable it — and states a hard constraint (reaper.defer unavailable, script must finish in one pass). It does not name alternatives such as run_action or raw_command for cases where a canned action would suffice, so routing guidance is implied rather than explicit.

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