Skip to main content
Glama

microcms_patch_content

Update specific fields of microCMS content using JSON data. Supports text, rich editor, images, dates, select fields, and content references. Ideal for targeted edits without overwriting entire entries.

Instructions

Partially update content in microCMS (PATCH). 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
contentYesPartial content 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")
isDraftNoSave as draft

Implementation Reference

  • Handler function that destructures parameters, validates required fields, sets update options, and calls the patch function from the client.
    export async function handlePatchContent(params: ToolParameters) { const { endpoint, contentId, content, ...options } = params; if (!contentId) { throw new Error('contentId is required'); } if (!content) { throw new Error('content is required'); } const updateOptions: MicroCMSUpdateOptions = {}; if (options.isDraft !== undefined) updateOptions.isDraft = options.isDraft; return await patch(endpoint, contentId, content, updateOptions); }
  • Tool definition including name, description, and input schema for parameter validation.
    export const patchContentTool: Tool = { name: 'microcms_patch_content', 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: `Partial content data to update (JSON object). ` + FIELD_FORMATS_DESCRIPTION, }, isDraft: { type: 'boolean', description: 'Save as draft', }, }, required: ['endpoint', 'contentId', 'content'], }, };
  • src/server.ts:52-52 (registration)
    The tool is included in the list of tools returned by the ListToolsRequestHandler.
    patchContentTool,
  • src/server.ts:98-100 (registration)
    Switch case in CallToolRequestHandler that dispatches to the tool handler.
    case 'microcms_patch_content': result = await handlePatchContent(params); break;

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