delete_content_type
Remove a content type from the Contentstack MCP server by specifying its unique identifier (UID). Ensures clean content architecture and efficient management.
Instructions
Deletes a content type identified by its UID.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| uid | Yes | Content type UID to delete |
Implementation Reference
- src/index.ts:552-577 (handler)Handler function that performs the DELETE API request to delete the content type by UID from Contentstack and handles success/error responses.async ({ uid }) => { try { const response = await axios.delete(`${API_BASE_URL}/content_types/${uid}`, { headers: getHeaders(), }) return { content: [ { type: 'text', text: `Content type "${uid}" deleted successfully.`, }, ], } } catch (error) { return { content: [ { type: 'text', text: handleError(error as ApiError), }, ], isError: true, } } },
- src/index.ts:549-551 (schema)Zod input schema defining the 'uid' parameter for the content type to delete.{ uid: z.string().describe('Content type UID to delete'), },
- src/index.ts:546-578 (registration)MCP server.tool registration for the delete_content_type tool, including schema and handler.server.tool( 'delete_content_type', 'Deletes a content type identified by its UID.', { uid: z.string().describe('Content type UID to delete'), }, async ({ uid }) => { try { const response = await axios.delete(`${API_BASE_URL}/content_types/${uid}`, { headers: getHeaders(), }) return { content: [ { type: 'text', text: `Content type "${uid}" deleted successfully.`, }, ], } } catch (error) { return { content: [ { type: 'text', text: handleError(error as ApiError), }, ], isError: true, } } }, )