Skip to main content
Glama

append

Add code to extend existing music patterns in Strudel for live coding and AI-powered music generation.

Instructions

Append code to current pattern

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
codeYesCode to append

Implementation Reference

  • Executes the 'append' tool: validates the code length, retrieves the current pattern safely, appends the new code with a newline, and writes the updated pattern back.
    case 'append': InputValidator.validateStringLength(args.code, 'code', 10000, true); const current = await this.getCurrentPatternSafe(); return await this.writePatternSafe(current + '\n' + args.code);
  • Registers the 'append' tool with its name, description, and input schema in the getTools() method.
    { name: 'append', description: 'Append code to current pattern', inputSchema: { type: 'object', properties: { code: { type: 'string', description: 'Code to append' } }, required: ['code'] }
  • Defines the input schema for the 'append' tool, requiring a 'code' string parameter.
    inputSchema: { type: 'object', properties: { code: { type: 'string', description: 'Code to append' } }, required: ['code']
  • Helper method in StrudelController that appends code to the current pattern by fetching it, concatenating, and writing back (similar logic to the tool handler).
    async appendPattern(code: string): Promise<string> { if (!this._page) { throw new Error('Browser not initialized. Run init tool first.'); } const current = await this.getCurrentPattern(); const newPattern = current + '\n' + code; return this.writePattern(newPattern); }

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/williamzujkowski/strudel-mcp-server'

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