notes_get_folders
Retrieve all note folders and their note counts from the macOS Notes app. Use this tool to organize and manage your notes by viewing folder structures and content quantities.
Instructions
Get all note folders with note counts
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:1136-1191 (handler)Handler for 'notes_get_folders' tool: executes AppleScript via osascript to retrieve all folders in the Notes app along with the note count in each folder, formats and returns the result.case 'notes_get_folders': try { const command = `osascript -e 'tell application "Notes" set folderInfo to {} repeat with aFolder in folders set folderName to name of aFolder set noteCount to count of notes in aFolder set end of folderInfo to (folderName & ": " & noteCount & " notes") end repeat return folderInfo as string end tell'`; const { stdout, stderr } = await execAsync(command); if (stderr.trim()) { return { content: [ { type: 'text', text: `Error getting note folders: ${stderr.trim()}`, }, ], }; } const output = stdout.trim(); if (!output || output === '') { return { content: [ { type: 'text', text: 'No note folders found', }, ], }; } return { content: [ { type: 'text', text: `Note Folders:\n${output}`, }, ], }; } catch (error: any) { return { content: [ { type: 'text', text: `Error executing notes folders command: ${error.message}`, }, ], }; }
- src/index.ts:142-148 (registration)Tool registration entry in ListTools response, including name, description, and empty input schema (no parameters required).name: 'notes_get_folders', description: 'Get all note folders with note counts', inputSchema: { type: 'object', properties: {}, }, },
- src/index.ts:144-147 (schema)Input schema for notes_get_folders: empty object (no input parameters).inputSchema: { type: 'object', properties: {}, },