delete_list
Remove lists you no longer need to free up memory and maintain organized data management in the par5-mcp server's parallel processing environment.
Instructions
Deletes an existing list by its ID.
WHEN TO USE:
To clean up lists that are no longer needed
To free up memory after processing is complete
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes | The list ID returned by create_list. |
Implementation Reference
- src/index.ts:398-435 (registration)Registers the delete_list tool with MCP server, including description, input schema, and inline handler function.server.registerTool( "delete_list", { description: `Deletes an existing list by its ID. WHEN TO USE: - To clean up lists that are no longer needed - To free up memory after processing is complete`, inputSchema: { list_id: z.string().describe("The list ID returned by create_list."), }, }, async ({ list_id }) => { if (!lists.has(list_id)) { return { content: [ { type: "text", text: `Error: No list found with ID "${list_id}". The list may have already been deleted or the ID is incorrect.`, }, ], isError: true, }; } const itemCount = lists.get(list_id)?.length; lists.delete(list_id); return { content: [ { type: "text", text: `Successfully deleted list "${list_id}" which contained ${itemCount} items.`, }, ], }; }, );
- src/index.ts:410-434 (handler)The handler function for delete_list: checks if list exists, deletes it from the global 'lists' Map, and returns success or error message.async ({ list_id }) => { if (!lists.has(list_id)) { return { content: [ { type: "text", text: `Error: No list found with ID "${list_id}". The list may have already been deleted or the ID is incorrect.`, }, ], isError: true, }; } const itemCount = lists.get(list_id)?.length; lists.delete(list_id); return { content: [ { type: "text", text: `Successfully deleted list "${list_id}" which contained ${itemCount} items.`, }, ], }; },
- src/index.ts:406-408 (schema)Zod input schema for delete_list tool, requiring a 'list_id' string.inputSchema: { list_id: z.string().describe("The list ID returned by create_list."), },
- src/index.ts:138-138 (helper)Global Map storing all created lists by ID, used by delete_list handler.const lists = new Map<string, string[]>();