list_accounts
Retrieve all available Apple Notes accounts to manage notes across different user profiles or iCloud configurations.
Instructions
List all available Notes accounts.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- apple_notes.py:397-423 (handler)The handler function for the 'list_accounts' tool, decorated with @mcp.tool() which also serves as registration. It runs an AppleScript to list Notes accounts, parses the output, and formats it nicely.@mcp.tool() async def list_accounts() -> str: """List all available Notes accounts.""" script = ''' tell application "Notes" set accountList to {} repeat with anAccount in accounts set end of accountList to name of anAccount end repeat return accountList end tell ''' output, success = run_applescript(script) if not success: return output if not output or output == "{}": return "No accounts found." accounts = [acc.strip().strip('"').strip("'") for acc in output.split(", ")] result = "Available accounts:\n" for i, account in enumerate(accounts, 1): result += f"{i}. {account}\n" return result