Skip to main content
Glama

mcp_opendaw_set_script_device_code

Set user JavaScript on openDAW scriptable devices (Apparat, Werkstatt, Spielwerk) to define custom DSP or MIDI behavior. The compiler validates and registers the code for the audio worklet.

Instructions

Set the user JavaScript code on a scriptable device (Apparat/Werkstatt/Spielwerk).

Compiles the code using the official OpenDAW ScriptCompiler, which:

  • Parses @param declarations and creates WerkstattParameterBox children

  • Parses @sample declarations and creates WerkstattSampleBox children

  • Validates the JavaScript (new Function check)

  • Registers the worklet module on the AudioContext

  • Writes the code with proper // @ header back to the device

The code defines a Processor class that the host instantiates in the audio worklet. @param declarations: // @param [type] [unit] @sample declarations: // @sample See the openDAW plans/apparat.md, plans/spielwerk.md for the full API.

device_type: "apparat" (instrument), "werkstatt" (audio effect), "spielwerk" (MIDI effect)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYes
unit_indexYes
device_typeYes
device_indexYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It does well: it details the compilation process (parsing @param/@sample, validation, registering worklet module, writing code back), and even states the effect on the device. It doesn't mention potential side effects or failure modes, but the covered steps are informative and honest.

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?

The description is moderately long but well-structured with bullet points and a clear explanation of the compilation steps. Every sentence adds value, and the @param/@sample syntax examples are useful. It could be slightly shortened without losing information, but it remains focused and readable.

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?

Given the complexity of scriptable devices and a 4-parameter schema, the description is largely complete. It explains the tool's behavior, the device types, and the code syntax. It also points to external references (plans/apparat.md) for further API details. Since an output schema exists, return values don't need explanation. The main gap is the lack of clarity about unit_index/device_index, but overall context is solid.

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 0%, so the description must compensate for the lack of parameter documentation. It adds meaning for 'code' (JavaScript code defining a Processor class) and 'device_type' (listing 'apparat', 'werkstatt', 'spielwerk'). However, 'unit_index' and 'device_index' are not explained beyond their schema names, leaving a gap for an agent that needs to know how to address the correct device.

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?

The description clearly states the tool's function: 'Set the user JavaScript code on a scriptable device (Apparat/Werkstatt/Spielwerk).' It uses a specific verb ('Set') and resource ('user JavaScript code on a scriptable device'), and the parenthetical enumeration of device types adds clarity. It is easily distinguished from siblings like get_script_device_code.

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 description explains when to use this tool: when setting user JavaScript code on scriptable devices, via the OpenDAW ScriptCompiler. It lists the device types and details the compilation steps, giving clear context. It doesn't explicitly exclude alternatives, but the context is sufficient for selecting this tool in most cases.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ameobius-ai/opendaw-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server