Skip to main content
Glama
dandeliongold

Decent-Sampler Drums MCP Server

configure_round_robin

Configure round robin playback for drum samples by validating sequences, checking file existence, and generating proper XML structure for DecentSampler drum kits.

Instructions

Configure round robin sample playback for a set of samples.

This tool will:

  • Validate sequence positions

  • Verify sample files exist

  • Generate proper XML structure for round robin playback

Error Handling:

  • Checks if sample files exist at specified paths

  • Validates sequence positions are unique and sequential

  • Ensures mode is one of: round_robin, random, true_random, always

  • Returns specific error messages for missing files or invalid sequences

Success Response: Returns XML structure with:

  • Configured playback mode

  • Sample sequence assignments

  • Proper group organization for round robin playback

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
directoryYesAbsolute path to the directory containing samples
modeYesRound robin playback mode
lengthYesNumber of round robin variations
samplesYes

Implementation Reference

  • Core implementation of the configure_round_robin tool. Validates round-robin mode, sequence positions, checks sample file existence in the directory, and constructs an AdvancedDrumKitConfig object used for generating the XML groups structure.
    export function configureRoundRobin(directory: string, config: RoundRobinConfig): AdvancedDrumKitConfig {
      // If mode is not 'always', ensure seqPosition is provided at some level
      if (config.mode !== 'always') {
        for (const group of config.groups) {
          const hasGroupSeqPos = group.settings?.seqPosition !== undefined;
          
          for (const sample of group.samples) {
            if (!hasGroupSeqPos && !sample.seqPosition && !sample.settings?.seqPosition) {
              throw new Error(
                `Sample ${sample.path} needs a seqPosition when mode is ${config.mode}. ` +
                'Provide it at sample, group, or global level.'
              );
            }
          }
        }
      }
    
      // If length is provided, validate sequence positions
      if (config.length !== undefined) {
        for (const group of config.groups) {
          for (const sample of group.samples) {
            const seqPos = sample.seqPosition || 
                          sample.settings?.seqPosition || 
                          group.settings?.seqPosition;
            
            if (seqPos !== undefined && (seqPos < 1 || seqPos > config.length)) {
              throw new Error(
                `Invalid sequence position ${seqPos} for sample ${sample.path}. ` +
                `Must be between 1 and ${config.length}`
              );
            }
          }
        }
      }
    
      // Verify all files exist
      for (const group of config.groups) {
        for (const sample of group.samples) {
          const fullPath = path.join(directory, sample.path);
          if (!fs.existsSync(fullPath)) {
            throw new Error(`Sample file not found: ${sample.path}`);
          }
        }
      }
    
      // Create the drum kit configuration
      return {
        globalSettings: {
          roundRobin: {
            mode: config.mode,
            ...(config.length !== undefined && { length: config.length })
          }
        },
        drumPieces: config.groups.map(group => ({
          name: group.name,
          rootNote: group.rootNote || 60,
          ...(group.settings && {
            seqMode: group.settings.mode,
            ...(group.settings.length !== undefined && { seqLength: group.settings.length }),
            ...(group.settings.seqPosition !== undefined && { seqPosition: group.settings.seqPosition })
          }),
          samples: group.samples.map(sample => ({
            path: sample.path,
            ...(sample.seqPosition !== undefined && { seqPosition: sample.seqPosition }),
            ...(sample.settings && {
              seqMode: sample.settings.mode,
              ...(sample.settings.length !== undefined && { seqLength: sample.settings.length }),
              ...(sample.settings.seqPosition !== undefined && { seqPosition: sample.settings.seqPosition })
            })
          }))
        }))
      };
    }
  • src/index.ts:190-246 (registration)
    Registration of the configure_round_robin tool in the MCP server, including detailed description and input schema for validation.
          {
            name: "configure_round_robin",
            description: `Configure round robin sample playback for a set of samples.
    
    This tool will:
    - Validate sequence positions
    - Verify sample files exist
    - Generate proper XML structure for round robin playback
    
    Error Handling:
    - Checks if sample files exist at specified paths
    - Validates sequence positions are unique and sequential
    - Ensures mode is one of: round_robin, random, true_random, always
    - Returns specific error messages for missing files or invalid sequences
    
    Success Response:
    Returns XML structure with:
    - Configured playback mode
    - Sample sequence assignments
    - Proper group organization for round robin playback`,
            inputSchema: {
              type: "object",
              properties: {
                directory: {
                  type: "string",
                  description: "Absolute path to the directory containing samples"
                },
                mode: {
                  type: "string",
                  enum: ["round_robin", "random", "true_random", "always"],
                  description: "Round robin playback mode"
                },
                length: {
                  type: "number",
                  description: "Number of round robin variations"
                },
                samples: {
                  type: "array",
                  items: {
                    type: "object",
                    properties: {
                      path: {
                        type: "string",
                        description: "Path to sample file (relative to directory)"
                      },
                      seqPosition: {
                        type: "number",
                        description: "Position in the round robin sequence (1 to length)"
                      }
                    },
                    required: ["path", "seqPosition"]
                  }
                }
              },
              required: ["directory", "mode", "length", "samples"]
            }
          },
  • MCP server request handler for the configure_round_robin tool call. Performs initial argument validation, invokes the configureRoundRobin function, generates XML, and handles errors.
    case "configure_round_robin": {
      const args = request.params.arguments;
      if (!args || typeof args !== 'object' || 
          typeof args.directory !== 'string' ||
          typeof args.mode !== 'string' ||
          typeof args.length !== 'number' ||
          !Array.isArray(args.samples)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Invalid arguments: expected object with directory, mode, length, and samples"
        );
      }
    
      if (!['round_robin', 'random', 'true_random', 'always'].includes(args.mode)) {
        throw new McpError(
          ErrorCode.InvalidParams,
          "Invalid mode: must be one of 'round_robin', 'random', 'true_random', 'always'"
        );
      }
    
      try {
        const config = configureRoundRobin(args.directory, {
          mode: args.mode as "round_robin" | "random" | "true_random" | "always",
          length: args.length,
          groups: [{
            name: "Samples",
            samples: args.samples.map(s => ({
              path: String(s.path),
              seqPosition: Number(s.seqPosition)
            }))
          }]
        });
        const xml = generateGroupsXml(config);
        return {
          content: [{
            type: "text",
            text: xml
          }]
        };
      } catch (error: unknown) {
        if (error instanceof McpError) throw error;
        const message = error instanceof Error ? error.message : String(error);
        throw new McpError(
          ErrorCode.InternalError,
          `Failed to configure round robin: ${message}`
        );
      }
    }
  • JSON schema defining the input parameters for the configure_round_robin tool, including directory, mode, length, and samples array.
    inputSchema: {
      type: "object",
      properties: {
        directory: {
          type: "string",
          description: "Absolute path to the directory containing samples"
        },
        mode: {
          type: "string",
          enum: ["round_robin", "random", "true_random", "always"],
          description: "Round robin playback mode"
        },
        length: {
          type: "number",
          description: "Number of round robin variations"
        },
        samples: {
          type: "array",
          items: {
            type: "object",
            properties: {
              path: {
                type: "string",
                description: "Path to sample file (relative to directory)"
              },
              seqPosition: {
                type: "number",
                description: "Position in the round robin sequence (1 to length)"
              }
            },
            required: ["path", "seqPosition"]
          }
        }
      },
      required: ["directory", "mode", "length", "samples"]
Behavior4/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. It effectively describes what the tool does: validation steps (checking file existence, sequence positions), error handling specifics, and success response content. However, it doesn't mention potential side effects, performance characteristics, or authentication requirements, leaving some behavioral aspects uncovered.

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 well-structured and appropriately sized. It uses clear sections (Error Handling, Success Response) with bullet points for readability. Every sentence adds value: the opening statement defines purpose, bullet points explain validation steps, and response details clarify outcomes. No redundant information is present.

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

Completeness4/5

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

Given the tool's complexity (4 parameters, validation logic, no output schema), the description provides substantial context. It covers what the tool does, validation rules, error cases, and success response format. However, without annotations or output schema, it could benefit from more detail on side effects or performance considerations, though it's largely complete for practical use.

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 description adds meaningful context beyond the input schema. While the schema has 75% description coverage, the tool description clarifies parameter relationships: directory is the base for sample paths, mode must be one of four specific values, length defines sequence bounds, and samples require path and seqPosition. It explains that seqPosition must be unique and sequential (1 to length), which isn't fully captured in the schema descriptions.

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

Purpose5/5

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

The description clearly states the tool's purpose: 'Configure round robin sample playback for a set of samples.' It specifies the exact action (configure), resource (round robin sample playback), and scope (set of samples). This distinguishes it from sibling tools like analyze_wav_samples or generate_drum_groups, which have different functions.

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. It doesn't mention sibling tools or explain scenarios where configure_round_robin is appropriate compared to other configuration tools like configure_drum_controls or configure_mic_routing. Usage context is implied but not explicitly stated.

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/dandeliongold/mcp-decent-sampler-drums'

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