Skip to main content
Glama

strapi_create_blog_post

Create blog posts in Strapi CMS by providing title, markdown content, author ID, and optional metadata like categories and publication date.

Instructions

Create a new blog post in Strapi CMS with markdown content

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
titleYesBlog post title
contentYesBlog post content in MARKDOWN format
descriptionNoShort description/excerpt
author_idYesAuthor ID (use strapi_list_authors to find)
category_idNoCategory ID (use strapi_list_categories)
tag_idsNoArray of tag IDs (use strapi_list_tags)
publishedAtNoPublication date (ISO 8601) or null for draft

Implementation Reference

  • The main handler function that executes the tool logic: constructs the blog post data and sends a POST request to Strapi's content-manager API to create the post.
    async createBlogPost (headers, args) { const data = { title: args.title, content: args.content, description: args.description, author: args.author_id, category: args.category_id, tags: args.tag_ids, publishedAt: args.publishedAt || null } const response = await axios.post( `${this.strapiUrl}/content-manager/collection-types/api::blog-post.blog-post`, data, { headers } ) return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] } }
  • Defines the tool's metadata including name, description, and input schema with required fields and types.
    { name: 'strapi_create_blog_post', description: 'Create a new blog post in Strapi CMS with markdown content', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Blog post title' }, content: { type: 'string', description: 'Blog post content in MARKDOWN format' }, description: { type: 'string', description: 'Short description/excerpt' }, author_id: { type: 'number', description: 'Author ID (use strapi_list_authors to find)' }, category_id: { type: 'number', description: 'Category ID (use strapi_list_categories)' }, tag_ids: { type: 'array', items: { type: 'number' }, description: 'Array of tag IDs (use strapi_list_tags)' }, publishedAt: { type: 'string', description: 'Publication date (ISO 8601) or null for draft' } }, required: ['title', 'content', 'author_id'] } },
  • index.js:365-366 (registration)
    Registers the tool in the CallToolRequestSchema handler by switching on the tool name and delegating to the createBlogPost handler method.
    case 'strapi_create_blog_post': return await this.createBlogPost(headers, request.params.arguments)

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