Skip to main content
Glama

update_list

Modify existing lists by replacing items with new arrays to add, remove, or reorder content in the par5-mcp server.

Instructions

Updates an existing list by replacing its items with a new array.

WHEN TO USE:

  • To modify the contents of an existing list

  • To add or remove items from a list

  • To reorder items in a list

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
list_idYesThe list ID returned by create_list.
itemsYesThe new array of items to replace the existing list contents.

Implementation Reference

  • Handler function for the 'update_list' tool. Checks if the list exists, updates the items in the shared 'lists' Map, and returns a success message with old and new item counts.
    async ({ list_id, items }) => {
    	if (!lists.has(list_id)) {
    		return {
    			content: [
    				{
    					type: "text",
    					text: `Error: No list found with ID "${list_id}". The list may have been deleted or the ID is incorrect. Use create_list to create a new list.`,
    				},
    			],
    			isError: true,
    		};
    	}
    
    	const oldCount = lists.get(list_id)?.length;
    	lists.set(list_id, items);
    
    	return {
    		content: [
    			{
    				type: "text",
    				text: `Successfully updated list "${list_id}". Changed from ${oldCount} items to ${items.length} items.`,
    			},
    		],
    	};
    },
  • Zod inputSchema for 'update_list' tool defining parameters: list_id (string) and items (array of strings).
    inputSchema: {
    	list_id: z.string().describe("The list ID returned by create_list."),
    	items: z
    		.array(z.string())
    		.describe(
    			"The new array of items to replace the existing list contents.",
    		),
    },
  • src/index.ts:339-382 (registration)
    server.registerTool call registering the 'update_list' tool with its metadata (description and inputSchema) and handler function.
    server.registerTool(
    	"update_list",
    	{
    		description: `Updates an existing list by replacing its items with a new array.
    
    WHEN TO USE:
    - To modify the contents of an existing list
    - To add or remove items from a list
    - To reorder items in a list`,
    		inputSchema: {
    			list_id: z.string().describe("The list ID returned by create_list."),
    			items: z
    				.array(z.string())
    				.describe(
    					"The new array of items to replace the existing list contents.",
    				),
    		},
    	},
    	async ({ list_id, items }) => {
    		if (!lists.has(list_id)) {
    			return {
    				content: [
    					{
    						type: "text",
    						text: `Error: No list found with ID "${list_id}". The list may have been deleted or the ID is incorrect. Use create_list to create a new list.`,
    					},
    				],
    				isError: true,
    			};
    		}
    
    		const oldCount = lists.get(list_id)?.length;
    		lists.set(list_id, items);
    
    		return {
    			content: [
    				{
    					type: "text",
    					text: `Successfully updated list "${list_id}". Changed from ${oldCount} items to ${items.length} items.`,
    				},
    			],
    		};
    	},
    );
  • Shared 'lists' Map<string, string[]> used by update_list (and other list tools) to store list items by ID.
    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 the full burden. It discloses that this is a mutation tool ('updates,' 'replacing'), which implies it modifies data. However, it lacks details on behavioral traits like permissions needed, whether changes are reversible, error handling, or rate limits. The description adds some value by clarifying the replacement behavior but doesn't fully compensate for the lack of annotations.

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 appropriately sized and front-loaded: the first sentence states the core purpose, followed by a bulleted 'WHEN TO USE' section. Each sentence earns its place by providing clear guidance. However, the bullet points could be slightly more concise, and there's minor redundancy (e.g., 'modify the contents' overlaps with 'add or remove items'), preventing a perfect 5.

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

Completeness3/5

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

Given the complexity (a mutation tool with no annotations and no output schema), the description is somewhat complete but has gaps. It explains the purpose and usage well, but lacks details on behavioral aspects like side effects, return values, or error conditions. With no output schema, it doesn't describe what the tool returns, which is a significant omission for a mutation operation.

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

Parameters3/5

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

Schema description coverage is 100%, with clear descriptions for both parameters: 'list_id' as 'The list ID returned by create_list' and 'items' as 'The new array of items to replace the existing list contents.' The description doesn't add meaning beyond this, as it only mentions 'replacing its items with a new array,' which aligns with the schema. With high coverage, the baseline is 3, and the description doesn't enhance it further.

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

Purpose4/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: 'Updates an existing list by replacing its items with a new array.' This specifies the verb ('updates'), resource ('existing list'), and scope ('replacing its items with a new array'). However, it doesn't explicitly differentiate from siblings like 'create_list' or 'delete_list' beyond the 'existing list' qualifier, which is why it doesn't reach a perfect 5.

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

Usage Guidelines4/5

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

The 'WHEN TO USE' section provides clear context: 'To modify the contents of an existing list,' 'To add or remove items from a list,' and 'To reorder items in a list.' This gives explicit guidance on when to use this tool. However, it doesn't mention when not to use it or name alternatives (e.g., using 'create_list' for new lists instead), so it falls short of a 5.

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