retell_list_agents
Retrieve all configured voice agents from your Retell AI account to manage and deploy AI phone agents.
Instructions
List all voice agents in your Retell account.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1173-1174 (handler)Handler implementation for the 'retell_list_agents' tool. Executes a GET request to the Retell API endpoint '/list-agents' using the shared retellRequest helper.
case "retell_list_agents": return retellRequest("/list-agents", "GET"); - src/index.ts:518-525 (registration)Tool registration entry in the tools array, including name, description, and empty input schema (no parameters required). This is returned by the ListTools handler.
{ name: "retell_list_agents", description: "List all voice agents in your Retell account.", inputSchema: { type: "object", properties: {} } }, - src/index.ts:521-524 (schema)Input schema for retell_list_agents tool, defining an empty object (no required arguments).
inputSchema: { type: "object", properties: {} } - src/index.ts:23-57 (helper)Shared helper function used by all Retell tools, including retell_list_agents, to make authenticated HTTP requests to the Retell API.
async function retellRequest( endpoint: string, method: string = "GET", body?: Record<string, unknown> ): Promise<unknown> { const apiKey = getApiKey(); const headers: Record<string, string> = { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json", }; const options: RequestInit = { method, headers, }; if (body && method !== "GET") { options.body = JSON.stringify(body); } const response = await fetch(`${RETELL_API_BASE}${endpoint}`, options); if (!response.ok) { const errorText = await response.text(); throw new Error(`Retell API error (${response.status}): ${errorText}`); } // Handle 204 No Content if (response.status === 204) { return { success: true }; } return response.json(); }