note_search
Search note titles and content by keyword to find project information in the Saga MCP server's structured database.
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 for note_search which executes the SQL query.
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 tool definition/schema for note_search.
{ 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)Registration mapping the tool name to its handler function.
export const handlers: Record<string, ToolHandler> = { note_save: handleNoteSave, note_list: handleNoteList, note_search: handleNoteSearch, note_delete: handleNoteDelete, };