note_search
Search notes by keyword across titles and content. Filter by note type and limit results to find relevant information quickly.
Instructions
Search across note titles and content by keyword.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Search keywords | |
| note_type | No | ||
| limit | No |
Implementation Reference
- src/tools/notes.ts:159-178 (handler)The handler function that executes the note_search tool logic: performs a SQL LIKE search across note title and content with optional note_type filter, ordered by created_at descending.
function handleNoteSearch(args: Record<string, unknown>) { const db = getDb(); const query = args.query as string; const noteType = args.note_type as string | undefined; const limit = (args.limit as number) ?? 20; const whereClauses = ['(title LIKE ? OR content LIKE ?)']; const pattern = `%${query}%`; const params: unknown[] = [pattern, pattern]; if (noteType) { whereClauses.push('note_type = ?'); params.push(noteType); } const sql = `SELECT * FROM notes WHERE ${whereClauses.join(' AND ')} ORDER BY created_at DESC LIMIT ?`; params.push(limit); return db.prepare(sql).all(...params); } - src/tools/notes.ts:53-69 (schema)The schema/input definition for the note_search tool, specifying 'query' (required string), optional 'note_type' enum, and optional 'limit' (default 20).
{ name: 'note_search', description: 'Search across note titles and content by keyword.', annotations: { title: 'Search Notes', readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false }, inputSchema: { type: 'object', properties: { query: { type: 'string', description: 'Search keywords' }, note_type: { type: 'string', enum: ['general', 'decision', 'context', 'meeting', 'technical', 'blocker', 'progress', 'release'], }, limit: { type: 'integer', default: 20 }, }, required: ['query'], }, }, - src/tools/notes.ts:193-198 (registration)The registration of note_search in the handlers map, mapping the tool name 'note_search' to the handleNoteSearch function.
export const handlers: Record<string, ToolHandler> = { note_save: handleNoteSave, note_list: handleNoteList, note_search: handleNoteSearch, note_delete: handleNoteDelete, }; - src/index.ts:37-49 (registration)The central registration in index.ts where noteHandlers (including note_search) are spread into ALL_HANDLERS and dispatched via CallToolRequestSchema.
const ALL_HANDLERS: Record<string, (args: Record<string, unknown>) => unknown> = { ...projectHandlers, ...epicHandlers, ...taskHandlers, ...subtaskHandlers, ...noteHandlers, ...commentHandlers, ...templateHandlers, ...dashboardHandlers, ...searchHandlers, ...activityHandlers, ...exportImportHandlers, };