Skip to main content
Glama

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

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch keywords
note_typeNo
limitNo

Implementation Reference

  • 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);
    }
  • 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'],
      },
    },
  • 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,
    };

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/spranab/saga-mcp'

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