Skip to main content
Glama
williamzujkowski

Strudel MCP Server

insert

Add code at a precise line number to modify Strudel music patterns during live coding sessions.

Instructions

Insert code at specific line

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
positionYesLine number
codeYesCode to insert

Implementation Reference

  • The main handler logic for the 'insert' MCP tool. Validates inputs, splits the current pattern into lines, inserts the new code at the specified position using Array.splice, and writes the updated pattern back using writePatternSafe.
    case 'insert':
      InputValidator.validatePositiveInteger(args.position, 'position');
      InputValidator.validateStringLength(args.code, 'code', 10000, true);
      const lines = (await this.getCurrentPatternSafe()).split('\n');
      lines.splice(args.position, 0, args.code);
      return await this.writePatternSafe(lines.join('\n'));
  • Registration of the 'insert' tool in the getTools() method, including name, description, and input schema definition for MCP protocol compliance.
    {
      name: 'insert',
      description: 'Insert code at specific line',
      inputSchema: {
        type: 'object',
        properties: {
          position: { type: 'number', description: 'Line number' },
          code: { type: 'string', description: 'Code to insert' }
        },
        required: ['position', 'code']
      }
  • Input schema definition for the 'insert' tool specifying position (number) and code (string) parameters.
    inputSchema: {
      type: 'object',
      properties: {
        position: { type: 'number', description: 'Line number' },
        code: { type: 'string', description: 'Code to insert' }
      },
      required: ['position', 'code']
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. It states the tool inserts code, implying a mutation, but lacks details on permissions, whether it modifies files in-place, error handling (e.g., invalid line numbers), or side effects. This is inadequate for a mutation tool with zero annotation coverage.

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 and directly conveys the core action without unnecessary elaboration, making it easy to parse quickly.

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?

For a mutation tool with no annotations and no output schema, the description is incomplete. It doesn't explain what happens after insertion (e.g., success response, file changes), error conditions, or how it interacts with other tools in the context. Given the complexity and lack of structured data, more detail is needed.

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 clear parameter descriptions ('Line number' and 'Code to insert'). The description adds no extra meaning beyond the schema, such as format details or constraints (e.g., line number starting index). 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.

Purpose4/5

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

The description clearly states the verb ('Insert') and resource ('code'), specifying the action and target. However, it doesn't differentiate from sibling tools like 'append' or 'replace', which likely handle similar code modification tasks, leaving some ambiguity about when to choose this specific tool.

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 'append' (likely adds to the end) and 'replace' (likely substitutes content), there's no indication of when 'insert' is preferred, such as for adding code at arbitrary positions without overwriting.

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