Delete Entry
delete_entrySoft-deletes a content entry by moving it to the trash, from which it can be restored via the admin panel.
Instructions
Soft-delete a content entry (moves to trash). Can be restored from the admin panel.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| collection_slug | Yes | The collection slug | |
| uuid | Yes | The entry UUID |
Implementation Reference
- src/tools/content.ts:175-180 (handler)The async callback that executes the delete_entry tool logic: calls client.delete() with the collection slug and entry UUID, then returns the result.
}, async ({ collection_slug, uuid }) => { const result = await client.delete(`/${collection_slug}/${uuid}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }); - src/tools/content.ts:171-174 (schema)Zod input schema for delete_entry defining 'collection_slug' and 'uuid' as required string parameters.
inputSchema: { collection_slug: z.string().describe("The collection slug"), uuid: z.string().describe("The entry UUID"), }, - src/tools/content.ts:167-180 (registration)Registration of the 'delete_entry' tool via server.registerTool, with title 'Delete Entry' and description explaining it's a soft-delete (moves to trash).
server.registerTool("delete_entry", { title: "Delete Entry", description: "Soft-delete a content entry (moves to trash). Can be restored from the admin panel.", inputSchema: { collection_slug: z.string().describe("The collection slug"), uuid: z.string().describe("The entry UUID"), }, }, async ({ collection_slug, uuid }) => { const result = await client.delete(`/${collection_slug}/${uuid}`); return { content: [{ type: "text", text: JSON.stringify(result, null, 2) }], }; }); - src/client.ts:134-142 (helper)The ElmapiClient.delete() method that performs the actual HTTP DELETE request to the API, used by the delete_entry tool.
async delete(path: string, body?: unknown): Promise<unknown> { const response = await fetch(`${this.baseUrl}${path}`, { method: "DELETE", headers: this.headers(), body: body ? JSON.stringify(body) : undefined, }); return this.handleResponse(response); }