Skip to main content
Glama
microcmsio

microCMS MCP Server

by microcmsio

microcms_create_contents_bulk_published

Create and publish multiple contents in microCMS simultaneously, processing sequentially with individual success/failure reporting for each content item.

Instructions

Create multiple contents in microCMS at once. This tool processes contents sequentially and continues even if some fail. Results include success/failure status for each content.

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")
contentsYesArray of contents to create

Implementation Reference

  • Core handler logic for bulk creating published contents. Loops through contents array, calls the create function for each (with isDraft=false), handles errors individually, and returns aggregated results with success/failure counts.
    async function handleBulkCreate(
      params: BulkToolParameters,
      isDraft: boolean
    ): Promise<BulkCreateResult> {
      const { endpoint, contents } = params;
    
      if (!contents || !Array.isArray(contents) || contents.length === 0) {
        throw new Error('contents array is required and must not be empty');
      }
    
      const results: BulkCreateResult['results'] = [];
      let successCount = 0;
      let failureCount = 0;
    
      for (let i = 0; i < contents.length; i++) {
        const item = contents[i];
    
        try {
          const createOptions: { isDraft: boolean; contentId?: string } = {
            isDraft,
          };
    
          if (item.contentId) {
            createOptions.contentId = item.contentId;
          }
    
          const result = await create(endpoint, item.content, createOptions);
    
          results.push({
            index: i,
            success: true,
            id: result.id,
          });
          successCount++;
        } catch (error) {
          const errorMessage = error instanceof Error ? error.message : String(error);
          results.push({
            index: i,
            success: false,
            error: errorMessage,
          });
          failureCount++;
        }
      }
    
      return {
        totalCount: contents.length,
        successCount,
        failureCount,
        results,
      };
    }
  • Top-level exported handler function called by the server dispatcher for 'microcms_create_contents_bulk_published' tool.
    export async function handleCreateContentsBulkPublished(
      params: BulkToolParameters
    ): Promise<BulkCreateResult> {
      return handleBulkCreate(params, false);
    }
  • Tool definition including name, description, and input schema for validating bulk create requests.
    export const createContentsBulkPublishedTool: Tool = {
      name: 'microcms_create_contents_bulk_published',
      description: BULK_DESCRIPTION,
      inputSchema: {
        type: 'object',
        properties: {
          endpoint: {
            type: 'string',
            description: 'Content type name (e.g., "blogs", "news")',
          },
          contents: {
            type: 'array',
            description: 'Array of contents to create',
            items: {
              type: 'object',
              properties: {
                content: {
                  type: 'object',
                  description: 'Content data to create (JSON object)',
                },
                contentId: {
                  type: 'string',
                  description: 'Specific content ID to assign (optional)',
                },
              },
              required: ['content'],
            },
          },
        },
        required: ['endpoint', 'contents'],
      },
    };
  • src/server.ts:47-72 (registration)
    Registration of all tools with the MCP server, including createContentsBulkPublishedTool in the list returned for ListToolsRequest.
    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:27-31 (registration)
    Import of the tool schema and handler functions from the implementation file.
      createContentsBulkPublishedTool,
      createContentsBulkDraftTool,
      handleCreateContentsBulkPublished,
      handleCreateContentsBulkDraft,
    } from './tools/create-contents-bulk.js';
  • Server dispatcher switch case that invokes the tool handler.
    case 'microcms_create_contents_bulk_published':
      result = await handleCreateContentsBulkPublished(params as unknown as BulkToolParameters);
      break;
Behavior4/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It does well by stating that the tool 'processes contents sequentially and continues even if some fail' and 'Results include success/failure status for each content.' It also provides important behavioral context about field handling requirements and the need to use microcms_get_list for iframe fields. However, it doesn't mention rate limits, authentication requirements, or error handling specifics.

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 verbose and poorly structured with redundant information. It repeats 'Create new content in microCMS and publish it immediately' after already stating the purpose, and includes extensive field specifications that could be referenced elsewhere. The formatting with markdown headers and code blocks adds visual complexity without proportional informational value. Many sentences don't earn their place in a tool description.

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 mutation tool with no annotations and no output schema, the description provides substantial context about behavior (sequential processing, partial failures), field requirements, and important constraints for custom/iframe fields. It addresses the complexity of creating multiple published contents with specific data structure requirements. The main gap is the lack of information about return values or error formats.

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?

The input schema has 100% description coverage, so the schema already documents both parameters (endpoint and contents array). The description doesn't add any specific parameter semantics beyond what's in the schema - it focuses on content structure requirements rather than explaining the endpoint or contents parameters. This meets the baseline expectation when schema coverage is complete.

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

Purpose4/5

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

The description clearly states the tool's purpose: 'Create multiple contents in microCMS at once' and 'Create new content in microCMS and publish it immediately.' This specifies the verb (create multiple contents) and resource (microCMS content) with the important detail of immediate publication. However, it doesn't explicitly distinguish this bulk creation tool from its sibling microcms_create_contents_bulk_draft, which would require a 5.

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 description implies usage through field type specifications and important notes about custom/iframe fields, suggesting this tool should be used when creating multiple published contents. However, it doesn't explicitly state when to use this tool versus alternatives like microcms_create_content_published (single content) or microcms_create_contents_bulk_draft (bulk draft creation), nor does it mention prerequisites or exclusions.

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