Skip to main content
Glama

strapi_update_blog_post

Modify existing blog posts in Strapi CMS by updating title, content, description, category, or tags using document ID.

Instructions

Update an existing blog post

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
document_idYesBlog post document ID
titleNoNew title
contentNoNew content in MARKDOWN
descriptionNoNew description
category_idNoNew category ID
tag_idsNoNew tag IDs

Implementation Reference

  • Implements the core logic for updating a blog post by constructing update data from input arguments and sending a PUT request to Strapi's content-manager API endpoint.
    async updateBlogPost (headers, args) { const data = {} if (args.title) data.title = args.title if (args.content) data.content = args.content if (args.description) data.description = args.description if (args.category_id) data.category = args.category_id if (args.tag_ids) data.tags = args.tag_ids // 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) }] } }
  • Defines the input schema/validation for the tool, specifying required document_id and optional fields like title, content, description, category_id, and tag_ids.
    inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Blog post document ID' }, title: { type: 'string', description: 'New title' }, content: { type: 'string', description: 'New content in MARKDOWN' }, description: { type: 'string', description: 'New description' }, category_id: { type: 'number', description: 'New category ID' }, tag_ids: { type: 'array', items: { type: 'number' }, description: 'New tag IDs' } }, required: ['document_id'] }
  • index.js:150-165 (registration)
    Tool registration in the ListTools response, defining name, description, and schema.
    { name: 'strapi_update_blog_post', description: 'Update an existing blog post', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Blog post document ID' }, title: { type: 'string', description: 'New title' }, content: { type: 'string', description: 'New content in MARKDOWN' }, description: { type: 'string', description: 'New description' }, category_id: { type: 'number', description: 'New category ID' }, tag_ids: { type: 'array', items: { type: 'number' }, description: 'New tag IDs' } }, required: ['document_id'] } },
  • index.js:374-375 (registration)
    Dispatch/registration in the CallToolRequest handler switch statement, routing to the updateBlogPost method.
    case 'strapi_update_blog_post': return await this.updateBlogPost(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