Skip to main content
Glama

strapi_publish_blog_post

Publish or unpublish a blog post in Strapi CMS by specifying the document ID and desired publication status.

Instructions

Publish or unpublish a blog post

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYesBlog post document ID
publishNotrue to publish, false to unpublish

Implementation Reference

  • The core handler function that publishes or unpublishes a blog post by updating the 'publishedAt' field via a PUT request to the Strapi content manager API endpoint.
    async publishBlogPost (headers, args) { const data = { publishedAt: args.publish ? new Date().toISOString() : null } // Strapi 5 uses documentId for single document operations const response = await axios.put( `${this.strapiUrl}/content-manager/collection-types/api::blog-post.blog-post/${args.document_id}`, data, { headers } ) return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] } }
  • The tool schema definition including name, description, and input schema for validation.
    { name: 'strapi_publish_blog_post', description: 'Publish or unpublish a blog post', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Blog post document ID' }, publish: { type: 'boolean', description: 'true to publish, false to unpublish', default: true } }, required: ['document_id'] } },
  • index.js:377-378 (registration)
    Registration in the CallToolRequestSchema switch statement that routes calls to the publishBlogPost handler.
    case 'strapi_publish_blog_post': return await this.publishBlogPost(headers, request.params.arguments)
  • index.js:166-177 (registration)
    Tool registration in the ListToolsRequestSchema response, exposing the tool to MCP clients.
    { name: 'strapi_publish_blog_post', description: 'Publish or unpublish a blog post', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Blog post document ID' }, publish: { type: 'boolean', description: 'true to publish, false to unpublish', default: true } }, required: ['document_id'] } },

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/AINative-Studio/ainative-strapi-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server