retell_get_knowledge_base
Retrieve configuration details for a knowledge base to access structured information within the Retell AI voice and chat agent platform.
Instructions
Retrieve a knowledge base configuration.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| knowledge_base_id | Yes | The knowledge base ID |
Implementation Reference
- src/index.ts:908-921 (schema)Tool definition including name, description, and input schema requiring 'knowledge_base_id'.{ name: "retell_get_knowledge_base", description: "Retrieve a knowledge base configuration.", inputSchema: { type: "object", properties: { knowledge_base_id: { type: "string", description: "The knowledge base ID" } }, required: ["knowledge_base_id"] } },
- src/index.ts:1231-1232 (handler)Handler logic that calls the generic retellRequest helper to fetch the knowledge base via GET /get-knowledge-base/{knowledge_base_id}.case "retell_get_knowledge_base": return retellRequest(`/get-knowledge-base/${args.knowledge_base_id}`, "GET");
- src/index.ts:1283-1285 (registration)Registers the tool list (including retell_get_knowledge_base) by handling ListToolsRequest and returning the static tools array.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/index.ts:23-57 (helper)Generic API request helper used by all Retell tools, including authentication, error handling, and JSON serialization.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(); }