Skip to main content
Glama
microcmsio

microCMS MCP Server

by microcmsio

microcms_create_content_published

Create and publish content in microCMS with immediate availability. Submit properly structured JSON data following field specifications for images, rich text, dates, references, and custom fields.

Instructions

Create new content in microCMS and publish it immediately.

Important

Ensure that the "content" you submit strictly adheres to the following specifications. In particular, take extra care when handling custom fields and iframe fields, as mistakes are common in their structure. Read the instructions thoroughly and construct the data precisely as described. In particular, for extended fields (iframe fields), you need to take care to call microcms_get_list tool beforehand, and set its structure to the "data" field (Detail is described below).

Field type specifications

  • Image fields require URL string uploaded to microCMS media library (e.g., "https://images.microcms-assets.io/assets/xxx/yyy/sample.png").

  • Multiple image fields use array format.

  • Rich editor fields expect HTML strings.

  • Date fields use ISO 8601 format.

  • Select fields use arrays.

  • Content reference fields use contentId strings or arrays for multiple references, and you can get contentIds from microcms_get_list tool.

  • Custom field exepect below struct:

<field Id in apiFields> {
  "fieldId": "<target custom field id in customFields>"
  "key1": "<value1>",
  "key2": "<value2>",
}
  • iframe field (Extension field) expects the following structure for CREATE/UPDATE:

  {
    "id": "some-id",
    "title": "some-title",
    "description": "some-description",
    "imageUrl": "https://images.microcms-assets.io/assets/xxxx/yyyy/{fileName}.png",
    "updatedAt": "2024-01-01T00:00:00Z",
    "data": { "key1": "value1", "key2": "value2" }
  }
  • IMPORTANT: When retrieving content via API, only the "data" object content is returned (without the wrapper).

  • IMPORTANT: When creating/updating content, you MUST provide the full structure including id, title, description, imageUrl, updatedAt, and data.

  • To understand the "data" structure, ALWAYS use microcms_get_list to retrieve existing content first and examine the field structure.

  • "id", "title", "description", "imageUrl" are metadata displayed in the admin screen and are not included in the API GET response.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
endpointYesContent type name (e.g., "blogs", "news")
contentYesContent data to create (JSON object). Create new content in microCMS and publish it immediately. ## Important Ensure that the "content" you submit strictly adheres to the following specifications. In particular, take extra care when handling custom fields and iframe fields, as mistakes are common in their structure. Read the instructions thoroughly and construct the data precisely as described. In particular, for extended fields (iframe fields), you need to take care to call microcms_get_list tool beforehand, and set its structure to the "data" field (Detail is described below). ## Field type specifications * Image fields require URL string uploaded to microCMS media library (e.g., "https://images.microcms-assets.io/assets/xxx/yyy/sample.png"). * Multiple image fields use array format. * Rich editor fields expect HTML strings. * Date fields use ISO 8601 format. * Select fields use arrays. * Content reference fields use contentId strings or arrays for multiple references, and you can get contentIds from microcms_get_list tool. * Custom field exepect below struct: ```json <field Id in apiFields> { "fieldId": "<target custom field id in customFields>" "key1": "<value1>", "key2": "<value2>", } ``` * iframe field (Extension field) expects the following structure for CREATE/UPDATE: ```json { "id": "some-id", "title": "some-title", "description": "some-description", "imageUrl": "https://images.microcms-assets.io/assets/xxxx/yyyy/{fileName}.png", "updatedAt": "2024-01-01T00:00:00Z", "data": { "key1": "value1", "key2": "value2" } } ``` * **IMPORTANT**: When retrieving content via API, only the "data" object content is returned (without the wrapper). * **IMPORTANT**: When creating/updating content, you MUST provide the full structure including id, title, description, imageUrl, updatedAt, and data. * To understand the "data" structure, ALWAYS use microcms_get_list to retrieve existing content first and examine the field structure. * "id", "title", "description", "imageUrl" are metadata displayed in the admin screen and are not included in the API GET response.
contentIdNoSpecific content ID to assign

Implementation Reference

  • The primary handler function for the 'microcms_create_content_published' tool. It validates input, sets isDraft to false for published content, and delegates to the generic create function in client.ts.
    export async function handleCreateContentPublished(params: ToolParameters) {
      const { endpoint, content, ...options } = params;
    
      if (!content) {
        throw new Error('content is required');
      }
    
      const createOptions: MicroCMSCreateOptions = {
        isDraft: false, // Always publish
      };
    
      if (options.contentId) createOptions.contentId = options.contentId;
    
      return await create(endpoint, content, createOptions);
    }
  • Tool definition including the name 'microcms_create_content_published', description, and input schema for parameters: endpoint, content, optional contentId.
    export const createContentPublishedTool: Tool = {
      name: 'microcms_create_content_published',
      description: FIELD_FORMATS_DESCRIPTION,
      inputSchema: {
        type: 'object',
        properties: {
          endpoint: {
            type: 'string',
            description: 'Content type name (e.g., "blogs", "news")',
          },
          content: {
            type: 'object',
            description: `Content data to create (JSON object). ` + FIELD_FORMATS_DESCRIPTION,
          },
          contentId: {
            type: 'string',
            description: 'Specific content ID to assign',
          },
        },
        required: ['endpoint', 'content'],
      },
    };
  • src/server.ts:12-12 (registration)
    Import statement registering the tool definition and handler function into the MCP server.
    import { createContentPublishedTool, handleCreateContentPublished } from './tools/create-content-published.js';
  • src/server.ts:94-96 (registration)
    Switch case in the server's CallToolRequestHandler that dispatches calls to this tool's handler function.
    case 'microcms_create_content_published':
      result = await handleCreateContentPublished(params);
      break;
  • src/server.ts:49-70 (registration)
    Inclusion of createContentPublishedTool in the server's list of available tools returned by ListToolsRequest.
    tools: [
      getListTool,
      getListMetaTool,
      getContentTool,
      getContentMetaTool,
      createContentPublishedTool,
      createContentDraftTool,
      createContentsBulkPublishedTool,
      createContentsBulkDraftTool,
      updateContentPublishedTool,
      updateContentDraftTool,
      patchContentTool,
      patchContentStatusTool,
      patchContentCreatedByTool,
      deleteContentTool,
      getMediaTool,
      uploadMediaTool,
      deleteMediaTool,
      getApiInfoTool,
      getApiListTool,
      getMemberTool,
    ],
  • Generic create helper function used by the tool handler, which wraps microCMSClient.create and supports isDraft option.
    export async function create<T = MicroCMSContent>(
      endpoint: string,
      content: Omit<T, 'id' | 'createdAt' | 'updatedAt' | 'publishedAt' | 'revisedAt'>,
      options?: { isDraft?: boolean; contentId?: string }
    ): Promise<{ id: string }> {
      return await microCMSClient.create({
        endpoint,
        content,
        ...options,
      });
    }
Behavior4/5

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

With no annotations provided, the description carries full burden and does an excellent job disclosing critical behavioral traits: it's a write operation that publishes immediately, requires careful data construction, has specific field type requirements, and mandates pre-retrieval of existing content for iframe fields. It warns about common mistakes and provides detailed structural requirements.

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

Conciseness2/5

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

The description is excessively long (over 500 words) with significant redundancy between the main description and the schema's parameter descriptions. While structured with headings, it repeats the same field specifications multiple times and includes verbose formatting examples that could be streamlined. The core purpose gets buried in technical details.

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

Completeness4/5

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

For a complex mutation tool with no annotations and no output schema, the description provides comprehensive behavioral guidance, field specifications, and warnings. It covers the critical aspects of data construction, common pitfalls, and prerequisite steps (using microcms_get_list). The main gap is the lack of information about return values or error conditions.

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%, so the schema already documents all three parameters thoroughly. The description adds extensive field-specific formatting guidance that applies to the 'content' parameter, but this is largely redundant with the schema's detailed description. The description doesn't add meaningful semantic context beyond what's already in the parameter descriptions.

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 ('Create new content') and resource ('in microCMS'), and explicitly distinguishes it from sibling tools by specifying 'publish it immediately' (vs. draft versions like microcms_create_content_draft). The verb+resource+scope combination is precise and unambiguous.

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 (for immediate publication) and implicitly distinguishes from draft creation tools. However, it doesn't explicitly state when NOT to use it or name specific alternatives among siblings, though the 'publish it immediately' phrasing strongly implies the distinction.

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