Skip to main content
Glama

note_search

Read-onlyIdempotent

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

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch keywords
note_typeNo
limitNo

Implementation Reference

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

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, covering the safety profile. The description adds the scope ('titles and content') but does not disclose details like search behavior (e.g., fuzzy matching) or performance considerations. With annotations present, this is adequate but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence of 8 words, with no extraneous information. It efficiently communicates the core action.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the three parameters (one enum), no output schema, and no description of return value or behavior, the description is incomplete. It fails to inform the agent about filtering by note_type, the default limit, or the structure of search results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is low (33%), with only 'query' having a description ('Search keywords'). The other parameters, note_type and limit, lack descriptions in both schema and tool description. The description does not explain how note_type filters results or that limit defaults to 20, so it adds minimal meaning beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function: searching across note titles and content by keyword. The verb 'Search' and resource 'note titles and content' are specific, distinguishing it from sibling tools like note_list or note_save.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool instead of alternatives like note_list, nor any conditions or exclusions. The agent receives no help in deciding between similar note-related tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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