delete_entry
Removes a specific entry from the content management system by specifying its UID and content type UID. Simplifies data cleanup and management in contentstack-mcp.
Instructions
Deletes an entry identified by its UID and content type UID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| content_type_uid | Yes | Content type UID | |
| entry_uid | Yes | Entry UID to delete |
Implementation Reference
- src/index.ts:669-694 (handler)The handler function that executes the tool logic: sends a DELETE request to the Contentstack API to delete the specified entry and returns success/error messages.async ({ content_type_uid, entry_uid }) => { try { const response = await axios.delete(`${API_BASE_URL}/content_types/${content_type_uid}/entries/${entry_uid}`, { headers: getHeaders(), }) return { content: [ { type: 'text', text: `Entry "${entry_uid}" deleted successfully from content type "${content_type_uid}".`, }, ], } } catch (error) { return { content: [ { type: 'text', text: handleError(error as ApiError), }, ], isError: true, } } },
- src/index.ts:665-668 (schema)Zod input schema defining the parameters: content_type_uid (string) and entry_uid (string).{ content_type_uid: z.string().describe('Content type UID'), entry_uid: z.string().describe('Entry UID to delete'), },
- src/index.ts:662-695 (registration)The server.tool call that registers the 'delete_entry' tool with name, description, input schema, and handler function.server.tool( 'delete_entry', 'Deletes an entry identified by its UID and content type UID.', { content_type_uid: z.string().describe('Content type UID'), entry_uid: z.string().describe('Entry UID to delete'), }, async ({ content_type_uid, entry_uid }) => { try { const response = await axios.delete(`${API_BASE_URL}/content_types/${content_type_uid}/entries/${entry_uid}`, { headers: getHeaders(), }) return { content: [ { type: 'text', text: `Entry "${entry_uid}" deleted successfully from content type "${content_type_uid}".`, }, ], } } catch (error) { return { content: [ { type: 'text', text: handleError(error as ApiError), }, ], isError: true, } } }, )