getReminders
Retrieve reminders from specific Apple Reminders lists using the MCP Apple Reminders server, enabling AI assistants to access and manage tasks through natural language commands.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| listName | Yes |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"listName": {
"type": "string"
}
},
"required": [
"listName"
],
"type": "object"
}
Implementation Reference
- src/index.ts:38-60 (handler)MCP server.tool registration and handler function for the 'getReminders' tool. It receives listName, calls the helper getRemindersFromList, and returns JSON-formatted content or error response.server.tool( "getReminders", { listName: z.string() }, async ({ listName }) => { try { const items = await reminders.getRemindersFromList(listName); return { content: [{ type: "text", text: JSON.stringify({ reminders: items }) }] }; } catch (error) { return { content: [{ type: "text", text: JSON.stringify({ error: `Failed to get reminders from list: ${listName}` }) }], isError: true }; } } );
- src/index.ts:40-40 (schema)Input schema definition using Zod for the getReminders tool, specifying listName as a required string.{ listName: z.string() },
- src/reminders.ts:35-63 (helper)Core helper function implementing the reminder fetching logic using the node-reminders library. Finds the list, retrieves reminders with specific fields, formats dates and maps to output structure.export async function getRemindersFromList(listName: string): Promise<any[]> { try { // First get the list ID by name const lists = await reminders.getLists(); const targetList = lists.find(list => list.name === listName); if (!targetList) { throw new Error(`List "${listName}" not found`); } // Get reminders from the list with specific properties const reminderItems = await reminders.getReminders( targetList.id, ['name', 'completed', 'dueDate', 'priority', 'body'] ); // Format the reminders to match the expected output format return reminderItems.map(item => ({ name: item.name, completed: item.completed || false, dueDate: formatDate(item.dueDate), priority: item.priority || 0, notes: item.body })); } catch (error) { console.error(`Failed to get reminders from list "${listName}":`, error); throw new Error(`Failed to get reminders from list "${listName}": ${error}`); } }