script_run
Run a ReaScript from REAPER's Scripts folder and read its result. Use this to execute local scripts, wait for output, and capture the reported value.
Instructions
Run a ReaScript from REAPER's own Scripts folder and optionally read back a result.
script_path must be one of the relative paths script_list returned. Registers the script as a REAPER action if it isn't already (safe to call every time), runs it, then waits up to wait_seconds for the script to report a result via reaper.SetExtState("reaper_mcp_script_result", "last_result", , false). Scripts that don't opt into this convention — including anything that hasn't finished running (e.g. a background/defer-based script) by the time wait_seconds elapses — come back with result_found: false.
This runs arbitrary local script code. Confirm with the user before calling this unless they've already given clear, specific instruction to run this exact script.
Args: script_path: Relative path from script_list, e.g. "MyScripts/foo.lua". wait_seconds: How long to wait for a result, 0-30. Default 5.0.
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": {
"script_path": "<script_path>"
},
"name": "script_run"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| script_path | Yes | ||
| wait_seconds | No |