@chinchillaenterprises/mcp-ai-assistant
Version:
MCP server for AI assistant with ElevenLabs text-to-speech integration
55 lines • 2.32 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.listModelsTool = 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({});
exports.listModelsTool = {
name: 'elevenlabs_list_models',
description: 'List all available text-to-speech models',
inputSchema,
handler: async (args) => {
const accountState = new account_state_js_1.AccountState();
const client = new elevenlabs_client_js_1.ElevenLabsClient(accountState);
try {
const models = await client.getModels();
const modelList = models.map(model => ({
model_id: model.model_id,
name: model.name,
description: model.description,
can_be_finetuned: model.can_be_finetuned,
can_do_text_to_speech: model.can_do_text_to_speech,
can_do_voice_conversion: model.can_do_voice_conversion,
can_use_style: model.can_use_style,
can_use_speaker_boost: model.can_use_speaker_boost,
serves_pro_voices: model.serves_pro_voices,
max_characters_request_free_user: model.max_characters_request_free_user,
max_characters_request_subscribed_user: model.max_characters_request_subscribed_user,
languages: model.languages
}));
return {
content: [{
type: 'text',
text: JSON.stringify({
success: true,
count: modelList.length,
models: modelList
}, 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=list-models.js.map