Skip to main content
Glama

replace

Find and substitute text patterns in Strudel music code to modify sequences, adjust parameters, or update musical elements during live coding sessions.

Instructions

Replace pattern section

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
searchYesText to replace
replaceYesReplacement text

Implementation Reference

  • Handler for the 'replace' MCP tool: validates search and replace string lengths, gets current pattern, replaces the first occurrence of search with replace, then writes the result via writePatternSafe.
    case 'replace': InputValidator.validateStringLength(args.search, 'search', 1000, true); InputValidator.validateStringLength(args.replace, 'replace', 10000, true); const pattern = await this.getCurrentPatternSafe(); const replaced = pattern.replace(args.search, args.replace); return await this.writePatternSafe(replaced);
  • Registration of the 'replace' tool in getTools() array, including description and input schema (object with required 'search' and 'replace' strings).
    { name: 'replace', description: 'Replace pattern section', inputSchema: { type: 'object', properties: { search: { type: 'string', description: 'Text to replace' }, replace: { type: 'string', description: 'Replacement text' } }, required: ['search', 'replace'] } },

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