Skip to main content
Glama

notes_get

Retrieve a specific Apple Notes entry by its title, optionally specifying a folder to search within for targeted access to your macOS notes.

Instructions

[Apple Notes operations] Get a specific note by title

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesTitle of the note to retrieve
folderNoOptional folder name to search in

Implementation Reference

  • Handler function that generates AppleScript code to retrieve a specific note by title from the Apple Notes application, optionally from a specific folder. Returns JSON with title, body, creation date, and modification date.
      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
        `;
      }
    },
  • Input schema defining the parameters for the notes_get tool: required 'title' string, optional 'folder' string.
    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/index.ts:35-35 (registration)
    Registers the 'notes' category (containing the 'get' script) with the AppleScriptFramework server.
    server.addCategory(notesCategory);
  • Constructs the full tool name as 'notes_get' from category 'notes' and script 'get' when listing tools.
    name: `${category.name}_${script.name}`, // Changed from dot to underscore

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/joshrutkowski/applescript-mcp'

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