kb_quick_setup
Configure knowledge base with predefined forms for identity, technical, or organizational data to enable AI memory across sessions.
Instructions
Quick setup using predefined forms for common scenarios
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| formType | Yes | Type of quick setup form | |
| data | Yes | Form data as key-value pairs |
Implementation Reference
- src/index.ts:504-554 (handler)Main handler logic for kb_quick_setup: processes formType and data, uses quickForms to validate/parse fields, applies targeted updates to knowledge base (personal/professional/preferences/custom).
case 'kb_quick_setup': { const { formType, data } = args as any; const form = quickForms[formType]; if (!form) { throw new Error(`Unknown form type: ${formType}`); } const updates: any = {}; for (const [key, value] of Object.entries(data)) { const fieldDef = form.fields[key]; if (fieldDef) { updates[key] = parseFormInput(value as string, fieldDef.type); } } // Apply updates based on form type if (formType === 'identity') { await km.updatePersonal({ name: updates.name, currentLocation: updates.location, languages: updates.languages }); await km.updateProfessional({ occupation: updates.occupation }); } else if (formType === 'technical') { await km.updateProfessional({ role: updates.role, yearsOfExperience: updates.experience, skills: updates.skills }); await km.updatePreferences({ favoriteTools: updates.tools }); } else if (formType === 'organization') { await km.addCustomKnowledge('organization', 'name', updates.orgName); await km.addCustomKnowledge('organization', 'industry', updates.industry); if (updates.size) await km.addCustomKnowledge('organization', 'size', updates.size); if (updates.mission) await km.addCustomKnowledge('organization', 'mission', updates.mission); } return { content: [ { type: 'text', text: `✅ Quick setup completed for ${formType}` } ] }; } - src/index.ts:64-82 (registration)Tool registration in the MCP tools list, defining name, description, and input schema with required formType (enum) and data object.
{ name: 'kb_quick_setup', description: 'Quick setup using predefined forms for common scenarios', inputSchema: { type: 'object', properties: { formType: { type: 'string', enum: ['identity', 'technical', 'organization'], description: 'Type of quick setup form' }, data: { type: 'object', description: 'Form data as key-value pairs' } }, required: ['formType', 'data'] } }, - src/forms.ts:145-173 (schema)Detailed schema definitions for each quick setup formType, defining field types, labels, requirements, and options used for data validation/parsing in the handler.
export const quickForms: Record<string, any> = { identity: { title: "Quick Identity Setup", fields: { name: { type: 'text', label: 'Full Name', required: true }, occupation: { type: 'text', label: 'Job Title', required: true }, location: { type: 'text', label: 'Location', required: false }, languages: { type: 'array', label: 'Languages', required: false } } }, technical: { title: "Technical Profile", fields: { role: { type: 'text', label: 'Role', required: true }, experience: { type: 'number', label: 'Years of Experience', required: true }, skills: { type: 'array', label: 'Skills', required: true }, tools: { type: 'array', label: 'Favorite Tools', required: false } } }, organization: { title: "Organization Setup", fields: { orgName: { type: 'text', label: 'Organization Name', required: true }, industry: { type: 'text', label: 'Industry', required: true }, size: { type: 'select', label: 'Company Size', options: ['1-10', '11-50', '51-200', '200+'], required: false }, mission: { type: 'text', label: 'Mission', required: false } } } }; - src/forms.ts:175-184 (helper)Utility function to parse form input values based on field type (array, number, boolean), used in kb_quick_setup handler to process data.
export function parseFormInput(input: string, type: string): any { if (type === 'array' || type === 'multiselect') { return input.split(',').map(s => s.trim()).filter(s => s.length > 0); } else if (type === 'number') { return parseInt(input, 10); } else if (type === 'boolean') { return input.toLowerCase() === 'true' || input.toLowerCase() === 'yes'; } return input; }