create_note
Generate single or multiple notes with specified types, titles, content, and metadata. Organize notes in markdown format for efficient AI collaboration, using a structured vault system for storage and retrieval.
Instructions
Create one or more notes of the specified type(s)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content | No | Content of the note in markdown format - only used for single note creation | |
| metadata | No | Additional metadata fields for the note (validated against note type schema) - only used for single note creation | |
| notes | No | Array of notes to create - used for batch creation | |
| title | No | Title of the note - only used for single note creation | |
| type | No | Note type (must exist) - only used for single note creation | |
| vault_id | No | Optional vault ID to operate on. If not provided, uses the current active vault. |
Implementation Reference
- src/server/note-handlers.ts:46-108 (handler)Main handler function for the 'create_note' MCP tool. Validates input, resolves vault context, handles both single note and batch creation using noteManager, retrieves agent instructions, and returns formatted JSON response.handleCreateNote = async (args: CreateNoteArgs) => { // Validate arguments validateToolArgs('create_note', args); const { noteManager, noteTypeManager } = await this.resolveVaultContext( args.vault_id ); // Handle batch creation if notes array is provided if (args.notes) { const result = await noteManager.batchCreateNotes(args.notes); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2) } ] }; } // Handle single note creation if (!args.type || !args.title || !args.content) { throw new Error('Single note creation requires type, title, and content'); } const noteInfo = await noteManager.createNote( args.type, args.title, args.content, args.metadata || {} ); // Get agent instructions for this note type let agentInstructions: string[] = []; let nextSuggestions = ''; try { const typeInfo = await noteTypeManager.getNoteTypeDescription(args.type); agentInstructions = typeInfo.parsed.agentInstructions; if (agentInstructions.length > 0) { nextSuggestions = `Consider following these guidelines for ${args.type} notes: ${agentInstructions.join(', ')}`; } } catch { // Ignore errors getting type info, continue without instructions } return { content: [ { type: 'text', text: JSON.stringify( { ...noteInfo, agent_instructions: agentInstructions, next_suggestions: nextSuggestions }, null, 2 ) } ] }; };
- src/server/tool-schemas.ts:85-149 (schema)MCP input schema definition for the create_note tool, supporting both single note and batch creation modes with validation rules.name: 'create_note', description: 'Create one or more notes of the specified type(s)', inputSchema: { type: 'object', properties: { type: { type: 'string', description: 'Type of note to create' }, title: { type: 'string', description: 'Title of the note' }, content: { type: 'string', description: 'Content of the note in markdown format', default: '' }, metadata: { type: 'object', description: 'Additional metadata for the note' }, vault_id: { type: 'string', description: 'Optional vault ID to create the note in. If not provided, uses the current active vault.' }, notes: { type: 'array', items: { type: 'object', properties: { type: { type: 'string', description: 'Type of note to create' }, title: { type: 'string', description: 'Title of the note' }, content: { type: 'string', description: 'Content of the note in markdown format', default: '' }, metadata: { type: 'object', description: 'Additional metadata for the note' } }, required: ['type', 'title'] }, description: 'Array of notes to create in batch (alternative to single note creation)' } }, oneOf: [ { required: ['type', 'title'] }, { required: ['notes'] } ] }
- src/server.ts:1237-1239 (registration)Registration/dispatch of the create_note tool in the MCP CallToolRequestSchema handler switch statement, mapping to NoteHandlers.handleCreateNote.return await this.noteHandlers.handleCreateNote( args as unknown as CreateNoteArgs );
- src/server/types.ts:24-36 (schema)TypeScript interface definition for CreateNoteArgs used by the create_note handler.export interface CreateNoteArgs { type?: string; title?: string; content?: string; metadata?: Record<string, unknown>; notes?: Array<{ type: string; title: string; content: string; metadata?: Record<string, unknown>; }>; vault_id?: string; }