Skip to main content
Glama
williamzujkowski

Strudel MCP Server

analyze

Analyzes audio to extract musical patterns and structures for use in TidalCycles/Strudel music generation and live coding.

Instructions

Complete audio analysis

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Registers the 'analyze' MCP tool in the tools list returned by getTools(), including name, description, and input schema (no parameters).
      name: 'analyze',
      description: 'Complete audio analysis',
      inputSchema: { type: 'object', properties: {} }
    },
  • Primary MCP tool handler for 'analyze'. Validates initialization and delegates to StrudelController.analyzeAudio() which performs the actual analysis.
    case 'analyze':
      if (!this.isInitialized) {
        return 'Browser not initialized. Run init first.';
      }
      return await this.controller.analyzeAudio();
  • Intermediate handler in StrudelController that forwards the analysis request to the AudioAnalyzer instance.
    async analyzeAudio(): Promise<AudioAnalysisResult> {
      if (!this._page) throw new Error('Browser not initialized. Run init tool first.');
    
      return await this.analyzer.getAnalysis(this._page);
    }
  • Core analysis handler. Uses page.evaluate to call the injected JavaScript analyzer in the browser, which computes FFT-based features like average, peak, frequency bands, etc. Includes caching.
    async getAnalysis(page: Page): Promise<AudioAnalysisResult> {
      // Client-side caching with local fallback
      const now = Date.now();
      if (this._analysisCache && (now - this._cacheTimestamp) < this.ANALYSIS_CACHE_TTL) {
        return this._analysisCache;
      }
    
      const result = await page.evaluate(() => {
        const analyzer = (window as any).strudelAudioAnalyzer;
        if (!analyzer) {
          return {
            connected: false,
            error: 'Analyzer not initialized. Audio context may not have started yet.',
            hint: 'Try playing a pattern first to initialize the audio context.'
          };
        }
    
        if (!analyzer.isConnected) {
          return {
            connected: false,
            error: 'Analyzer not connected to audio output.',
            hint: 'Play a pattern to connect the analyzer to Strudel audio output.'
          };
        }
    
        const analysis = analyzer.analyze();
    
        // Add diagnostic info if no audio detected
        if (analysis.features && analysis.features.isSilent) {
          analysis.hint = 'Audio analyzer connected but no audio detected. Ensure pattern is playing.';
        }
    
        return analysis;
      });
    
      // Update cache
      this._analysisCache = result;
      this._cacheTimestamp = now;
    
      return result;
    }
  • TypeScript interfaces defining the input/output structure for audio analysis results, used throughout the implementation chain.
    export interface AudioAnalysisResult {
      connected: boolean;
      timestamp?: number;
      features?: AudioAnalysisFeatures;
      error?: string;
    }
Behavior1/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Complete audio analysis' offers no information about what the tool does behaviorally—such as whether it performs read-only analysis, modifies audio, requires specific inputs, has side effects, or returns results. This leaves the agent with no understanding of the tool's operation or implications.

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

Conciseness3/5

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

The description is extremely concise—just two words—which could be efficient if it were informative. However, it under-specifies the tool's purpose and usage, making it feel incomplete rather than optimally brief. It is front-loaded but lacks substance, so it does not fully earn its place in terms of clarity.

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

Completeness2/5

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

Given the tool's name suggests complexity (audio analysis), the absence of annotations and output schema means the description should compensate by explaining behavior and results. 'Complete audio analysis' is too vague—it doesn't clarify what 'complete' entails, what the analysis outputs, or how it differs from siblings. This inadequacy leaves significant gaps for an agent to understand and use the tool effectively.

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

Parameters4/5

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

The input schema has no parameters (parameter count: 0), and schema description coverage is 100%, meaning there are no undocumented parameters. The description does not add parameter details beyond the schema, but since there are zero parameters, the baseline is high. It implicitly suggests the tool might operate on some default or contextual audio data, though this is not explicitly stated.

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

Purpose2/5

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

The description 'Complete audio analysis' is tautological—it essentially restates the tool name 'analyze' without specifying what analysis entails or what resource it operates on. While it implies a verb ('analyze') and a domain ('audio'), it lacks specificity about what aspects of audio are analyzed or what the output represents, making it vague compared to more detailed sibling tools like 'analyze_rhythm' or 'analyze_spectrum'.

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

Usage Guidelines1/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. With sibling tools like 'analyze_rhythm' and 'analyze_spectrum' that suggest more specific analyses, there is no indication of whether 'analyze' is a general-purpose tool, when it should be preferred, or what its scope includes relative to others. This absence of context makes it misleading for an agent trying to select the correct tool.

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