Skip to main content
Glama

list_all_lists

View all available lists and their item counts to identify existing lists or find forgotten list IDs in the 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 that executes the list_all_lists tool. It checks if any lists exist using the global 'lists' Map. If none, returns a message. Otherwise, it maps over the lists to create a formatted string of list IDs and their item counts, and returns it in the tool response format.
    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:425-461 (registration)
    The registration of the 'list_all_lists' tool using McpServer's registerTool method, including the tool name, description, empty input schema (no parameters), and the 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}`,
    				},
    			],
    		};
    	},
    );
  • The tool metadata including description and inputSchema. The inputSchema is empty object {} indicating no input parameters are required.
    	{
    		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: {},
    	},
  • Global Map storing all created lists by their ID. Used by list_all_lists to iterate and report existing lists.
    const lists = new Map<string, string[]>();
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries full burden. It describes what the tool returns (lists with item counts) but doesn't disclose behavioral aspects like whether results are paginated, sorted, or filtered. The description doesn't contradict any annotations since none exist, but leaves operational details unspecified.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with a clear purpose statement followed by a bulleted 'WHEN TO USE' section. Every sentence earns its place by providing distinct value - first stating what the tool does, then providing concrete usage scenarios. No wasted words or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a zero-parameter read-only tool with no output schema, the description provides good coverage of purpose and usage scenarios. However, it doesn't describe the return format (e.g., structure of list objects, what fields are included beyond ID and item count) which would be helpful given the lack of output schema.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters (schema coverage 100%), so no parameter documentation is needed. The description appropriately focuses on the tool's purpose and usage rather than parameter details, which aligns with the zero-parameter baseline expectation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with specific verb ('Lists') and resource ('all existing lists and their item counts'). It distinguishes from siblings like 'get_list' (which retrieves a specific list) by emphasizing comprehensive listing of all lists with metadata.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The 'WHEN TO USE' section provides explicit guidance with three concrete scenarios: seeing all available lists, finding forgotten list IDs, and checking list counts. This clearly communicates when this tool is appropriate versus alternatives like 'get_list' for specific list retrieval.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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/mathematic-inc/par5-mcp'

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