Skip to main content
Glama

create_list

Create named lists of files, URLs, or items for parallel processing operations across multiple elements in a single workflow.

Instructions

Creates a named list of items for parallel processing. Use this tool when you need to perform the same operation across multiple files, URLs, or any collection of items.

WHEN TO USE:

  • Before running shell commands or AI agents across multiple items

  • When you have a collection of file paths, URLs, identifiers, or any strings to process in parallel

WORKFLOW:

  1. Call create_list with your array of items

  2. Use the returned list_id with run_shell_across_list or run_agent_across_list

  3. The list persists for the duration of the session

EXAMPLE: To process files ["src/a.ts", "src/b.ts", "src/c.ts"], first create a list, then use run_shell_across_list or run_agent_across_list with the returned id.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
itemsYesArray of items to store in the list. Each item can be a file path, URL, identifier, or any string that will be substituted into commands or prompts.

Implementation Reference

  • The handler function for the 'create_list' tool. It generates a unique list ID using generateListId(), stores the provided items in the global 'lists' Map, and returns a success message with the list ID.
    async ({ items }) => {
    	const id = generateListId();
    	lists.set(id, items);
    	return {
    		content: [
    			{
    				type: "text",
    				text: `Successfully created a list with ${items.length} items. The list ID is "${id}". You can now use this ID with run_shell_across_list or run_agent_across_list to process each item in parallel. The commands will run in the background and stream output to files. After starting the commands, you should sleep briefly and then read the output files to check results.`,
    			},
    		],
    	};
    },
  • The input schema for the 'create_list' tool, defining 'items' as an array of strings.
    inputSchema: {
    	items: z
    		.array(z.string())
    		.describe(
    			"Array of items to store in the list. Each item can be a file path, URL, identifier, or any string that will be substituted into commands or prompts.",
    		),
    },
  • src/index.ts:148-183 (registration)
    The registration of the 'create_list' tool using server.registerTool, including description, input schema, and handler function.
    server.registerTool(
    	"create_list",
    	{
    		description: `Creates a named list of items for parallel processing. Use this tool when you need to perform the same operation across multiple files, URLs, or any collection of items.
    
    WHEN TO USE:
    - Before running shell commands or AI agents across multiple items
    - When you have a collection of file paths, URLs, identifiers, or any strings to process in parallel
    
    WORKFLOW:
    1. Call create_list with your array of items
    2. Use the returned list_id with run_shell_across_list or run_agent_across_list
    3. The list persists for the duration of the session
    
    EXAMPLE: To process files ["src/a.ts", "src/b.ts", "src/c.ts"], first create a list, then use run_shell_across_list or run_agent_across_list with the returned id.`,
    		inputSchema: {
    			items: z
    				.array(z.string())
    				.describe(
    					"Array of items to store in the list. Each item can be a file path, URL, identifier, or any string that will be substituted into commands or prompts.",
    				),
    		},
    	},
    	async ({ items }) => {
    		const id = generateListId();
    		lists.set(id, items);
    		return {
    			content: [
    				{
    					type: "text",
    					text: `Successfully created a list with ${items.length} items. The list ID is "${id}". You can now use this ID with run_shell_across_list or run_agent_across_list to process each item in parallel. The commands will run in the background and stream output to files. After starting the commands, you should sleep briefly and then read the output files to check results.`,
    				},
    			],
    		};
    	},
    );
  • Helper function generateListId() that creates a unique ID for lists using diceware passphrases, ensuring no collisions with existing lists.
    function generateListId(): string {
    	const words = generatePassphrase(3);
    	let id = words.join("-");
    
    	// Ensure uniqueness by appending more words if needed
    	while (lists.has(id)) {
    		const extraWord = generatePassphrase(1)[0];
    		id = `${id}-${extraWord}`;
    	}
    
    	return id;
    }
  • Global Map 'lists' that stores all created lists by their ID, used by create_list and related tools.
    const lists = new Map<string, string[]>();
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It effectively describes key behaviors: the list persists for the session duration, items can be file paths, URLs, identifiers, or strings, and the workflow involves using the returned list_id with other tools. However, it doesn't mention potential errors, rate limits, or specific constraints beyond persistence.

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

Conciseness4/5

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

The description is well-structured with clear sections (purpose, usage, workflow, example) and front-loaded key information. It's appropriately sized, but the example section is somewhat detailed, which slightly reduces conciseness while adding clarity.

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?

Given no annotations, 100% schema coverage, no output schema, and moderate complexity, the description is mostly complete. It covers purpose, usage, workflow, and parameters well, but lacks details on error handling or output specifics (e.g., format of list_id), which would enhance completeness for a tool with no 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 input schema has 100% description coverage, so the baseline is 3. The description adds value by elaborating on the 'items' parameter semantics: it specifies that items can be 'file paths, URLs, identifiers, or any strings' and explains their purpose ('substituted into commands or prompts'), providing context beyond the schema's basic description.

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: 'Creates a named list of items for parallel processing.' It specifies the verb ('creates'), resource ('named list of items'), and distinguishes from siblings by focusing on creation rather than deletion, retrieval, or usage of lists.

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 description explicitly provides usage guidelines with a 'WHEN TO USE' section, listing specific scenarios like before running shell commands or AI agents across multiple items. It also references sibling tools (run_shell_across_list, run_agent_across_list) as alternatives for subsequent steps, clearly differentiating when to use this tool versus others.

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