Skip to main content
Glama
arslankhanali

Apple Notes MCP Server

read_note

Retrieve content from Apple Notes by specifying a note name and optional account, enabling access to stored information for review or processing.

Instructions

Read the content of a specific note by name.

Args:
    note_name: Name of the note to read
    account: Optional account name where the note is located

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
note_nameYes
accountNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The main handler function for the 'read_note' tool, decorated with @mcp.tool() for registration. It constructs and executes AppleScript to retrieve the content of a specified note from Apple Notes.app, handling optional account specification.
    @mcp.tool()
    async def read_note(note_name: str, account: Optional[str] = None) -> str:
        """Read the content of a specific note by name.
        
        Args:
            note_name: Name of the note to read
            account: Optional account name where the note is located
        """
        if account:
            script = f'''
            tell application "Notes"
                set accountName to "{escape_applescript_string(account)}"
                set noteName to "{escape_applescript_string(note_name)}"
                try
                    set targetAccount to account accountName
                    set targetNote to note noteName of targetAccount
                    return (body of targetNote)
                on error
                    return "ERROR: Note not found"
                end try
            end tell
            '''
        else:
            script = f'''
            tell application "Notes"
                set noteName to "{escape_applescript_string(note_name)}"
                repeat with anAccount in accounts
                    try
                        set targetNote to note noteName of anAccount
                        return (body of targetNote)
                    end try
                end repeat
                return "ERROR: Note not found"
            end tell
            '''
        
        output, success = run_applescript(script)
        if not success or output == "ERROR: Note not found":
            return output if output else f"Note '{note_name}' not found."
        
        return f"Note: {note_name}\n\n{output}"
  • Helper function to execute AppleScript commands via subprocess, used by read_note to interact with Notes.app.
    def run_applescript(script: str) -> tuple[str, bool]:
        """Run an AppleScript command and return the output."""
        try:
            result = subprocess.run(
                ["osascript", "-e", script],
                capture_output=True,
                text=True,
                timeout=30
            )
            if result.returncode == 0:
                return result.stdout.strip(), True
            else:
                error_msg = result.stderr.strip() or result.stdout.strip()
                return f"Error: {error_msg}", False
        except subprocess.TimeoutExpired:
            return "Error: AppleScript execution timed out", False
        except Exception as e:
            return f"Error: {str(e)}", False
  • Helper function to properly escape strings for safe insertion into AppleScript, used in read_note script construction.
    def escape_applescript_string(text: str) -> str:
        """Escape special characters for AppleScript strings."""
        # Replace backslashes, quotes, and newlines
        text = text.replace("\\", "\\\\")
        text = text.replace('"', '\\"')
        text = text.replace("\n", "\\n")
        return text
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 this is a read operation, implying it's non-destructive, but doesn't mention any permissions required, rate limits, error conditions, or what happens if the note doesn't exist. This leaves significant behavioral gaps for a tool that accesses data.

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 appropriately sized with two sentences: one stating the purpose and another listing parameters. It's front-loaded with the core functionality. The parameter documentation is somewhat redundant with the schema but adds minimal clarification, keeping it efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool has an output schema (which handles return values), no annotations, and simple parameters, the description is minimally adequate. It covers the basic operation and parameters but lacks context about when to use it, error handling, or behavioral traits, leaving room for improvement in guiding the agent.

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 description explicitly documents both parameters ('note_name' and 'account') with brief explanations, adding meaning beyond the schema which has 0% description coverage. However, it doesn't provide details like format examples, constraints, or how the account parameter affects the operation, so it only partially compensates for the schema gap.

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 a specific verb ('Read') and resource ('content of a specific note by name'), making it immediately understandable. However, it doesn't explicitly differentiate this read operation from other note-related tools like 'list_notes' or 'search_notes', which is why it doesn't reach a perfect score.

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 'search_notes'. It mentions an optional 'account' parameter but doesn't explain when this is needed or how it relates to other tools, leaving the agent with no usage context.

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

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