Get Lists
get_listsRetrieve all shopping lists from your AnyList account to view, manage, or organize items for shopping and meal planning.
Instructions
List all shopping lists in the AnyList account.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_lists"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/tools/lists.ts:13-34 (handler)The handler function for the "get_lists" tool, which fetches lists from the AnyListClient and formats them for the MCP response.
async () => { try { const client = AnyListClient.getInstance(); const lists = await client.getLists(); const result = lists.map((l) => ({ id: l.identifier, name: l.name, itemCount: l.items.length, uncheckedCount: l.items.filter((i) => !i.checked).length, })); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }], }; } catch (error) { return { content: [{ type: 'text', text: `Error fetching lists: ${error instanceof Error ? error.message : String(error)}` }], isError: true, }; } }, - src/tools/lists.ts:6-12 (registration)The registration of the "get_lists" tool within the McpServer.
server.registerTool( 'get_lists', { title: 'Get Lists', description: 'List all shopping lists in the AnyList account.', inputSchema: z.object({}), },