Skip to main content
Glama
microcmsio

microCMS MCP Server

by microcmsio

microcms_patch_content_status

Change content publication status between published and draft. Transition content to PUBLISH for publishing or DRAFT for draft.

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
serviceIdNoService ID (required in multi-service mode, optional in single-service mode)
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

  • src/server.ts:52-55 (registration)
    Import of handlePatchContentStatus and patchContentStatusTool into the server module.
    import {
      handlePatchContentStatus,
      patchContentStatusTool,
    } from './tools/patch-content-status.js';
  • src/server.ts:81-81 (registration)
    Registration of patchContentStatusTool in the tools array for the server.
    patchContentStatusTool,
  • src/server.ts:122-122 (registration)
    Maps the tool name 'microcms_patch_content_status' to the handler function handlePatchContentStatus.
    microcms_patch_content_status: handlePatchContentStatus,
  • Tool definition with name 'microcms_patch_content_status', description, and inputSchema (serviceId, endpoint, contentId, status with enum 'PUBLISH'/'DRAFT').
    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: {
          serviceId: {
            type: 'string',
            description:
              'Service ID (required in multi-service mode, optional in single-service mode)',
          },
          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'],
      },
    };
  • Handler function that validates endpoint/contentId/status and calls patchContentStatus client function.
    export async function handlePatchContentStatus(
      params: ToolParameters & { status: 'PUBLISH' | 'DRAFT' },
      serviceId?: string
    ) {
      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, serviceId);
      return { message: `Content ${contentId} status changed to ${status}` };
    }
  • Client helper function that sends a PATCH request to the microCMS Management API to change content publication status.
    export async function patchContentStatus(
      endpoint: string,
      contentId: string,
      status: 'PUBLISH' | 'DRAFT',
      serviceId?: string
    ): Promise<void> {
      const clients = getClientsForService(serviceId);
      const url = `https://${clients.serviceDomain}.microcms-management.io/api/v1/contents/${endpoint}/${contentId}/status`;
    
      const response = await fetch(url, {
        method: 'PATCH',
        headers: {
          'X-MICROCMS-API-KEY': clients.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}`
        );
      }
    }
Behavior2/5

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

No annotations are provided, so description carries full burden. It mentions only valid status transitions (PUBLISH/DRAFT) but omits side effects, permissions, or what happens to content after status change (e.g., response or state confirmation).

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 sentences: first states purpose, second adds a key constraint. No wasted words, front-loaded with primary action.

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

Completeness2/5

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

Lacks details on prerequisites (e.g., content must exist), expected response, or valid transition sequences. The note is ambiguous about whether transitions like PUBLISH->PUBLISH are allowed. Incomplete for a mutation tool with no annotations.

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 coverage is 100%, so baseline is 3. Description adds the constraint of supported transitions, which aligns with the enum but does not provide new parameter details beyond what schema descriptions already offer.

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?

Description clearly states the tool changes publication status between PUBLISH and DRAFT, using a specific verb ('Change') and resource ('content publication status'). It distinguishes from sibling tools like microcms_create_content_draft which create new content rather than status.

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

Usage Guidelines3/5

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

The note about supported transitions provides context but does not explicitly advise when to use this tool over alternatives like microcms_patch_content or update_content_draft. No when-not-to-use guidance is given.

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