UNPKG

@chinchillaenterprises/mcp-ai-assistant

Version:

MCP server for AI assistant with ElevenLabs text-to-speech integration

56 lines 2.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getVoiceTool = void 0; const zod_1 = require("zod"); const account_state_js_1 = require("../../services/account-state.js"); const elevenlabs_client_js_1 = require("../../services/elevenlabs-client.js"); const inputSchema = zod_1.z.object({ voiceId: zod_1.z.string().describe('The ID of the voice to retrieve') }); exports.getVoiceTool = { name: 'elevenlabs_get_voice', description: 'Get detailed information about a specific voice', inputSchema, handler: async (args) => { const accountState = new account_state_js_1.AccountState(); const client = new elevenlabs_client_js_1.ElevenLabsClient(accountState); try { const voice = await client.getVoice(args.voiceId); return { content: [{ type: 'text', text: JSON.stringify({ success: true, voice: { voice_id: voice.voice_id, name: voice.name, category: voice.category, description: voice.description, labels: voice.labels, preview_url: voice.preview_url, is_public: voice.is_public, is_owner: voice.is_owner, settings: voice.settings, samples: voice.samples, high_quality_base_model_ids: voice.high_quality_base_model_ids, safety_control: voice.safety_control, voice_verification: voice.voice_verification } }, null, 2) }] }; } catch (error) { return { content: [{ type: 'text', text: JSON.stringify({ success: false, error: error instanceof Error ? error.message : 'Unknown error occurred' }, null, 2) }] }; } } }; //# sourceMappingURL=get-voice.js.map