Skip to main content
Glama

strapi_create_blog_post

Create new blog posts in Strapi CMS with markdown content, author assignment, and category/tag organization.

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 createBlogPost method that executes the tool logic: constructs the post data from arguments and sends a POST request to Strapi's blog-post collection endpoint, returning the response.
    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)
        }]
      }
    }
  • Input schema for the strapi_create_blog_post tool, defining parameters like title, content (markdown), author_id (required), etc.
    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:105-121 (registration)
    Tool registration in the ListTools handler, specifying name, description, and input schema for strapi_create_blog_post.
    {
      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']
      }
    },
  • Switch case in CallToolRequest handler that dispatches to the createBlogPost 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