Skip to main content
Glama
williamzujkowski

Strudel MCP Server

generate_drums

Create drum patterns for music production by specifying style and complexity parameters. This tool helps musicians generate rhythmic sequences for use in TidalCycles/Strudel live coding environments.

Instructions

Generate drum pattern

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
styleYesDrum style
complexityNoComplexity (0-1)

Implementation Reference

  • Main tool handler: validates inputs, generates drum pattern using PatternGenerator, appends to current pattern if any, writes to editor, returns confirmation.
    case 'generate_drums':
      InputValidator.validateStringLength(args.style, 'style', 100, false);
      if (args.complexity !== undefined) {
        InputValidator.validateNormalizedValue(args.complexity, 'complexity');
      }
      const drums = this.generator.generateDrumPattern(args.style, args.complexity || 0.5);
      const currentDrum = await this.getCurrentPatternSafe();
      const newDrumPattern = currentDrum ? currentDrum + '\n' + drums : drums;
      await this.writePatternSafe(newDrumPattern);
      return `Generated ${args.style} drums`;
  • Tool schema definition including input schema for style (required) and optional complexity.
    {
      name: 'generate_drums',
      description: 'Generate drum pattern',
      inputSchema: {
        type: 'object',
        properties: {
          style: { type: 'string', description: 'Drum style' },
          complexity: { type: 'number', description: 'Complexity (0-1)' }
        },
        required: ['style']
      }
  • Core helper function that returns a predefined Strudel drum pattern string based on the specified style and complexity level, selecting from arrays of patterns per style.
    generateDrumPattern(style: string, complexity: number = 1): string {
      const patterns: Record<string, string[]> = {
        techno: [
          's("bd*4")',
          's("bd*4, ~ cp ~ cp")',
          's("bd*4, ~ cp ~ cp, hh*8")',
          's("bd*4, ~ cp ~ cp, [~ hh]*4, oh ~ ~ ~").swing(0.05)'
        ],
        house: [
          's("bd*4, hh*8")',
          's("bd*4, hh*8, ~ cp ~ cp")',
          's("bd*4, [~ hh]*4, ~ cp ~ cp, oh ~ oh ~")',
          's("bd*4, [~ hh]*4, ~ cp ~ cp").every(4, x => x.fast(2))'
        ],
        dnb: [
          's("bd ~ ~ bd ~ ~ bd ~, ~ ~ cp ~ ~ cp ~ ~")',
          's("bd ~ ~ [bd bd] ~ ~ bd ~, ~ ~ cp ~ ~ cp ~ ~, hh*16")',
          's("bd ~ ~ [bd bd] ~ ~ bd ~, ~ ~ cp ~ [~ cp] ~ cp ~ ~, hh*16").fast(2)'
        ],
        breakbeat: [
          's("bd ~ ~ bd ~ ~ ~ bd, ~ cp ~ ~ cp ~")',
          's("bd ~ ~ bd ~ [~ bd] ~ bd, ~ cp ~ ~ cp ~, hh*8")',
          's("bd ~ [~ bd] bd ~ [~ bd] ~ bd, ~ cp ~ ~ cp [~ cp], hh*8").swing(0.1)'
        ],
        trap: [
          's("bd*2, ~ cp ~ cp")',
          's("bd*2, ~ cp ~ cp, hh*8").every(2, x => x.fast(2))',
          's("bd [bd bd] ~ bd, ~ cp ~ cp, hh*16").swing(0.2)'
        ],
        jungle: [
          's("bd ~ [~ bd] bd ~ ~ bd ~, ~ cp ~ ~ cp ~").fast(2)',
          's("bd ~ [~ bd] bd ~ [bd bd] bd ~, ~ cp ~ [~ cp] cp ~, hh*32").fast(2)'
        ],
        ambient: [
          's("bd ~ ~ ~")',
          's("bd ~ ~ ~, ~ ~ ~ hh:8").room(0.9)',
          's("bd ~ ~ ~, ~ ~ ~ hh:8, ~ ~ oh:5 ~").room(0.9).gain(0.5)'
        ],
        experimental: [
          's("bd").euclid(5, 8)',
          's("bd cp").euclid(7, 16)',
          's("bd cp hh").euclid(choose([3, 5, 7]), 16)'
        ]
      };
    
      const stylePatterns = patterns[style] || patterns.techno;
      const index = Math.min(Math.floor(complexity * stylePatterns.length), stylePatterns.length - 1);
      return stylePatterns[index];
    }
Behavior2/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. 'Generate drum pattern' implies a creation operation but doesn't specify whether it's read-only, destructive, requires permissions, or details about output format, rate limits, or side effects. This leaves significant gaps for an agent to understand the tool's behavior.

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 extremely concise with just two words, 'Generate drum pattern', which is front-loaded and wastes no space. However, this conciseness comes at the cost of completeness, as it lacks necessary details for effective use.

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 complexity of a generation tool with no annotations, no output schema, and multiple sibling tools, the description is incomplete. It fails to explain what the tool returns, how it differs from similar tools, or behavioral traits, making it inadequate for an agent to use correctly without additional context.

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?

The input schema has 100% description coverage, with parameters 'style' and 'complexity' documented in the schema. The description adds no additional meaning beyond what the schema provides, such as examples of styles or how complexity affects the pattern. Baseline 3 is appropriate since the schema does the heavy lifting.

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

Purpose3/5

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

The description 'Generate drum pattern' states the basic action (generate) and resource (drum pattern), which provides a vague purpose. However, it doesn't specify what kind of drum pattern or how it differs from sibling tools like 'generate_pattern', 'generate_fill', or 'generate_euclidean', leaving ambiguity about its specific scope.

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 offers no guidance on when to use this tool versus alternatives. With many sibling tools like 'generate_pattern', 'generate_fill', and 'generate_bassline', there's no indication of context, prerequisites, or exclusions, making it unclear how to choose appropriately.

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