Skip to main content
Glama

delete_list

Remove an existing list by its ID to clean up unnecessary data and free up memory after processing is complete.

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
NameRequiredDescriptionDefault
list_idYesThe list ID returned by create_list.

Implementation Reference

  • Handler function that implements the delete_list tool logic: validates list existence, deletes the list from the 'lists' Map, and returns success/error messages.
    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.`,
    			},
    		],
    	};
    },
  • Tool metadata including description and input schema definition (list_id: string).
    	{
    		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."),
    		},
    	},
  • src/index.ts:385-422 (registration)
    Registration of the 'delete_list' tool with server.registerTool, including name, 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.`,
    				},
    			],
    		};
    	},
    );
Behavior3/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. It clearly indicates this is a destructive operation ('Deletes'), which is critical information. However, it lacks details on permissions required, whether deletion is reversible, error handling (e.g., what happens if the list doesn't exist), or confirmation prompts. The memory-freeing note adds some context but doesn't fully cover behavioral traits.

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 appropriately sized and front-loaded, with the core purpose stated first ('Deletes an existing list by its ID.'), followed by a structured 'WHEN TO USE' section. Every sentence earns its place by providing essential guidance without unnecessary details, making it highly efficient and easy to scan.

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 the tool's complexity (a destructive operation with no annotations and no output schema), the description is fairly complete. It covers the purpose, usage guidelines, and implies behavioral traits (destructive). However, it lacks details on return values, error cases, or side effects, which would be beneficial for a deletion tool. The high schema coverage helps compensate, but some gaps remain.

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, with the 'list_id' parameter well-documented as 'The list ID returned by create_list.' The description doesn't add any additional parameter semantics beyond what the schema provides, but with high schema coverage, the baseline is 3. The description's clarity about deletion purpose slightly enhances understanding, warranting a score of 4.

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 specific action ('Deletes') and resource ('an existing list by its ID'), making the purpose unambiguous. It distinguishes itself from siblings like 'create_list', 'get_list', and 'update_list' by focusing on deletion rather than creation, retrieval, or modification.

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 explicitly provides guidance on when to use this tool ('To clean up lists that are no longer needed' and 'To free up memory after processing is complete'). This helps differentiate it from alternatives like 'update_list' for modifications or 'list_all_lists' for viewing, though it doesn't explicitly name those alternatives.

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