Skip to main content
Glama

mcp_opendaw_set_script_device_code

Set user JavaScript code on scriptable openDAW devices to create custom audio effects, instruments, or MIDI processing, with automatic compilation and parameter parsing.

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?

No annotations provided, so description carries the burden. It details compilation steps (parsing, validation, worklet registration, writing code). It does not mention destructive side effects or permissions, but provides substantial behavioral context.

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 lengthy but well-structured with a clear core purpose and bullet-pointed steps. It is front-loaded and each sentence adds value, though could be slightly more concise.

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 an output schema exists (not shown), description covers main aspects: purpose, compilation process, device types, and code syntax. It lacks prerequisites or error conditions, but is largely complete for a mutation tool.

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?

Schema coverage is 0%, but description adds significant meaning for 'code' (syntax with @param/@sample) and 'device_type' (lists exact values). It does not detail 'unit_index' or 'device_index', but overall compensates well for the low coverage.

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 sets user JavaScript code on a scriptable device, specifying the verb 'Set', the resource 'script device code', and the scope (Apparat/Werkstatt/Spielwerk). It distinguishes from siblings like get_script_device_code and other set_* tools.

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 the compilation process and lists device types with their roles, implying usage when programming a scriptable device. It lacks explicit when-to-use or alternatives but is clear enough for an AI agent.

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-team/opendaw-mcp'

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