Skip to main content
Glama
williamzujkowski

Strudel MCP Server

generate_bassline

Create bassline patterns in specified musical keys and styles for TidalCycles/Strudel music generation.

Instructions

Generate bassline

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesMusical key
styleYesBass style

Implementation Reference

  • Core handler function that generates Strudel bassline pattern code based on musical key and style, using predefined patterns with synth parameters.
    generateBassline(key: string, style: string): string {
      const patterns: Record<string, string> = {
        techno: `note("${key}2 ${key}2 ${key}2 ${key}2").s("sawtooth").cutoff(800)`,
        house: `note("${key}2 ~ ${key}2 ~").s("sine").gain(0.8)`,
        dnb: `note("${key}1 ~ ~ ${key}2 ~ ${key}1 ~ ~").s("square").cutoff(400)`,
        acid: `note("${key}2 ${key}3 ${key}2 ${this.theory.getNote(key, 3)}2").s("sawtooth").cutoff(sine.range(200, 2000).slow(4))`,
        dub: `note("${key}1 ~ ~ ~ ${key}1 ~ ${this.theory.getNote(key, 5)}1 ~").s("sine:2").room(0.5)`,
        funk: `note("${key}2 ${key}2 ~ ${this.theory.getNote(key, 5)}2 ~ ${key}2 ${this.theory.getNote(key, 7)}2 ~").s("square").cutoff(1200)`,
        jazz: `note("${key}2 ~ ${this.theory.getNote(key, 4)}2 ~ ${this.theory.getNote(key, 7)}2 ~").s("sine").gain(0.7)`,
        ambient: `note("${key}1").s("sine").attack(2).release(4).gain(0.6)`
      };
    
      return patterns[style] || patterns.techno;
    }
  • Tool registration in getTools(): defines name, description, and input schema for generate_bassline tool.
    {
      name: 'generate_bassline',
      description: 'Generate bassline',
      inputSchema: {
        type: 'object',
        properties: {
          key: { type: 'string', description: 'Musical key' },
          style: { type: 'string', description: 'Bass style' }
        },
        required: ['key', 'style']
      }
    },
  • Server-side tool handler: validates args, delegates to PatternGenerator, appends bassline to current pattern, writes it.
    case 'generate_bassline':
      InputValidator.validateRootNote(args.key);
      InputValidator.validateStringLength(args.style, 'style', 100, false);
      const bass = this.generator.generateBassline(args.key, args.style);
      const currentBass = await this.getCurrentPatternSafe();
      const newBassPattern = currentBass ? currentBass + '\n' + bass : bass;
      await this.writePatternSafe(newBassPattern);
      return `Generated ${args.style} bassline in ${args.key}`;
  • Input schema definition: requires 'key' (string) and 'style' (string) parameters.
    inputSchema: {
      type: 'object',
      properties: {
        key: { type: 'string', description: 'Musical key' },
        style: { type: 'string', description: 'Bass style' }
      },
      required: ['key', 'style']
    }
Behavior1/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure but fails completely. It doesn't indicate whether this is a read-only operation, what permissions might be required, whether it's destructive, what format the output takes, or any rate limits. The single phrase 'Generate bassline' reveals nothing about the tool's behavior beyond the obvious implication that it creates something.

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

Conciseness2/5

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

While technically concise with only two words, this represents under-specification rather than effective brevity. The description fails to provide necessary information that would help an agent understand and use the tool correctly. Every word should earn its place, but here the words don't provide sufficient value.

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

Completeness1/5

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

For a generative tool with no annotations and no output schema, the description is completely inadequate. It doesn't explain what the tool produces, in what format, with what constraints, or how the output relates to the input parameters. Given the complexity implied by musical generation and the lack of structured documentation elsewhere, this description fails to provide the necessary 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 schema description coverage is 100%, with both parameters (key and style) having clear descriptions in the schema. The tool description adds no additional information about parameter meaning, usage, or constraints beyond what's already documented in the structured 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.

Purpose2/5

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

The description 'Generate bassline' is a tautology that merely restates the tool name without adding any meaningful context. It doesn't specify what kind of bassline is generated, in what format, or for what purpose. While it includes a verb ('Generate') and resource ('bassline'), it lacks the specificity needed to distinguish it from sibling tools like generate_drums or generate_melody.

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 absolutely no guidance on when to use this tool versus alternatives. It doesn't mention any prerequisites, context for usage, or comparisons to sibling tools like generate_drums or generate_melody. This leaves the agent with no information about appropriate use cases.

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