microcms_delete_content
Delete specific content from microCMS by specifying the content type (e.g., blogs, news) and content ID using the MCP server for efficient content management.
Instructions
Delete content from microCMS
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contentId | Yes | Content ID to delete | |
| endpoint | Yes | Content type name (e.g., "blogs", "news") |
Implementation Reference
- src/tools/delete-content.ts:24-33 (handler)The handler function that executes the core logic of the microcms_delete_content tool: validates input and delegates to the deleteContent helper.export async function handleDeleteContent(params: ToolParameters) { const { endpoint, contentId } = params; if (!contentId) { throw new Error('contentId is required'); } await deleteContent(endpoint, contentId); return { message: `Content ${contentId} deleted successfully` }; }
- src/tools/delete-content.ts:5-22 (schema)The tool object defining the schema and metadata for microcms_delete_content.export const deleteContentTool: Tool = { name: 'microcms_delete_content', description: 'Delete content from microCMS', inputSchema: { type: 'object', properties: { endpoint: { type: 'string', description: 'Content type name (e.g., "blogs", "news")', }, contentId: { type: 'string', description: 'Content ID to delete', }, }, required: ['endpoint', 'contentId'], }, };
- src/server.ts:107-109 (registration)Registration in the server switch statement: dispatches tool calls to the handleDeleteContent function.case 'microcms_delete_content': result = await handleDeleteContent(params); break;
- src/server.ts:55-55 (registration)The tool is included in the list returned by ListToolsRequestHandler.deleteContentTool,
- src/client.ts:84-92 (helper)Supporting function that calls the microCMS client to delete the content.export async function deleteContent( endpoint: string, contentId: string ): Promise<void> { return await microCMSClient.delete({ endpoint, contentId, }); }