retell_list_chat_agents
View all available chat agents in your Retell AI account to manage conversation flows and agent configurations.
Instructions
List all chat agents in your account.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "retell_list_chat_agents"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1191-1192 (handler)Handler for retell_list_chat_agents tool: makes a GET request to Retell's /list-chat-agents API endpoint using the retellRequest helper.
case "retell_list_chat_agents": return retellRequest("/list-chat-agents", "GET"); - src/index.ts:656-663 (schema)Tool schema definition including name, description, and empty input schema (no parameters required).
{ name: "retell_list_chat_agents", description: "List all chat agents in your account.", inputSchema: { type: "object", properties: {} } }, - src/index.ts:1283-1285 (registration)Registers the handler for listing all tools, including retell_list_chat_agents via the tools array.
server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; }); - src/index.ts:1287-1313 (registration)Registers the general tool execution handler that dispatches to executeTool based on tool name.
// Register tool execution handler server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; try { const result = await executeTool(name, args as Record<string, unknown>); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; } catch (error) { const errorMessage = error instanceof Error ? error.message : String(error); return { content: [ { type: "text", text: `Error: ${errorMessage}`, }, ], isError: true, }; } }); - src/index.ts:23-57 (helper)Generic helper function for making authenticated API requests to Retell AI, used by all tool handlers.
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(); }