Skip to main content
Glama
williamzujkowski

Strudel MCP Server

transpose

Transpose musical notes by a specified number of semitones to adjust pitch in music patterns for Strudel.cc live coding.

Instructions

Transpose notes by semitones

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
semitonesYesSemitones to transpose

Implementation Reference

  • The main handler for the 'transpose' tool within the executeTool switch statement. Validates input, retrieves the current pattern, transposes it using the transposePattern helper, writes the result back, and returns a confirmation message.
    case 'transpose':
      // Semitones can be positive or negative, just validate it's a number
      if (typeof args.semitones !== 'number' || !Number.isInteger(args.semitones)) {
        throw new Error('Semitones must be an integer');
      }
      const toTranspose = await this.getCurrentPatternSafe();
      const transposed = this.transposePattern(toTranspose, args.semitones);
      await this.writePatternSafe(transposed);
      return `Transposed ${args.semitones} semitones`;
  • Registration of the 'transpose' tool in the getTools() method, including name, description, and input schema definition.
    {
      name: 'transpose',
      description: 'Transpose notes by semitones',
      inputSchema: {
        type: 'object',
        properties: {
          semitones: { type: 'number', description: 'Semitones to transpose' }
        },
        required: ['semitones']
      }
    },
  • The core helper function that implements the transposition logic by parsing note names and octaves in the pattern string using regex and shifting them by the specified semitones, handling octave wrapping.
    private transposePattern(pattern: string, semitones: number): string {
      // Simple transpose implementation - would need more sophisticated parsing
      return pattern.replace(/([a-g][#b]?)(\d)/gi, (match, note, octave) => {
        const noteMap: Record<string, number> = {
          'c': 0, 'c#': 1, 'd': 2, 'd#': 3, 'e': 4, 'f': 5,
          'f#': 6, 'g': 7, 'g#': 8, 'a': 9, 'a#': 10, 'b': 11
        };
    
        const currentNote = note.toLowerCase();
        const noteValue = noteMap[currentNote] || 0;
        const newNoteValue = (noteValue + semitones + 12) % 12;
        const noteNames = ['c', 'c#', 'd', 'd#', 'e', 'f', 'f#', 'g', 'g#', 'a', 'a#', 'b'];
        const newOctave = parseInt(octave) + Math.floor((noteValue + semitones) / 12);
    
        return noteNames[newNoteValue] + newOctave;
      });
    }
Behavior2/5

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

No annotations are provided, so the description carries full burden. 'Transpose' implies a mutation operation (changing pitch), but the description doesn't disclose whether this affects original data, requires specific permissions, has side effects, or what the output looks like. It lacks behavioral details beyond the basic action.

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 with zero waste. It's front-loaded with the core action and parameter, making it easy to parse quickly without unnecessary elaboration.

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 no annotations, no output schema, and a mutation tool (implied by 'transpose'), the description is incomplete. It doesn't explain what 'notes' are, how the transposition is applied, what the result looks like, or any error conditions, leaving significant gaps for an AI agent to understand the tool's behavior.

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%, with one parameter 'semitones' fully documented in the schema. The description adds no additional meaning beyond what's in the schema (e.g., no examples, range constraints, or musical context like positive/negative for up/down transposition), so it meets the baseline for high coverage.

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 'Transpose notes by semitones' clearly states the action (transpose) and target (notes), but it's vague about what 'notes' refers to (musical notes in a pattern? specific note objects?) and doesn't distinguish from sibling tools like 'apply_scale' or 'generate_scale' that also manipulate musical pitch. It's not tautological but lacks specificity.

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. With siblings like 'apply_scale' and 'generate_scale' that might handle pitch adjustments differently, there's no indication of context, prerequisites, or exclusions for using 'transpose'.

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