Skip to main content
Glama
create-content-published.ts1.26 kB
import { Tool } from '@modelcontextprotocol/sdk/types.js'; import { create } from '../client.js'; import type { ToolParameters, MicroCMSCreateOptions } from '../types.js'; import { FIELD_FORMATS_DESCRIPTION } from '../constants.js'; 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'], }, }; 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); }

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