Skip to main content
Glama

get_conversion_by_id

Retrieve conversion status, audio URL, and metadata using a task ID or conversion ID for audio processing tasks like music generation, voice conversion, or stem separation.

Instructions

Get details of a conversion by its task ID or conversion ID. Returns status, audio URL, and metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
conversionTypeYesType of conversion (must match MusicGPT API conversion types)
task_idNoTask ID associated with the conversion (provide either task_id or conversion_id)
conversion_idNoConversion ID to fetch details (provide either task_id or conversion_id)

Implementation Reference

  • The core handler function that executes the get_conversion_by_id tool. Validates input parameters, makes a GET request to the MusicGPT API /byId endpoint, and returns the response data as formatted JSON text.
    private async handleGetConversionById(args: any) { if (!args.conversionType) { throw new McpError(ErrorCode.InvalidParams, "conversionType is required"); } if (!args.task_id && !args.conversion_id) { throw new McpError(ErrorCode.InvalidParams, "Either task_id or conversion_id is required"); } const params: any = { conversionType: args.conversionType }; if (args.task_id) params.task_id = args.task_id; if (args.conversion_id) params.conversion_id = args.conversion_id; const response = await this.axiosInstance.get("/byId", { params }); return { content: [ { type: "text", text: JSON.stringify(response.data, null, 2), }, ], }; }
  • The tool definition including name, description, and detailed inputSchema with properties for conversionType (enum of all supported types), task_id, and conversion_id. Used for tool listing and input validation.
    { name: "get_conversion_by_id", description: "Get details of a conversion by its task ID or conversion ID. Returns status, audio URL, and metadata.", inputSchema: { type: "object" as const, properties: { conversionType: { type: "string", description: "Type of conversion (must match MusicGPT API conversion types)", enum: [ "MUSIC_AI", "TEXT_TO_SPEECH", "VOICE_CONVERSION", "COVER", "EXTRACTION", "DENOISING", "DEECHO", "DEREVERB", "SOUND_GENERATOR", "AUDIO_TRANSCRIPTION", "AUDIO_SPEED_CHANGER", "AUDIO_MASTERING", "AUDIO_CUTTER", "REMIX", "FILE_CONVERT", "KEY_BPM_EXTRACTION", "AUDIO_TO_MIDI", "EXTEND", "INPAINT", "SING_OVER_INSTRUMENTAL", "LYRICS_GENERATOR", "STEMS_SEPARATION", "VOCAL_EXTRACTION" ], }, task_id: { type: "string", description: "Task ID associated with the conversion (provide either task_id or conversion_id)", }, conversion_id: { type: "string", description: "Conversion ID to fetch details (provide either task_id or conversion_id)", }, }, required: ["conversionType"], }, },
  • src/index.ts:645-649 (registration)
    Registers the list tools handler which returns the TOOLS array containing the get_conversion_by_id tool definition for discovery.
    this.server.setRequestHandler( ListToolsRequestSchema, async () => ({ tools: TOOLS, })
  • src/index.ts:661-662 (registration)
    The switch case in the main CallToolRequestSchema handler that dispatches execution to the specific get_conversion_by_id handler method.
    case "get_conversion_by_id": return await this.handleGetConversionById(args);

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