Skip to main content
Glama

restore_history

Retrieve and restore a previously saved music pattern from history using its unique ID for reuse in Strudel.cc live coding sessions.

Instructions

Restore a previous pattern from history by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
idYesHistory entry ID to restore

Implementation Reference

  • The handler implementation for the 'restore_history' tool. It checks if the browser is initialized, finds the history entry by ID from this.historyStack, pushes the current pattern to undoStack, writes the restored pattern using the controller, and returns a success message with timestamp.
    case 'restore_history': if (!this.isInitialized) { return 'Browser not initialized. Run init first.'; } const entryToRestore = this.historyStack.find(e => e.id === args.id); if (!entryToRestore) { return `History entry #${args.id} not found. Use list_history to see available entries.`; } // Save current state before restoring const currentBeforeRestore = await this.controller.getCurrentPattern(); this.undoStack.push(currentBeforeRestore); if (this.undoStack.length > this.MAX_HISTORY) { this.undoStack.shift(); } await this.controller.writePattern(entryToRestore.pattern); return `Restored pattern from history #${args.id} (${this.formatTimeAgo(entryToRestore.timestamp)})`;
  • The input schema definition for the 'restore_history' tool, specifying a required 'id' parameter of type number.
    { name: 'restore_history', description: 'Restore a previous pattern from history by ID', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'History entry ID to restore' } }, required: ['id'] } },
  • The tool registration entry in the getTools() array, which includes the name, description, and schema, used by the MCP server to advertise and validate the tool.
    { name: 'restore_history', description: 'Restore a previous pattern from history by ID', inputSchema: { type: 'object', properties: { id: { type: 'number', description: 'History entry ID to restore' } }, required: ['id'] } },

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