Skip to main content
Glama

kobold_tts

Convert text to speech audio using KoboldAI's TTS capabilities for applications requiring voice output.

Instructions

Generate text-to-speech audio

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
apiUrlNohttp://localhost:5001
textYes
voiceNo
speedNo

Implementation Reference

  • Zod input schema definition for the kobold_tts tool, extending BaseConfigSchema with text, optional voice, and speed parameters.
    const TTSSchema = BaseConfigSchema.extend({ text: z.string(), voice: z.string().optional(), speed: z.number().optional(), });
  • src/index.ts:218-222 (registration)
    Registration of the kobold_tts tool in the ListTools response, specifying name, description, and input schema.
    { name: "kobold_tts", description: "Generate text-to-speech audio", inputSchema: zodToJsonSchema(TTSSchema), },
  • src/index.ts:337-337 (registration)
    Internal mapping/registration of the kobold_tts tool to the KoboldAI endpoint '/api/extra/tts' and its schema within the POST endpoints dispatch table.
    kobold_tts: { endpoint: '/api/extra/tts', schema: TTSSchema },
  • Handler execution logic for kobold_tts (generic for POST tools): looks up endpoint and schema, validates input, proxies the POST request to the KoboldAI TTS endpoint via makeRequest, and returns the JSON 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, };
  • Helper function used by the handler to make 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(); }

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/PhialsBasement/KoboldCPP-MCP-Server'

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