create_note_type
Define custom note types with structured metadata schemas and agent instructions for organized AI-assisted note-taking in Flint Note.
Instructions
Create a new note type with description, agent instructions, and metadata schema
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type_name | Yes | Name of the note type (filesystem-safe) | |
| description | Yes | Description of the note type purpose and usage | |
| agent_instructions | No | Optional custom agent instructions for this note type | |
| metadata_schema | No | Optional metadata schema definition for this note type | |
| vault_id | No | Optional vault ID to operate on. If not provided, uses the current active vault. |
Implementation Reference
- src/server/note-type-handlers.ts:43-71 (handler)The primary handler function for the 'create_note_type' MCP tool. Validates input arguments using validateToolArgs('create_note_type', args) and delegates to noteTypeManager.createNoteType to perform the actual creation.handleCreateNoteType = async (args: CreateNoteTypeArgs) => { // Validate arguments validateToolArgs('create_note_type', args); const { noteTypeManager } = await this.resolveVaultContext(args.vault_id); await noteTypeManager.createNoteType( args.type_name, args.description, args.agent_instructions, args.metadata_schema ); return { content: [ { type: 'text', text: JSON.stringify( { success: true, message: `Created note type '${args.type_name}' successfully`, type_name: args.type_name }, null, 2 ) } ] }; };
- src/server.ts:1232-1235 (registration)Registration of the tool handler in the MCP server's CallToolRequestSchema request handler switch statement.case 'create_note_type': return await this.noteTypeHandlers.handleCreateNoteType( args as unknown as CreateNoteTypeArgs );
- src/server/tool-schemas.ts:10-82 (schema)MCP tool schema definition including inputSchema, properties, and required fields for create_note_type.name: 'create_note_type', description: 'Create a new note type with description, agent instructions, and metadata schema', inputSchema: { type: 'object', properties: { type_name: { type: 'string', description: 'Name of the note type (filesystem-safe)' }, description: { type: 'string', description: 'Description of the note type purpose and usage' }, agent_instructions: { type: 'array', items: { type: 'string' }, description: 'Optional custom agent instructions for this note type' }, metadata_schema: { type: 'object', properties: { fields: { type: 'array', items: { type: 'object', properties: { name: { type: 'string', description: 'Name of the metadata field' }, type: { type: 'string', enum: ['string', 'number', 'boolean', 'date', 'array', 'select'], description: 'Type of the metadata field' }, description: { type: 'string', description: 'Optional description of the field' }, required: { type: 'boolean', description: 'Whether this field is required' }, constraints: { type: 'object', description: 'Optional field constraints (min, max, options, etc.)' }, default: { description: 'Optional default value for the field' } }, required: ['name', 'type'] } }, version: { type: 'string', description: 'Optional schema version' } }, required: ['fields'], description: 'Optional metadata schema definition for this note type' }, vault_id: { type: 'string', description: 'Optional vault ID to operate on. If not provided, uses the current active vault.' } }, required: ['type_name', 'description'] }
- src/server.ts:314-396 (registration)Tool metadata and schema registration in the ListToolsRequestSchema handler, which is served to MCP clients.{ name: 'create_note_type', description: 'Create a new note type with description, agent instructions, and metadata schema', inputSchema: { type: 'object', properties: { type_name: { type: 'string', description: 'Name of the note type (filesystem-safe)' }, description: { type: 'string', description: 'Description of the note type purpose and usage' }, agent_instructions: { type: 'array', items: { type: 'string' }, description: 'Optional custom agent instructions for this note type' }, metadata_schema: { type: 'object', properties: { fields: { type: 'array', items: { type: 'object', properties: { name: { type: 'string', description: 'Name of the metadata field' }, type: { type: 'string', enum: [ 'string', 'number', 'boolean', 'date', 'array', 'select' ], description: 'Type of the metadata field' }, description: { type: 'string', description: 'Optional description of the field' }, required: { type: 'boolean', description: 'Whether this field is required' }, constraints: { type: 'object', description: 'Optional field constraints (min, max, options, etc.)' }, default: { description: 'Optional default value for the field' } }, required: ['name', 'type'] } }, version: { type: 'string', description: 'Optional schema version' } }, required: ['fields'], description: 'Optional metadata schema definition for this note type' }, vault_id: { type: 'string', description: 'Optional vault ID to operate on. If not provided, uses the current active vault.' } }, required: ['type_name', 'description'] } },
- src/server/types.ts:16-22 (helper)TypeScript interface defining the expected arguments for the create_note_type tool.export interface CreateNoteTypeArgs { type_name: string; description: string; agent_instructions?: string[]; metadata_schema?: MetadataSchema; vault_id?: string; }