Skip to main content
Glama
arslankhanali

Apple Notes MCP Server

create_note

Create new notes in Apple Notes with specified titles, content, and optional organization into accounts and folders.

Instructions

Create a new note with the specified title and content.

Args:
    title: Title/name for the new note
    content: Content/body of the note
    account: Optional account name (defaults to default account)
    folder: Optional folder name within the account

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYes
contentYes
accountNo
folderNo

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • The primary handler function for the 'create_note' tool. It is registered via the @mcp.tool() decorator and implements the logic to create a new note in the Apple Notes application using dynamically generated AppleScript, supporting optional account and folder specifications.
    @mcp.tool()
    async def create_note(title: str, content: str, account: Optional[str] = None, folder: Optional[str] = None) -> str:
        """Create a new note with the specified title and content.
        
        Args:
            title: Title/name for the new note
            content: Content/body of the note
            account: Optional account name (defaults to default account)
            folder: Optional folder name within the account
        """
        escaped_title = escape_applescript_string(title)
        escaped_content = escape_applescript_string(content)
        
        if account and folder:
            script = f'''
            tell application "Notes"
                set accountName to "{escape_applescript_string(account)}"
                set folderName to "{escape_applescript_string(folder)}"
                try
                    set targetAccount to account accountName
                    set targetFolder to folder folderName of targetAccount
                    make new note at targetFolder with properties {{name:"{escaped_title}", body:"{escaped_content}"}}
                    return "SUCCESS"
                on error errMsg
                    return "ERROR: " & errMsg
                end try
            end tell
            '''
        elif account:
            script = f'''
            tell application "Notes"
                set accountName to "{escape_applescript_string(account)}"
                try
                    set targetAccount to account accountName
                    make new note at targetAccount with properties {{name:"{escaped_title}", body:"{escaped_content}"}}
                    return "SUCCESS"
                on error errMsg
                    return "ERROR: " & errMsg
                end try
            end tell
            '''
        else:
            script = f'''
            tell application "Notes"
                try
                    make new note with properties {{name:"{escaped_title}", body:"{escaped_content}"}}
                    return "SUCCESS"
                on error errMsg
                    return "ERROR: " & errMsg
                end try
            end tell
            '''
        
        output, success = run_applescript(script)
        if not success or "ERROR" in output:
            return output if output else "Failed to create note."
        
        return f"Successfully created note '{title}'."
  • Helper function used by create_note (and other tools) to execute AppleScript commands via subprocess, returning output and success status.
    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 used by create_note to properly escape title and content strings for safe inclusion in AppleScript.
    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
  • Input schema defined by function parameters with type hints and detailed Arg descriptions in docstring. Returns a string message indicating success or error.
    async def create_note(title: str, content: str, account: Optional[str] = None, folder: Optional[str] = None) -> str:
        """Create a new note with the specified title and content.
        
        Args:
            title: Title/name for the new note
            content: Content/body of the note
            account: Optional account name (defaults to default account)
            folder: Optional folder name within the account
        """
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. While it correctly identifies this as a creation operation, it doesn't disclose important behavioral traits like what happens on duplicate titles, whether the operation is idempotent, what permissions are required, or what the response format looks like. The description is minimal and lacks behavioral context beyond the basic operation.

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 well-structured and appropriately sized. It starts with a clear purpose statement, then provides parameter explanations in a clean format. Every sentence earns its place, though the parameter explanations could be slightly more concise. The structure is front-loaded with the main purpose first.

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 that there's an output schema (which handles return values), the description covers the basic operation and parameters adequately. However, for a creation tool with no annotations, it should provide more behavioral context about what happens after creation, error conditions, or system constraints. The parameter explanations are good, but overall completeness is just adequate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides clear semantic explanations for all 4 parameters beyond what the schema offers (which has 0% description coverage). It explains that 'title' is the title/name, 'content' is the body, 'account' is optional with default behavior, and 'folder' is an optional location. This adds meaningful context that compensates for the schema's lack of descriptions.

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 as 'Create a new note with the specified title and content.' This is a specific verb+resource combination that distinguishes it from siblings like delete_note, update_note, and read_note. However, it doesn't explicitly differentiate from similar creation tools if they existed, though in this context it's clear enough.

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 update_note or search_notes. It doesn't mention prerequisites, error conditions, or typical use cases. The only implicit guidance is that it's for creating new notes, but no explicit when/when-not instructions are provided.

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