getLists
Retrieve and manage lists from Apple Reminders using natural language commands. View, organize, and interact with reminders directly through the MCP server interface.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {},
"type": "object"
}
Implementation Reference
- src/index.ts:16-34 (handler)The handler function for the MCP 'getLists' tool. It fetches the lists using the reminders helper and returns a JSON-formatted text response, handling errors appropriately.async () => { try { const lists = await reminders.getRemindersLists(); return { content: [{ type: "text", text: JSON.stringify({ lists }) }] }; } catch (error) { return { content: [{ type: "text", text: JSON.stringify({ error: "Failed to get reminder lists" }) }], isError: true }; } }
- src/index.ts:15-15 (schema)Empty input schema indicating the 'getLists' tool takes no parameters.{},
- src/index.ts:13-35 (registration)Registration of the 'getLists' tool on the MCP server using server.tool(), specifying name, schema, and handler.server.tool( "getLists", {}, async () => { try { const lists = await reminders.getRemindersLists(); return { content: [{ type: "text", text: JSON.stringify({ lists }) }] }; } catch (error) { return { content: [{ type: "text", text: JSON.stringify({ error: "Failed to get reminder lists" }) }], isError: true }; } } );
- src/reminders.ts:22-30 (helper)Helper function that retrieves all reminder list names using the 'node-reminders' library and is called by the tool handler.export async function getRemindersLists(): Promise<string[]> { try { const lists = await reminders.getLists(); return lists.map(list => list.name); } catch (error) { console.error('Failed to get reminder lists:', error); throw new Error(`Failed to get reminder lists: ${error}`); } }