gaudio_create_job
Create audio processing jobs for stem separation or DME track isolation using uploaded files. Configure stem types like vocals or drums for separation models.
Instructions
Create a processing job with an uploaded file. For Stem Separation models (gsep_music_hq_v1, gsep_music_shq_v1, gsep_speech_hq_v1), the 'type' parameter is required (e.g. 'vocal', 'vocal,drum'). For DME models, no type is needed. For Text Sync (gts_lyrics_line_v1), use gaudio_sync_lyrics instead.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uploadId | Yes | Upload ID from gaudio_upload_file (used as audioUploadId) | |
| model | Yes | Model name (e.g. gsep_music_hq_v1, gsep_dme_dtrack_v1) | |
| type | No | Stem type(s), comma-separated. Required for Stem Separation models. e.g. 'vocal', 'vocal,drum,bass' |
Implementation Reference
- src/tools/create-job.ts:6-54 (handler)The main handler function for gaudio_create_job. Registers the tool with MCP server and implements the business logic: validates model exists, checks if 'type' is required for the model, builds params, calls client.createJob(), and returns the jobId with status.
export function registerCreateJob(server: McpServer, client: GaudioClient) { server.tool( "gaudio_create_job", "Create a processing job with an uploaded file. For Stem Separation models (gsep_music_hq_v1, gsep_music_shq_v1, gsep_speech_hq_v1), the 'type' parameter is required (e.g. 'vocal', 'vocal,drum'). For DME models, no type is needed. For Text Sync (gts_lyrics_line_v1), use gaudio_sync_lyrics instead.", { uploadId: z.string().describe("Upload ID from gaudio_upload_file (used as audioUploadId)"), model: z.string().describe("Model name (e.g. gsep_music_hq_v1, gsep_dme_dtrack_v1)"), type: z .string() .optional() .describe("Stem type(s), comma-separated. Required for Stem Separation models. e.g. 'vocal', 'vocal,drum,bass'"), }, async ({ uploadId, model, type }) => { const modelInfo = getModel(model); if (!modelInfo) { return { content: [{ type: "text" as const, text: `Unknown model: ${model}. Use gaudio_list_models to see available models.` }], isError: true, }; } if (modelInfo.typeRequired && !type) { return { content: [ { type: "text" as const, text: `Model ${model} requires a 'type' parameter. Options: ${modelInfo.typeOptions?.join(", ")}`, }, ], isError: true, }; } const params: Record<string, unknown> = { audioUploadId: uploadId }; if (type) params.type = type; const { jobId } = await client.createJob(model, params); return { content: [ { type: "text" as const, text: JSON.stringify({ jobId, model, status: "created" }, null, 2), }, ], }; }, ); } - src/api/client.ts:163-169 (helper)The API client helper method that makes the actual HTTP POST request to create a job. Sends request to /{model}/jobs endpoint with params and returns the jobId from the response.
async createJob( model: string, params: Record<string, unknown>, ): Promise<{ jobId: string }> { const res = await this.request("POST", `/${model}/jobs`, params); return { jobId: res.resultData?.jobId as string }; } - src/index.ts:29-29 (registration)Where the gaudio_create_job tool is registered with the MCP server by calling registerCreateJob with the server and client instances.
registerCreateJob(server, client); - src/index.ts:1-13 (registration)Import statements and setup for tool registration, including the import of registerCreateJob from ./tools/create-job.js on line 8.
#!/usr/bin/env node import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { GaudioClient } from "./api/client.js"; import { registerListModels } from "./tools/list-models.js"; import { registerUploadFile } from "./tools/upload-file.js"; import { registerCreateJob } from "./tools/create-job.js"; import { registerGetJob } from "./tools/get-job.js"; import { registerSeparateAudio } from "./tools/separate-audio.js"; import { registerSyncLyrics } from "./tools/sync-lyrics.js"; import { registerGetKeyInfo } from "./tools/get-key-info.js"; - src/tools/create-job.ts:10-17 (schema)Zod schema definition for gaudio_create_job tool parameters: uploadId (required string), model (required string), and type (optional string for stem types).
{ uploadId: z.string().describe("Upload ID from gaudio_upload_file (used as audioUploadId)"), model: z.string().describe("Model name (e.g. gsep_music_hq_v1, gsep_dme_dtrack_v1)"), type: z .string() .optional() .describe("Stem type(s), comma-separated. Required for Stem Separation models. e.g. 'vocal', 'vocal,drum,bass'"), },