Skip to main content
Glama

extend_audio

Generate AI-powered audio continuations to extend music tracks or sound files by specifying duration, enabling longer compositions from existing audio.

Instructions

Extend an audio track using AI to generate continuation

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
audio_urlYesURL of the audio file to extend
extension_durationNoDuration to extend in seconds
webhook_urlNoURL for callback upon completion

Implementation Reference

  • The handler function that implements the core logic for the 'extend_audio' tool. It validates input, makes a POST request to the '/extend' API endpoint with the audio URL and optional extension duration/webhook, and returns a status message with task details.
    private async handleExtendAudio(args: any) {
      if (!args.audio_url) {
        throw new McpError(ErrorCode.InvalidParams, "audio_url is required");
      }
    
      const response = await this.axiosInstance.post("/extend", {
        audio_url: args.audio_url,
        extension_duration: args.extension_duration,
        webhook_url: args.webhook_url,
      });
    
      return {
        content: [
          {
            type: "text",
            text: `Audio extension started!\n\n${JSON.stringify(response.data, null, 2)}\n\nUse get_conversion_by_id with the task_id to check the status.`,
          },
        ],
      };
    }
  • The tool schema definition including name, description, and input schema for 'extend_audio', used for tool listing and validation.
    {
      name: "extend_audio",
      description: "Extend an audio track using AI to generate continuation",
      inputSchema: {
        type: "object" as const,
        properties: {
          audio_url: {
            type: "string",
            description: "URL of the audio file to extend",
          },
          extension_duration: {
            type: "number",
            description: "Duration to extend in seconds",
          },
          webhook_url: {
            type: "string",
            description: "URL for callback upon completion",
          },
        },
        required: ["audio_url"],
      },
    },
  • src/index.ts:705-706 (registration)
    The dispatch case in the CallToolRequestSchema handler that routes 'extend_audio' tool calls to the handleExtendAudio method.
    case "extend_audio":
      return await this.handleExtendAudio(args);
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 mentions AI generation and webhook callback, but doesn't disclose critical behavioral traits: whether this is a synchronous or asynchronous operation, what permissions or authentication might be needed, potential rate limits, quality of the AI continuation, or what happens if extension_duration isn't specified. The webhook_url parameter suggests asynchronous behavior, but this isn't explicitly stated.

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

Conciseness4/5

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

The description is a single, efficient sentence that gets straight to the point without unnecessary words. It's appropriately sized for a tool with clear parameters in the schema. However, it could be slightly more structured by explicitly mentioning the asynchronous nature implied by the webhook_url parameter.

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 an AI-powered audio extension tool with 3 parameters and no output schema or annotations, the description is insufficient. It doesn't explain what the tool returns (e.g., a new audio URL, processing status), doesn't clarify the asynchronous workflow, and provides no context about the AI model's capabilities or limitations. The combination of no annotations and no output schema creates significant gaps that the description doesn't address.

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%, so the schema already documents all three parameters thoroughly. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain expected audio formats, valid duration ranges, or webhook payload structure. With complete schema coverage, baseline 3 is appropriate even without extra param info in the description.

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 action ('extend') and resource ('audio track') using AI for continuation. It distinguishes from siblings like 'cut_audio' or 'change_audio_speed' by focusing on generation-based extension rather than editing or transformation. However, it doesn't explicitly differentiate from 'generate_music' or 'generate_sound_effect' which might also create audio content.

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?

No guidance is provided on when to use this tool versus alternatives. For example, it doesn't specify if this is for seamless continuation of existing audio versus creating new content from scratch, or when to choose this over 'generate_music' for similar tasks. The description only states what it does, not when it's appropriate.

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/pasie15/mcp-server-musicgpt'

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