Skip to main content
Glama

get_notes

Retrieve multiple notes by their identifiers using optional vault ID and specific fields. Works with Flint Note's markdown-based vault system for organized note-taking and AI collaboration.

Instructions

Retrieve multiple notes by their identifiers

Input Schema

NameRequiredDescriptionDefault
fieldsNoOptional array of field names to include in response. Supports dot notation for nested fields (e.g. "metadata.tags") and wildcard patterns (e.g. "metadata.*"). If not specified, all fields are returned.
identifiersYesArray of note identifiers in format "type/filename" or full path
vault_idNoOptional vault ID to operate on. If not provided, uses the current active vault.

Input Schema (JSON Schema)

{ "properties": { "fields": { "description": "Optional array of field names to include in response. Supports dot notation for nested fields (e.g. \"metadata.tags\") and wildcard patterns (e.g. \"metadata.*\"). If not specified, all fields are returned.", "items": { "type": "string" }, "type": "array" }, "identifiers": { "description": "Array of note identifiers in format \"type/filename\" or full path", "items": { "type": "string" }, "type": "array" }, "vault_id": { "description": "Optional vault ID to operate on. If not provided, uses the current active vault.", "type": "string" } }, "required": [ "identifiers" ], "type": "object" }

Implementation Reference

  • The handler function for the 'get_notes' MCP tool. Validates input, retrieves multiple notes using noteManager.getNote(), applies field filtering, handles errors per note, and returns a structured JSON response with success/failure counts.
    handleGetNotes = async (args: GetNotesArgs) => { // Validate arguments validateToolArgs('get_notes', args); const { noteManager } = await this.resolveVaultContext(args.vault_id); const results = await Promise.allSettled( args.identifiers.map(async identifier => { try { const note = await noteManager.getNote(identifier); if (!note) { throw new Error(`Note not found: ${identifier}`); } // Apply field filtering if specified const filteredNote = filterNoteFields(note, args.fields); return { success: true, note: filteredNote }; } catch (error) { const errorMessage = error instanceof Error ? error.message : 'Unknown error'; return { success: false, error: errorMessage }; } }) ); const processedResults = results.map((result, index) => { if (result.status === 'fulfilled') { return result.value; } else { return { success: false, error: `Failed to retrieve note ${args.identifiers[index]}: ${result.reason}` }; } }); const successful = processedResults.filter(r => r.success).length; const failed = processedResults.filter(r => !r.success).length; const responseData = { success: true, results: processedResults, total_requested: args.identifiers.length, successful, failed }; return { content: [ { type: 'text', text: JSON.stringify(responseData, null, 2) } ] }; };
  • JSON schema definition for the input parameters of the 'get_notes' tool, specifying identifiers (required array of strings), optional vault_id and fields.
    { name: 'get_notes', description: 'Retrieve multiple notes by their identifiers', inputSchema: { type: 'object', properties: { identifiers: { type: 'array', items: { type: 'string' }, description: 'Array of note identifiers in type/filename format' }, vault_id: { type: 'string', description: 'Optional vault ID to search in. If not provided, uses the current active vault.' }, fields: { type: 'array', items: { type: 'string' }, description: 'Optional list of fields to include in response (id, title, content, type, filename, path, created, updated, size, metadata)' } }, required: ['identifiers'] } },
  • MCP tool registration in the main server: maps tool name 'get_notes' to the noteHandlers.handleGetNotes method in the CallToolRequestSchema handler.
    case 'get_notes': return await this.noteHandlers.handleGetNotes( args as unknown as GetNotesArgs );
  • TypeScript interface definition for GetNotesArgs used by the get_notes handler.
    export interface GetNotesArgs { identifiers: string[]; vault_id?: string; fields?: string[]; }
  • Validation rules for 'get_notes' tool arguments, including custom validators for identifier format in the identifiers array.
    get_notes: [ { field: 'identifiers', required: true, type: 'array', arrayItemType: 'string', allowEmpty: false, minLength: 1, customValidator: (value: any) => { for (const identifier of value) { if (!identifier.includes('/')) { return `identifier "${identifier}" must be in format "type/filename"`; } const parts = identifier.split('/'); if (parts.length !== 2 || !parts[0] || !parts[1]) { return `identifier "${identifier}" must be in format "type/filename" with both parts non-empty`; } } return null; } }, { field: 'vault_id', required: false, type: 'string', allowEmpty: false }, { field: 'fields', required: false, type: 'array', arrayItemType: 'string', allowEmpty: true } ],

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/disnet/flint-note'

If you have feedback or need assistance with the MCP directory API, please join our Discord server