Skip to main content
Glama
microcmsio

microCMS MCP Server

by microcmsio

microcms_patch_content_status

Update content publication status in microCMS between published and draft states for specific content items using the Management API.

Instructions

Change content publication status in microCMS (Management API). Can change status between PUBLISH (published) and DRAFT (draft). Note: Only transitions between "published" and "draft" are supported.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointYesContent type name (e.g., "blogs", "news")
contentIdYesContent ID to change status
statusYesTarget status: "PUBLISH" to publish content, "DRAFT" to set as draft

Implementation Reference

  • The main handler function that executes the tool logic: validates parameters (endpoint, contentId, status) and calls the client-side patchContentStatus function.
    export async function handlePatchContentStatus(
      params: ToolParameters & { status: 'PUBLISH' | 'DRAFT' }
    ) {
      const { endpoint, contentId, status } = params;
    
      if (!endpoint) {
        throw new Error('endpoint is required');
      }
    
      if (!contentId) {
        throw new Error('contentId is required');
      }
    
      if (!status || (status !== 'PUBLISH' && status !== 'DRAFT')) {
        throw new Error('status must be either "PUBLISH" or "DRAFT"');
      }
    
      await patchContentStatus(endpoint, contentId, status);
      return { message: `Content ${contentId} status changed to ${status}` };
    }
  • Tool object definition including name, description, and input schema for parameter validation.
    export const patchContentStatusTool: Tool = {
      name: 'microcms_patch_content_status',
      description: 'Change content publication status in microCMS (Management API). Can change status between PUBLISH (published) and DRAFT (draft). Note: Only transitions between "published" and "draft" are supported.',
      inputSchema: {
        type: 'object',
        properties: {
          endpoint: {
            type: 'string',
            description: 'Content type name (e.g., "blogs", "news")',
          },
          contentId: {
            type: 'string',
            description: 'Content ID to change status',
          },
          status: {
            type: 'string',
            enum: ['PUBLISH', 'DRAFT'],
            description: 'Target status: "PUBLISH" to publish content, "DRAFT" to set as draft',
          },
        },
        required: ['endpoint', 'contentId', 'status'],
      },
    };
  • src/server.ts:47-72 (registration)
    Registers the patchContentStatusTool in the server's list of available tools via ListToolsRequestSchema handler.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: [
          getListTool,
          getListMetaTool,
          getContentTool,
          getContentMetaTool,
          createContentPublishedTool,
          createContentDraftTool,
          createContentsBulkPublishedTool,
          createContentsBulkDraftTool,
          updateContentPublishedTool,
          updateContentDraftTool,
          patchContentTool,
          patchContentStatusTool,
          patchContentCreatedByTool,
          deleteContentTool,
          getMediaTool,
          uploadMediaTool,
          deleteMediaTool,
          getApiInfoTool,
          getApiListTool,
          getMemberTool,
        ],
      };
    });
  • src/server.ts:115-117 (registration)
    Dispatches the tool call to the handlePatchContentStatus handler in the CallToolRequestSchema switch statement.
    case 'microcms_patch_content_status':
      result = await handlePatchContentStatus(params as ToolParameters & { status: 'PUBLISH' | 'DRAFT' });
      break;
  • Underlying client helper that performs the actual PATCH request to the microCMS Management API to update the content status.
    export async function patchContentStatus(
      endpoint: string,
      contentId: string,
      status: 'PUBLISH' | 'DRAFT'
    ): Promise<void> {
      const url = `https://${config.serviceDomain}.microcms-management.io/api/v1/contents/${endpoint}/${contentId}/status`;
    
      const response = await fetch(url, {
        method: 'PATCH',
        headers: {
          'X-MICROCMS-API-KEY': config.apiKey,
          'Content-Type': 'application/json',
        },
        body: JSON.stringify({ status: [status] }),
      });
    
      if (!response.ok) {
        const errorText = await response.text();
        throw new Error(`Failed to patch content status: ${response.status} ${response.statusText} - ${errorText}`);
      }
    }
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden. It discloses the mutation behavior ('Change content publication status') and constraint ('Only transitions between "published" and "draft" are supported'), which is helpful. However, it lacks details about permissions required, rate limits, error conditions, or what happens to content during transitions - important gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences with zero waste. The first sentence establishes the core purpose, and the second adds crucial constraint information. Every word earns its place in this well-structured description.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a mutation tool with no annotations and no output schema, the description provides adequate basic information but has significant gaps. It covers what the tool does and its constraints, but lacks details about authentication requirements, error handling, return values, or side effects - important context for a status-changing operation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, providing complete parameter documentation. The description adds minimal value beyond the schema - it mentions the status parameter's purpose but doesn't provide additional context about endpoint or contentId parameters. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the specific action ('Change content publication status'), target system ('microCMS Management API'), and scope ('between PUBLISH and DRAFT'). It distinguishes this tool from siblings like microcms_patch_content (general patching) and microcms_update_content_draft/published (specific status updates).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides clear context about when to use this tool ('Only transitions between "published" and "draft" are supported'), which helps differentiate it from create/update/delete siblings. However, it doesn't explicitly state when NOT to use it or mention direct alternatives like microcms_update_content_draft/published for more specific operations.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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