Skip to main content
Glama

load

Retrieve saved music patterns from storage for use in live coding sessions with Strudel.cc, enabling AI-assisted music generation and audio manipulation.

Instructions

Load saved pattern

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
nameYesPattern name

Implementation Reference

  • Main handler logic for the 'load' MCP tool. Validates input, loads pattern from store, writes it to the Strudel editor, and returns success/error message.
    case 'load': InputValidator.validateStringLength(args.name, 'name', 255, false); const saved = await this.store.load(args.name); if (saved) { await this.writePatternSafe(saved.content); return `Loaded pattern "${args.name}"`; } return `Pattern "${args.name}" not found`;
  • Tool registration in getTools() method, including name, description, and input schema. Used by MCP server for tool listing.
    name: 'load', description: 'Load saved pattern', inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Pattern name' } }, required: ['name'] } },
  • Input schema definition for the 'load' tool, specifying required 'name' parameter as string.
    inputSchema: { type: 'object', properties: { name: { type: 'string', description: 'Pattern name' } }, required: ['name'] }
  • Helper method in PatternStore that loads a saved pattern from JSON file, with caching and error handling.
    async load(name: string): Promise<PatternData | null> { // Check cache first if (this.patternCache.has(name)) { return this.patternCache.get(name)!; } const filename = this.sanitizeFilename(name) + '.json'; const filepath = path.join(this.basePath, filename); try { const data = await fs.readFile(filepath, 'utf-8'); const pattern = JSON.parse(data); // Update cache this.patternCache.set(name, pattern); return pattern; } catch (error) { this.logger.warn(`Failed to load pattern: ${name}`, error); return null; }

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