Skip to main content
Glama

create_list

Create named lists of items like files or URLs for parallel processing with shell commands or AI agents across multiple items simultaneously.

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 that executes the create_list tool: generates a unique ID, stores the items array in the global 'lists' Map, and returns a success message containing 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.`, }, ], }; },
  • Zod input schema for the create_list tool defining the 'items' parameter 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:161-196 (registration)
    Full registration of the 'create_list' tool using server.registerTool, including name, metadata (description and 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 to generate unique list IDs using EFF 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 that stores all created lists, mapping list ID (string) to array of items (string[]). Used by create_list and 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