create_note_type
Define and configure a new note type with custom description, agent instructions, and optional metadata schema for structured data organization in Flint Note.
Instructions
Create a new note type with description, agent instructions, and metadata schema
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| agent_instructions | No | Optional custom agent instructions for this note type | |
| description | Yes | Description of the note type purpose and usage | |
| metadata_schema | No | Optional metadata schema definition for this note type | |
| type_name | Yes | Name of the note type (filesystem-safe) | |
| vault_id | No | Optional vault ID to operate on. If not provided, uses the current active vault. |
Input Schema (JSON Schema)
{
"properties": {
"agent_instructions": {
"description": "Optional custom agent instructions for this note type",
"items": {
"type": "string"
},
"type": "array"
},
"description": {
"description": "Description of the note type purpose and usage",
"type": "string"
},
"metadata_schema": {
"description": "Optional metadata schema definition for this note type",
"properties": {
"fields": {
"items": {
"properties": {
"constraints": {
"description": "Optional field constraints (min, max, options, etc.)",
"type": "object"
},
"default": {
"description": "Optional default value for the field"
},
"description": {
"description": "Optional description of the field",
"type": "string"
},
"name": {
"description": "Name of the metadata field",
"type": "string"
},
"required": {
"description": "Whether this field is required",
"type": "boolean"
},
"type": {
"description": "Type of the metadata field",
"enum": [
"string",
"number",
"boolean",
"date",
"array",
"select"
],
"type": "string"
}
},
"required": [
"name",
"type"
],
"type": "object"
},
"type": "array"
},
"version": {
"description": "Optional schema version",
"type": "string"
}
},
"required": [
"fields"
],
"type": "object"
},
"type_name": {
"description": "Name of the note type (filesystem-safe)",
"type": "string"
},
"vault_id": {
"description": "Optional vault ID to operate on. If not provided, uses the current active vault.",
"type": "string"
}
},
"required": [
"type_name",
"description"
],
"type": "object"
}
Implementation Reference
- src/server/note-type-handlers.ts:43-71 (handler)MCP tool handler that validates input, resolves vault context, calls noteTypeManager.createNoteType, and returns success responsehandleCreateNoteType = 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 in CallToolRequestSchema handler: routes 'create_note_type' tool calls to the handler methodcase 'create_note_type': return await this.noteTypeHandlers.handleCreateNoteType( args as unknown as CreateNoteTypeArgs );
- src/server/tool-schemas.ts:10-83 (schema)Input schema definition for the create_note_type tool (matches the inline schema in server.ts ListTools response)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/validation.ts:245-283 (helper)Validation rules for create_note_type tool args used by validateToolArgs('create_note_type', args) in the handlercreate_note_type: [ { field: 'type_name', required: true, type: 'string', allowEmpty: false, customValidator: (value: any) => { // Check for filesystem-safe characters if (!/^[a-zA-Z0-9_-]+$/.test(value)) { return 'Invalid note type name'; } return null; } }, { field: 'description', required: true, type: 'string', allowEmpty: false }, { field: 'agent_instructions', required: false, type: 'array', arrayItemType: 'string', allowEmpty: true }, { field: 'metadata_schema', required: false, type: 'object' }, { field: 'vault_id', required: false, type: 'string', allowEmpty: false } ],
- src/server.ts:314-396 (registration)Tool definition in ListToolsRequestSchema response, including name, description, and inputSchema (duplicated from tool-schemas.ts){ 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'] } },