kb_initialize
Initialize or check knowledge base status to determine if onboarding is needed and retrieve current profile summary for persistent AI memory.
Instructions
Initialize or check knowledge base status. Returns current profile summary and whether onboarding is needed.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| profileId | No | Profile ID to use (default: "default") | default |
Implementation Reference
- src/index.ts:36-48 (schema)Schema definition for the kb_initialize tool, including name, description, and input schema.name: 'kb_initialize', description: 'Initialize or check knowledge base status. Returns current profile summary and whether onboarding is needed.', inputSchema: { type: 'object', properties: { profileId: { type: 'string', description: 'Profile ID to use (default: "default")', default: 'default' } } } },
- src/index.ts:440-465 (handler)Handler implementation for kb_initialize tool. Checks if the knowledge base is new using KnowledgeManager and returns initialization status with profile summary.case 'kb_initialize': { const isNew = km.isNew(); const kb = km.getKnowledgeBase(); return { content: [ { type: 'text', text: JSON.stringify({ status: 'initialized', isNew, needsOnboarding: isNew, profile: { id: kb.id, createdAt: kb.createdAt, lastUpdated: kb.lastUpdated, hasPersonal: Object.keys(kb.personal).length > 0, hasProfessional: Object.keys(kb.professional).length > 0, hasPreferences: Object.keys(kb.preferences).length > 0, hasProjects: Object.keys(kb.projects).length > 0, customCategories: [...new Set(kb.custom.map(c => c.category))] } }, null, 2) } ] }; }
- src/index.ts:423-425 (registration)Registration of all tool schemas via the ListToolsRequestSchema handler, which returns the tools array containing kb_initialize schema.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });