Skip to main content
Glama

TriliumNext Notes' MCP Server

resolveHandler.ts1.97 kB
/** * Resolve Handler Module * Handles resolve_note_id tool requests with permission validation */ import { handleResolveNoteId, ResolveNoteOperation } from "./resolveManager.js"; export async function handleResolveNoteRequest(args: any, permissionChecker: any, axiosInstance: any): Promise<any> { // Permission check if (!permissionChecker.hasPermission("READ")) { throw new Error("READ permission required for resolve_note_id operation"); } const resolveOperation: ResolveNoteOperation = { noteName: args.noteName, exactMatch: args.exactMatch, maxResults: args.maxResults, autoSelect: args.autoSelect }; const response = await handleResolveNoteId(resolveOperation, axiosInstance); // Enhanced response formatting for multiple matches if (response.requiresUserChoice && response.topMatches) { const choiceList = response.topMatches .map((match, index) => `${index + 1}. ${match.title} (ID: ${match.noteId}, Type: ${match.type}, Modified: ${match.dateModified})`) .join('\n'); return { content: [ { type: "text", text: `Found ${response.matches} matches for "${resolveOperation.noteName}". Please choose:\n\n${choiceList}\n\nTo select: Use the note ID directly, or specify autoSelect=true for automatic selection, or refine your search criteria.` } ] }; } // Standard response for single match or auto-selected if (response.found && response.noteId) { return { content: [ { type: "text", text: `✅ Resolved "${resolveOperation.noteName}" to Note ID: ${response.noteId} (Title: "${response.title}", Matches: ${response.matches})` } ] }; } // No matches found return { content: [ { type: "text", text: `❌ No notes found matching "${resolveOperation.noteName}". ${response.nextSteps || "Try a different search term or check spelling."}` } ] }; }

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/tan-yong-sheng/triliumnext-mcp'

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