Skip to main content
Glama
williamzujkowski

Strudel MCP Server

list_history

Retrieve recent music pattern history with timestamps and previews to track creative iterations and access previous work.

Instructions

List recent pattern history with timestamps and previews

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoMaximum entries to return (default: 10)

Implementation Reference

  • The handler logic for the 'list_history' tool. It checks if history exists, slices the most recent entries (default limit 10), reverses for chronological order, and returns structured data with count, previews, character counts, actions, and formatted timestamps.
    case 'list_history':
      if (this.historyStack.length === 0) {
        return 'No pattern history yet. Make some edits to build history.';
      }
    
      const limit = args?.limit || 10;
      const recentHistory = this.historyStack.slice(-limit).reverse();
    
      return {
        count: this.historyStack.length,
        showing: recentHistory.length,
        entries: recentHistory.map(entry => ({
          id: entry.id,
          preview: entry.pattern.substring(0, 60) + (entry.pattern.length > 60 ? '...' : ''),
          chars: entry.pattern.length,
          action: entry.action,
          timestamp: this.formatTimeAgo(entry.timestamp)
        }))
      };
  • Registration of the 'list_history' tool in the getTools() array, including name, description, and input schema for optional 'limit' parameter.
      name: 'list_history',
      description: 'List recent pattern history with timestamps and previews',
      inputSchema: {
        type: 'object',
        properties: {
          limit: { type: 'number', description: 'Maximum entries to return (default: 10)' }
        }
      }
    },
  • TypeScript interface defining the structure of HistoryEntry objects stored in the historyStack, used by list_history and related tools.
    interface HistoryEntry {
      id: number;
      pattern: string;
      timestamp: Date;
      action: string;
    }
  • Helper code that populates the historyStack before tool execution (on write/append/etc.), incrementing ID counter, pushing new entry, and trimming stack to prevent memory issues.
    this.historyIdCounter++;
    this.historyStack.push({
      id: this.historyIdCounter,
      pattern: current,
      timestamp: new Date(),
      action: name
    });
    
    // Enforce bounds to prevent memory leaks
    if (this.undoStack.length > this.MAX_HISTORY) {
      this.undoStack.shift();
    }
    if (this.historyStack.length > this.MAX_HISTORY) {
      this.historyStack.shift();
    }
    this.redoStack = [];
  • Utility function formatTimeAgo used in list_history to format timestamps as human-readable 'time ago' strings (e.g., '2m ago').
    private formatTimeAgo(date: Date): string {
      const seconds = Math.floor((new Date().getTime() - date.getTime()) / 1000);
    
      if (seconds < 60) return `${seconds}s ago`;
      if (seconds < 3600) return `${Math.floor(seconds / 60)}m ago`;
      if (seconds < 86400) return `${Math.floor(seconds / 3600)}h ago`;
      return `${Math.floor(seconds / 86400)}d ago`;
    }
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions what information is returned ('timestamps and previews') but doesn't describe format, ordering, pagination behavior, or whether this is a read-only operation. For a tool with no annotation coverage, this leaves significant behavioral questions unanswered.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that communicates the core purpose without unnecessary words. It's appropriately sized for a simple listing tool and front-loads the essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple listing tool with one well-documented parameter and no output schema, the description provides adequate basic information about what's being listed. However, without annotations and with sibling tools like 'restore_history' present, more context about when to use this specific tool would be beneficial.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already fully documents the single 'limit' parameter. The description doesn't add any parameter-specific information beyond what's in the schema. This meets the baseline expectation when schema coverage is complete.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb ('list') and resource ('recent pattern history') with additional details about what information is included ('timestamps and previews'). It distinguishes from generic 'list' tool by specifying 'pattern history', but doesn't explicitly differentiate from other history-related tools like 'restore_history'.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. There's no mention of when this tool is appropriate versus other listing tools or history-related tools like 'restore_history'. The agent must infer usage from the name and description alone.

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

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