Skip to main content
Glama

kb_add_custom

Add custom knowledge entries to structured categories for persistent storage and retrieval in the MCP Instruct server's knowledge base.

Instructions

Add custom knowledge to any category

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
categoryYesCategory name (e.g., "tools", "workflows", "contacts")
keyYesKnowledge key/identifier
valueYesKnowledge value (can be string, object, array, etc.)
tagsNoOptional tags for categorization

Implementation Reference

  • src/index.ts:153-178 (registration)
    Registration of the 'kb_add_custom' tool including name, description, and input schema for listing tools.
    { name: 'kb_add_custom', description: 'Add custom knowledge to any category', inputSchema: { type: 'object', properties: { category: { type: 'string', description: 'Category name (e.g., "tools", "workflows", "contacts")' }, key: { type: 'string', description: 'Knowledge key/identifier' }, value: { description: 'Knowledge value (can be string, object, array, etc.)' }, tags: { type: 'array', items: { type: 'string' }, description: 'Optional tags for categorization' } }, required: ['category', 'key', 'value'] } },
  • Tool handler that parses arguments, calls KnowledgeManager.addCustomKnowledge, and returns success message.
    case 'kb_add_custom': { const { category, key, value, tags } = args as any; await km.addCustomKnowledge(category, key, value, tags); return { content: [ { type: 'text', text: `✅ Added custom knowledge: ${category}/${key}` } ] }; }
  • Core helper method in KnowledgeManager that implements adding or updating custom knowledge, manages history, and persists to file.
    async addCustomKnowledge(category: string, key: string, value: any, tags?: string[]): Promise<void> { const existing = this.kb.custom.findIndex(k => k.category === category && k.key === key); const customKnowledge: CustomKnowledge = { category, key, value, metadata: { addedAt: new Date().toISOString(), lastUpdated: new Date().toISOString(), tags } }; if (existing >= 0) { const oldValue = this.kb.custom[existing].value; this.kb.custom[existing] = customKnowledge; this.addHistory({ action: 'update', category: `custom:${category}`, field: key, oldValue, newValue: value }); } else { this.kb.custom.push(customKnowledge); this.addHistory({ action: 'add', category: `custom:${category}`, field: key, newValue: value }); } await this.save(); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/hlsitechio/mcp-instruct'

If you have feedback or need assistance with the MCP directory API, please join our Discord server