kb_remove_custom
Delete specific custom knowledge entries by category and key from persistent storage to maintain accurate and current information.
Instructions
Remove custom knowledge
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | Yes | ||
| key | Yes |
Implementation Reference
- src/index.ts:619-632 (handler)Handler for the kb_remove_custom tool. Extracts category and key from arguments, calls KnowledgeManager.removeCustomKnowledge, and returns a success or failure message.case 'kb_remove_custom': { const { category, key } = args as any; const removed = await km.removeCustomKnowledge(category, key); return { content: [ { type: 'text', text: removed ? `✅ Removed custom knowledge: ${category}/${key}` : `❌ Not found: ${category}/${key}` } ] }; }
- src/index.ts:179-190 (registration)Tool registration in the tools array, including name, description, and input schema for listing and validation.{ name: 'kb_remove_custom', description: 'Remove custom knowledge', inputSchema: { type: 'object', properties: { category: { type: 'string' }, key: { type: 'string' } }, required: ['category', 'key'] } },
- src/KnowledgeManager.ts:244-259 (helper)Core helper method in KnowledgeManager that finds and removes the custom knowledge entry by category and key, updates history, persists to file, and returns success boolean.async removeCustomKnowledge(category: string, key: string): Promise<boolean> { const index = this.kb.custom.findIndex(k => k.category === category && k.key === key); if (index >= 0) { const oldValue = this.kb.custom[index].value; this.kb.custom.splice(index, 1); this.addHistory({ action: 'delete', category: `custom:${category}`, field: key, oldValue }); await this.save(); return true; } return false; }