kobold_tts
Convert text to speech audio using customizable voice and speed settings, integrated with Kobold MCP Server for enhanced AI-driven applications.
Instructions
Generate text-to-speech audio
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| apiUrl | No | http://localhost:5001 | |
| speed | No | ||
| text | Yes | ||
| voice | No |
Implementation Reference
- src/index.ts:346-357 (handler)Shared handler logic that executes kobold_tts by validating input against TTSSchema, then proxying a POST request to the KoboldAI TTS endpoint (/api/extra/tts) and returning the response.if (postEndpoints[name]) { const { endpoint, schema } = postEndpoints[name]; const parsed = schema.safeParse(args); if (!parsed.success) { throw new Error(`Invalid arguments: ${parsed.error}`); } const result = await makeRequest(`${apiUrl}${endpoint}`, 'POST', requestData); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], isError: false, };
- src/index.ts:63-67 (schema)Zod schema defining the input parameters for the kobold_tts tool: required 'text', optional 'voice' and 'speed', extending BaseConfigSchema with 'apiUrl'.const TTSSchema = BaseConfigSchema.extend({ text: z.string(), voice: z.string().optional(), speed: z.number().optional(), });
- src/index.ts:218-222 (registration)Registers the kobold_tts tool in the ListTools response, providing name, description, and input schema.{ name: "kobold_tts", description: "Generate text-to-speech audio", inputSchema: zodToJsonSchema(TTSSchema), },
- src/index.ts:337-337 (registration)Maps the kobold_tts tool name to its KoboldAI endpoint (/api/extra/tts) and schema for dispatch in the CallTool handler.kobold_tts: { endpoint: '/api/extra/tts', schema: TTSSchema },
- src/index.ts:146-162 (helper)Utility function used by the handler to perform HTTP requests to the KoboldAI backend API.async function makeRequest(url: string, method = 'GET', body: Record<string, unknown> | null = null) { const options: RequestInit = { method, headers: body ? { 'Content-Type': 'application/json' } : undefined, }; if (body && method !== 'GET') { options.body = JSON.stringify(body); } const response = await fetch(url, options); if (!response.ok) { throw new Error(`KoboldAI API error: ${response.statusText}`); } return response.json(); }