Skip to main content
Glama
ailenshen

Apple Notes MCP Server

search_notes

Find Apple Notes by searching titles and content snippets with keywords. Retrieve matching notes and their metadata for quick access.

Instructions

Search Apple Notes by keyword. Searches in title and snippet. Returns matching notes with metadata.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryYesSearch keyword
limitNoMax number of results

Implementation Reference

  • src/db.ts:76-95 (handler)
    The core business logic that queries the SQLite database to find notes matching the query string in title or snippet.
    export function searchNotes(query: string, limit?: number): NoteRow[] {
      const db = getDb();
      const likePattern = `%${query}%`;
      let sql = LIST_QUERY.replace(
        "ORDER BY",
        `AND (n.ZTITLE1 LIKE ? OR n.ZSNIPPET LIKE ?) ORDER BY`
      );
      const params: unknown[] = [likePattern, likePattern];
    
      if (limit) {
        sql += ` LIMIT ?`;
        params.push(limit);
      }
    
      const rows = db.prepare(sql).all(...params) as NoteRow[];
      return rows.map((r) => ({
        ...r,
        is_pinned: Boolean(r.is_pinned),
      }));
    }
  • src/index.ts:42-60 (registration)
    The MCP tool registration and handler wrapper for 'search_notes', which calls the database function defined in db.ts.
    // --- search_notes ---
    server.tool(
      "search_notes",
      "Search Apple Notes by keyword. Searches in title and snippet. Returns matching notes with metadata.",
      {
        query: z.string().describe("Search keyword"),
        limit: z.number().optional().describe("Max number of results"),
      },
      async ({ query, limit }) => {
        try {
          const notes = searchNotes(query, limit);
          return {
            content: [{ type: "text", text: JSON.stringify(notes, null, 2) }],
          };
        } catch (e: unknown) {
          return {
            content: [{ type: "text", text: `Error: ${(e as Error).message}` }],
            isError: true,
          };
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states the tool searches and returns metadata, but lacks details on permissions, rate limits, error handling, or what specific metadata is included. This is a significant gap for a search tool with zero annotation coverage.

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

Conciseness4/5

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

The description is efficient with two sentences that convey core functionality without waste. It is appropriately sized for a simple search tool, though it could be slightly more structured by separating purpose from behavioral details.

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 no annotations and no output schema, the description is incomplete. It doesn't explain return values (beyond 'metadata'), error cases, or behavioral traits like search scope limitations. For a search tool with two parameters, this leaves the agent with insufficient context.

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 100%, so the schema already documents both parameters ('query' and 'limit'). The description adds minimal value by implying keyword-based search but doesn't provide additional syntax, format details, or constraints beyond what the schema offers.

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 tool's purpose with specific verbs ('Search Apple Notes') and resource ('notes'), and mentions what fields are searched ('title and snippet'). It distinguishes from siblings like 'list_otes' by specifying keyword-based search, though it doesn't explicitly contrast with all siblings.

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 like 'list_notes' or 'get_note'. It mentions what the tool does but offers no context about appropriate use cases, prerequisites, or exclusions.

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/ailenshen/apple-notes-mcp'

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