Skip to main content
Glama

microcms_delete_content

Delete content from microCMS by specifying the content type and content ID to remove specific items from your CMS database.

Instructions

Delete content from microCMS

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointYesContent type name (e.g., "blogs", "news")
contentIdYesContent ID to delete

Implementation Reference

  • The main handler function that executes the tool logic: validates input and calls the deleteContent helper from client.ts.
    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` }; }
  • Tool definition with name, description, and input schema for parameter validation.
    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:121-123 (registration)
    Registration in the server CallToolRequest handler: switch case dispatches to the tool handler.
    case 'microcms_delete_content': result = await handleDeleteContent(params); break;
  • src/server.ts:49-72 (registration)
    Registration in ListToolsRequest handler: deleteContentTool is included in the tools list (line 63).
    tools: [ getListTool, getListMetaTool, getContentTool, getContentMetaTool, createContentPublishedTool, createContentDraftTool, createContentsBulkPublishedTool, createContentsBulkDraftTool, updateContentPublishedTool, updateContentDraftTool, patchContentTool, patchContentStatusTool, patchContentCreatedByTool, deleteContentTool, getMediaTool, uploadMediaTool, deleteMediaTool, getApiInfoTool, getApiListTool, getMemberTool, ], }; });
  • Supporting utility that performs the actual microCMS API deletion call using the SDK client.
    export async function deleteContent( endpoint: string, contentId: string ): Promise<void> { return await microCMSClient.delete({ endpoint, contentId, }); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/microcmsio/microcms-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server