Skip to main content
Glama

notes_search_notes

Search macOS Notes app content by title or text to find specific information quickly. Enter a query to locate relevant notes.

Instructions

Search notes by title or content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch query for note title or content

Implementation Reference

  • Handler for notes_search_notes tool: executes AppleScript to search Notes app for notes whose name contains the query string, returns matching note names with modification dates.
    case 'notes_search_notes':
      try {
        const query = (args?.query as string) || '';
        if (!query) {
          return {
            content: [
              {
                type: 'text',
                text: 'Error: query is required',
              },
            ],
          };
        }
        
        const command = `osascript -e 'on run argv
          set queryString to item 1 of argv
          tell application "Notes"
            set matchingNotes to {}
            repeat with aNote in notes
              set noteName to name of aNote
              if noteName contains queryString then
                set modDate to modification date of aNote
                set end of matchingNotes to (noteName & " (Modified: " & (modDate as string) & ")")
              end if
            end repeat
            return matchingNotes as string
          end tell
        end run' -- "${query}"`;
        
        const { stdout, stderr } = await execAsync(command);
        
        if (stderr.trim()) {
          return {
            content: [
              {
                type: 'text',
                text: `Error searching notes: ${stderr.trim()}`,
              },
            ],
          };
        }
        
        const output = stdout.trim();
        if (!output || output === '') {
          return {
            content: [
              {
                type: 'text',
                text: `No notes found matching "${query}"`,
              },
            ],
          };
        }
        
        return {
          content: [
            {
              type: 'text',
              text: `Notes matching "${query}":\n${output}`,
            },
          ],
        };
      } catch (error: any) {
        return {
          content: [
            {
              type: 'text',
              text: `Error executing notes search command: ${error.message}`,
            },
          ],
        };
      }
  • Input schema for notes_search_notes: requires a 'query' string parameter.
    inputSchema: {
      type: 'object',
      properties: {
        query: {
          type: 'string',
          description: 'Search query for note title or content',
        },
      },
      required: ['query'],
    },
  • src/index.ts:162-175 (registration)
    Tool registration in the ListTools response, including name, description, and schema.
    {
      name: 'notes_search_notes',
      description: 'Search notes by title or content',
      inputSchema: {
        type: 'object',
        properties: {
          query: {
            type: 'string',
            description: 'Search query for note title or content',
          },
        },
        required: ['query'],
      },
    },
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states the tool searches notes but doesn't disclose behavioral traits such as whether it's read-only (implied but not explicit), how results are returned (e.g., list format, pagination), error handling, or any limitations like search performance or scope constraints. This leaves significant gaps for a search operation.

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, efficient sentence with zero waste. It's front-loaded with the core purpose and appropriately sized for a simple search tool, making it easy to parse quickly.

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 tool's complexity (a search operation with no output schema and no annotations), the description is incomplete. It lacks details on return values, result format, error cases, or behavioral constraints. While concise, it doesn't provide enough context for reliable agent use without additional assumptions.

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?

The input schema has 100% description coverage, with the 'query' parameter fully documented. The description adds minimal value beyond the schema by specifying 'by title or content', which slightly clarifies the search scope but doesn't provide additional syntax, format, or examples. This meets the baseline for high schema coverage.

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 verb ('search') and resource ('notes'), specifying the search scope ('by title or content'). However, it doesn't differentiate from sibling tools like 'notes_get_recent_notes' or 'notes_create_note', which would require mentioning this is specifically for text-based searching rather than listing or creating notes.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention when to choose this over 'notes_get_recent_notes' for finding notes, or any prerequisites like needing existing notes to search. There's only an implied usage from the purpose statement.

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/samicokar/mcp-mac'

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