list_voices
Retrieve available text-to-speech voices with IDs, names, languages, and previews for voice selection in speech synthesis.
Instructions
List all available text-to-speech voices.
Returns voice IDs, names, supported languages, and sample previews.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.py:119-127 (handler)The handler function that implements the list_voices tool. It makes an async HTTP GET request to /v1/tts/voices endpoint and returns the JSON response containing voice IDs, names, supported languages, and sample previews.
async def list_voices() -> dict: """List all available text-to-speech voices. Returns voice IDs, names, supported languages, and sample previews. """ async with _client() as client: response = await client.get("/v1/tts/voices") response.raise_for_status() return response.json() - server.py:118-118 (registration)Decorator that registers the list_voices function as an MCP tool with the FastMCP server.
@mcp.tool() - server.py:42-47 (helper)Helper function that creates and configures an httpx.AsyncClient with the API base URL, authorization headers, and timeout settings. Used by the list_voices handler to make HTTP requests.
def _client() -> httpx.AsyncClient: return httpx.AsyncClient( base_url=API_BASE, headers=_headers, timeout=60.0, )