notes_get
Retrieve a specific note from Apple Notes by its title using AppleScript through the MCP server. Optional folder search to locate the note efficiently.
Instructions
[Apple Notes operations] Get a specific note by title
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| folder | No | Optional folder name to search in | |
| title | Yes | Title of the note to retrieve |
Implementation Reference
- src/categories/notes.ts:236-292 (handler)Handler function for notes_get tool: generates AppleScript to retrieve a specific note by title (optionally from a folder) and returns JSON with title, body, creation date, and modification date.script: (args) => { const { title, folder = "" } = args; if (folder) { return ` tell application "Notes" set folderList to folders whose name is "${folder}" if length of folderList > 0 then set targetFolder to item 1 of folderList set matchingNotes to notes of targetFolder whose name is "${title}" if length of matchingNotes > 0 then set n to item 1 of matchingNotes set noteTitle to name of n set noteBody to body of n set noteCreationDate to creation date of n set noteModDate to modification date of n set jsonResult to "{\\"title\\": \\"" set jsonResult to jsonResult & noteTitle & "\\"" set jsonResult to jsonResult & ", \\"body\\": \\"" & noteBody & "\\"" set jsonResult to jsonResult & ", \\"creationDate\\": \\"" & noteCreationDate & "\\"" set jsonResult to jsonResult & ", \\"modificationDate\\": \\"" & noteModDate & "\\"}" return jsonResult else return "Note not found: ${title}" end if else return "Folder not found: ${folder}" end if end tell `; } else { return ` tell application "Notes" set matchingNotes to notes whose name is "${title}" if length of matchingNotes > 0 then set n to item 1 of matchingNotes set noteTitle to name of n set noteBody to body of n set noteCreationDate to creation date of n set noteModDate to modification date of n set jsonResult to "{\\"title\\": \\"" set jsonResult to jsonResult & noteTitle & "\\"" set jsonResult to jsonResult & ", \\"body\\": \\"" & noteBody & "\\"" set jsonResult to jsonResult & ", \\"creationDate\\": \\"" & noteCreationDate & "\\"" set jsonResult to jsonResult & ", \\"modificationDate\\": \\"" & noteModDate & "\\"}" return jsonResult else return "Note not found: ${title}" end if end tell `; } },
- src/categories/notes.ts:293-306 (schema)Input schema for notes_get tool defining required 'title' and optional 'folder' parameters.schema: { type: "object", properties: { title: { type: "string", description: "Title of the note to retrieve" }, folder: { type: "string", description: "Optional folder name to search in" } }, required: ["title"] }
- src/framework.ts:221-232 (registration)Tool registration for discovery: constructs tool names as '{category}_{script}' (e.g., 'notes_get') and exposes schema.this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: this.categories.flatMap((category) => category.scripts.map((script) => ({ name: `${category.name}_${script.name}`, // Changed from dot to underscore description: `[${category.description}] ${script.description}`, inputSchema: script.schema || { type: "object", properties: {}, }, })), ), }));
- src/framework.ts:244-247 (registration)Tool call dispatching: parses 'notes_get' by splitting on '_', locates notes category and 'get' script, executes the handler.const [categoryName, ...scriptNameParts] = toolName.split("_"); const scriptName = scriptNameParts.join("_"); // Rejoin in case script name has underscores
- src/index.ts:34-35 (registration)Registers the notes category (containing notes_get implementation) with the MCP server.server.addCategory(messagesCategory); server.addCategory(notesCategory);