Skip to main content
Glama

microcms_update_content_published

Update and publish content in microCMS in one step. Specify content type, ID, and data in JSON format, ensuring correct field types (e.g., URLs for images, HTML for rich editor, ISO 8601 for dates, arrays for multiple items).

Instructions

Update content in microCMS (PUT - full update) and publish it immediately. Field type specifications: Image fields require URLs from the same microCMS service (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.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
contentYesContent data to update (JSON object). Field formats: text="string", richEditor="<h1>HTML</h1>", image="https://images.microcms-assets.io/...", multipleImages=["url1","url2"], date="2020-04-23T14:32:38.163Z", select=["option1","option2"], contentReference="contentId" or ["id1","id2"].
contentIdYesContent ID to update
endpointYesContent type name (e.g., "blogs", "news")

Implementation Reference

  • The handler function that executes the tool logic: validates parameters (endpoint, contentId, content), sets published options (isDraft: false), and invokes the update client function.
    export async function handleUpdateContentPublished(params: ToolParameters) { const { endpoint, contentId, content } = params; if (!contentId) { throw new Error('contentId is required'); } if (!content) { throw new Error('content is required'); } const updateOptions: MicroCMSUpdateOptions = { isDraft: false, // Always publish }; return await update(endpoint, contentId, content, updateOptions); }
  • Tool schema definition including name, description, and inputSchema specifying required properties: endpoint, contentId, content.
    export const updateContentPublishedTool: Tool = { name: 'microcms_update_content_published', description: FIELD_FORMATS_DESCRIPTION, inputSchema: { type: 'object', properties: { endpoint: { type: 'string', description: 'Content type name (e.g., "blogs", "news")', }, contentId: { type: 'string', description: 'Content ID to update', }, content: { type: 'object', description: `Content data to update (JSON object). ` + FIELD_FORMATS_DESCRIPTION, }, }, required: ['endpoint', 'contentId', 'content'], }, };
  • src/server.ts:92-94 (registration)
    Server switch case that registers and dispatches the tool name to its handler function.
    case 'microcms_update_content_published': result = await handleUpdateContentPublished(params); break;
  • src/server.ts:50-50 (registration)
    Registration of the tool in the listTools response array.
    updateContentPublishedTool,
  • src/server.ts:14-14 (registration)
    Import of the tool definition and handler from the tools file.
    import { updateContentPublishedTool, handleUpdateContentPublished } from './tools/update-content-published.js';

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