Delete a list
delete_listDelete a list from your Cozi account by providing its list ID. Returns true on success.
Instructions
Delete a list. Returns true on success.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| list_id | Yes |
Implementation Reference
- src/tools/lists.ts:43-45 (handler)The deleteListHandler function that executes the tool logic. Calls client.deleteList(listId) and returns a boolean.
export async function deleteListHandler(client: CoziClient, listId: string): Promise<boolean> { return client.deleteList(listId); } - src/tools/lists.ts:98-101 (schema)The input schema and description for the 'delete_list' tool. Schema uses Zod: { list_id: z.string() }.
{ title: 'Delete a list', description: 'Delete a list. Returns true on success.', inputSchema: { list_id: z.string() }, - src/tools/lists.ts:96-107 (registration)Registration of 'delete_list' tool via server.registerTool, with the handler that calls deleteListHandler.
server.registerTool( 'delete_list', { title: 'Delete a list', description: 'Delete a list. Returns true on success.', inputSchema: { list_id: z.string() }, }, async ({ list_id }) => { const result = await deleteListHandler(await getClient(), list_id); return { content: [{ type: 'text', text: JSON.stringify(result) }] }; }, ); - src/cozi/client.ts:139-146 (helper)The CoziClient.deleteList method which makes an HTTP DELETE request to /list/{listId} and returns true.
async deleteList(listId: string): Promise<boolean> { await this.ensureAuthenticated(); await this.http.request({ method: 'DELETE', endpoint: this.accountEndpoint(`/list/${listId}`), }); return true; } - src/tools/index.ts:23-23 (registration)The 'delete_list' entry in the TOOL_NAMES constant array, enumerating all tool names.
'delete_list',