Skip to main content
Glama
jxnl
by jxnl

notes

Search, retrieve, and create notes in the Apple Notes app through the Apple MCP server to manage your notes directly from Claude AI and Cursor.

Instructions

Search, retrieve and create notes in Apple Notes app

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
operationYesOperation to perform: 'search', 'list', or 'create'
searchTextNoText to search for in notes (required for search operation)
titleNoTitle of the note to create (required for create operation)
bodyNoContent of the note to create (required for create operation)
folderNameNoName of the folder to create the note in (optional for create operation, defaults to 'Claude')

Implementation Reference

  • Definition of the 'notes' tool including name, description, and input schema specifying operations: search, list, create.
    const NOTES_TOOL: Tool = {
      name: "notes", 
      description: "Search, retrieve and create notes in Apple Notes app",
      inputSchema: {
        type: "object",
        properties: {
          operation: {
            type: "string",
            description: "Operation to perform: 'search', 'list', or 'create'",
            enum: ["search", "list", "create"]
          },
          searchText: {
            type: "string",
            description: "Text to search for in notes (required for search operation)"
          },
          title: {
            type: "string",
            description: "Title of the note to create (required for create operation)"
          },
          body: {
            type: "string",
            description: "Content of the note to create (required for create operation)"
          },
          folderName: {
            type: "string",
            description: "Name of the folder to create the note in (optional for create operation, defaults to 'Claude')"
          }
        },
        required: ["operation"]
      }
    };
  • tools.ts:308-308 (registration)
    Registration of the NOTES_TOOL in the exported tools array for MCP server.
    const tools = [CONTACTS_TOOL, NOTES_TOOL, MESSAGES_TOOL, MAIL_TOOL, REMINDERS_TOOL, WEB_SEARCH_TOOL, CALENDAR_TOOL, MAPS_TOOL];
  • Helper function to retrieve all notes from the Apple Notes application (used for 'list' operation).
    async function getAllNotes() {
        const notes: Note[] = await run(() => {
            const Notes = Application('Notes');
            const notes = Notes.notes();
    
            return notes.map((note: any) => ({
                name: note.name(),
                content: note.plaintext()
            }));
        });
    
        return notes;
    }
  • Helper function to search for notes containing the given text in name or content (used for 'search' operation).
    async function findNote(searchText: string) {
        const notes: Note[] = await run((searchText: string) => {
            const Notes = Application('Notes');
            const notes = Notes.notes.whose({_or: [
                {name: {_contains: searchText}},
                {plaintext: {_contains: searchText}}
            ]})()
            return notes.length > 0 ? notes.map((note: any) => ({
                name: note.name(),
                content: note.plaintext()
            })) : [];
        }, searchText);
    
        if (notes.length === 0) {
            const allNotes = await getAllNotes();
            const closestMatch = allNotes.find(({name}) => 
                name.toLowerCase().includes(searchText.toLowerCase())
            );
            return closestMatch ? [{
                name: closestMatch.name,
                content: closestMatch.content
            }] : [];
        }
    
        return notes;
    }
  • Helper function to create a new note with title, body, and optional folder (used for 'create' operation), handles folder creation for 'Claude'.
    async function createNote(title: string, body: string, folderName: string = 'Claude'): Promise<CreateNoteResult> {
        try {
            // Format the body with proper markdown
            const formattedBody = body
                .replace(/^(#+)\s+(.+)$/gm, '$1 $2\n') // Add newline after headers
                .replace(/^-\s+(.+)$/gm, '\n- $1') // Add newline before list items
                .replace(/\n{3,}/g, '\n\n') // Remove excess newlines
                .trim();
    
            const result = await run((title: string, body: string, folderName: string) => {
                const Notes = Application('Notes');
                
                // Create the note
                let targetFolder;
                let usedDefaultFolder = false;
                let actualFolderName = folderName;
                
                try {
                    // Try to find the specified folder
                    const folders = Notes.folders();
                    for (let i = 0; i < folders.length; i++) {
                        if (folders[i].name() === folderName) {
                            targetFolder = folders[i];
                            break;
                        }
                    }
                    
                    // If the specified folder doesn't exist
                    if (!targetFolder) {
                        if (folderName === 'Claude') {
                            // Try to create the Claude folder if it doesn't exist
                            Notes.make({new: 'folder', withProperties: {name: 'Claude'}});
                            usedDefaultFolder = true;
                            
                            // Find it again after creation
                            const updatedFolders = Notes.folders();
                            for (let i = 0; i < updatedFolders.length; i++) {
                                if (updatedFolders[i].name() === 'Claude') {
                                    targetFolder = updatedFolders[i];
                                    break;
                                }
                            }
                        } else {
                            throw new Error(`Folder "${folderName}" not found`);
                        }
                    }
                    
                    // Create the note in the specified folder or default folder
                    let newNote;
                    if (targetFolder) {
                        newNote = Notes.make({new: 'note', withProperties: {name: title, body: body}, at: targetFolder});
                        actualFolderName = folderName;
                    } else {
                        // Fall back to default folder
                        newNote = Notes.make({new: 'note', withProperties: {name: title, body: body}});
                        actualFolderName = 'Default';
                    }
                    
                    return {
                        success: true,
                        note: {
                            name: title,
                            content: body
                        },
                        folderName: actualFolderName,
                        usedDefaultFolder: usedDefaultFolder
                    };
                } catch (scriptError) {
                    throw new Error(`AppleScript error: ${scriptError.message || String(scriptError)}`);
                }
            }, title, formattedBody, folderName);
            
            return result;
        } catch (error) {
            return {
                success: false,
                message: `Failed to create note: ${error instanceof Error ? error.message : String(error)}`
            };
        }
    }
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 mentions operations but doesn't describe what happens during each (e.g., search returns matching notes, list returns all notes, create adds a new note). It lacks details on permissions, rate limits, error handling, or whether operations are read-only or mutative (create implies mutation). The description is too vague for a tool with multiple operations.

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 a single, efficient sentence that front-loads the core purpose. It wastes no words but could be more structured by separating operations or adding brief context. Given the tool's multi-operation nature, a bit more detail might improve clarity without sacrificing conciseness.

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?

For a tool with 5 parameters, no annotations, no output schema, and multiple operations (search, list, create), the description is incomplete. It doesn't explain return values, error conditions, or behavioral nuances. The schema covers parameters, but the description fails to add necessary context for safe and effective use, especially given the mutative 'create' operation.

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 fully documents all 5 parameters and their purposes. The description adds no parameter-specific information beyond what's in the schema (e.g., it doesn't explain search behavior, list scope, or create defaults). Baseline is 3 since the schema handles parameter semantics adequately.

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, retrieve and create') and resource ('notes in Apple Notes app'). It distinguishes this tool from siblings like calendar or contacts by specifying the Apple Notes domain. However, it doesn't explicitly differentiate 'retrieve' from 'list' operations or mention that 'retrieve' might refer to listing 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 prerequisites (e.g., Apple Notes app availability), when to choose search vs. list operations, or how this tool relates to sibling tools like reminders or messages for note-taking tasks. Usage is implied through the operation parameter but not explicitly stated.

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

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