list_all_lists
View all available lists and their item counts to identify existing data collections or retrieve forgotten list IDs in your current session.
Instructions
Lists all existing lists and their item counts.
WHEN TO USE:
To see all available lists in the current session
To find a list ID you may have forgotten
To check how many lists exist
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:449-474 (handler)The handler function for the 'list_all_lists' tool. It checks if there are any lists, and if so, returns a formatted list of all list IDs and their item counts from the global 'lists' Map. Returns a message if no lists exist.async () => { if (lists.size === 0) { return { content: [ { type: "text", text: "No lists exist. Use create_list to create a new list.", }, ], }; } const listInfo = Array.from(lists.entries()) .map(([id, items]) => `- "${id}": ${items.length} items`) .join("\n"); return { content: [ { type: "text", text: `Found ${lists.size} list(s):\n\n${listInfo}`, }, ], }; }, );
- src/index.ts:440-448 (schema)The input schema and description for the 'list_all_lists' tool. It takes no input parameters (empty schema).{ description: `Lists all existing lists and their item counts. WHEN TO USE: - To see all available lists in the current session - To find a list ID you may have forgotten - To check how many lists exist`, inputSchema: {}, },
- src/index.ts:438-474 (registration)The registration of the 'list_all_lists' tool using server.registerTool, including the tool name, schema, and handler function.server.registerTool( "list_all_lists", { description: `Lists all existing lists and their item counts. WHEN TO USE: - To see all available lists in the current session - To find a list ID you may have forgotten - To check how many lists exist`, inputSchema: {}, }, async () => { if (lists.size === 0) { return { content: [ { type: "text", text: "No lists exist. Use create_list to create a new list.", }, ], }; } const listInfo = Array.from(lists.entries()) .map(([id, items]) => `- "${id}": ${items.length} items`) .join("\n"); return { content: [ { type: "text", text: `Found ${lists.size} list(s):\n\n${listInfo}`, }, ], }; }, );
- src/index.ts:138-138 (helper)Global Map storing all created lists, used by list_all_lists and other list-related tools.const lists = new Map<string, string[]>();