retell_delete_knowledge_base
Remove a knowledge base from the Retell AI platform to manage agent resources and data storage.
Instructions
Delete a knowledge base.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| knowledge_base_id | Yes | The knowledge base ID to delete |
Implementation Reference
- src/index.ts:1235-1236 (handler)Handler that executes the retell_delete_knowledge_base tool by calling the Retell API DELETE endpoint.case "retell_delete_knowledge_base": return retellRequest(`/delete-knowledge-base/${args.knowledge_base_id}`, "DELETE");
- src/index.ts:930-943 (schema)Schema defining the input parameters for the tool.{ name: "retell_delete_knowledge_base", description: "Delete a knowledge base.", inputSchema: { type: "object", properties: { knowledge_base_id: { type: "string", description: "The knowledge base ID to delete" } }, required: ["knowledge_base_id"] } },
- src/index.ts:1283-1285 (registration)MCP server handler registration for listing tools, which includes retell_delete_knowledge_base.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/index.ts:1288-1313 (registration)MCP server handler registration for calling tools, dispatching to executeTool which handles retell_delete_knowledge_base.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)Core helper function for making authenticated API requests to Retell AI, used in the tool handler.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(); }