Skip to main content
Glama

note_search

Read-onlyIdempotent

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,
    };
Behavior4/5

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

Annotations already declare readOnlyHint=true, destructiveHint=false, idempotentHint=true, and openWorldHint=false, covering safety and idempotency. The description adds context by specifying search scope ('across note titles and content'), which isn't in annotations. It doesn't mention rate limits, authentication needs, or result format, but with annotations providing core behavioral traits, this is sufficient for a 4.

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?

Single sentence, front-loaded with the core purpose, zero wasted words. Every part ('Search across note titles and content by keyword') directly contributes to understanding the tool's function without redundancy.

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

Completeness3/5

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

Given the tool's moderate complexity (search with filtering), annotations cover safety and idempotency, but no output schema exists. The description lacks details on return format (e.g., list of notes with fields) or pagination behavior. It's minimally adequate but has clear gaps in explaining what results to expect, making it a 3.

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

Parameters3/5

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

Schema description coverage is 33% (only 'query' has a description). The description mentions 'keyword' search, which aligns with the 'query' parameter but doesn't add details beyond the schema. It doesn't explain 'note_type' enum values or 'limit' default behavior. With low schema coverage, the description doesn't compensate enough, but it provides some context, so baseline 3 is appropriate.

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

Purpose4/5

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

The description clearly states the action ('Search') and target resources ('note titles and content'), specifying the scope ('by keyword'). It distinguishes from siblings like note_list (which presumably lists without search) and note_save/note_delete (which modify). However, it doesn't explicitly differentiate from tracker_search or other search tools, keeping it at 4 rather than 5.

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 explicit guidance on when to use this tool versus alternatives like note_list (for unfiltered listing) or tracker_search (for broader tracking data). The description implies usage for keyword-based note searches but doesn't mention prerequisites, exclusions, or comparative contexts with sibling 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