Skip to main content
Glama

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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}`, }, ], }; }, );
  • 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}`, }, ], }; }, );
  • Global Map storing all created lists, used by list_all_lists and other list-related tools.
    const lists = new Map<string, string[]>();

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jrandolf/par5-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server