retell_list_knowledge_bases
Retrieve all available knowledge bases to manage information sources for AI agents.
Instructions
List all knowledge bases.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1233-1234 (handler)The core handler logic for the tool within the executeTool switch statement. It makes a GET request to the Retell API's /list-knowledge-bases endpoint with no arguments.case "retell_list_knowledge_bases": return retellRequest("/list-knowledge-bases", "GET");
- src/index.ts:922-929 (schema)The tool's schema definition in the tools array, specifying name, description, and empty input schema (no parameters required).{ name: "retell_list_knowledge_bases", description: "List all knowledge bases.", inputSchema: { type: "object", properties: {} } },
- src/index.ts:1283-1285 (registration)MCP server handler registration for listing all tools. This tool is included in the 'tools' constant array returned here.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/index.ts:23-57 (helper)Shared helper function used by all Retell tools to make authenticated API requests to Retell AI endpoints.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(); }