Skip to main content
Glama

strapi_update_blog_post

Modify existing blog posts by updating title, content, description, category, or tags in Strapi CMS 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

  • The main handler function that updates an existing blog post in Strapi by constructing a data object from arguments and sending a PUT request to the Strapi 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) }] } }
  • index.js:150-165 (registration)
    Registers the 'strapi_update_blog_post' tool in the MCP server's listTools response, including name, description, and input 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'] } },
  • Switch case in the CallToolRequestSchema handler that dispatches to the updateBlogPost method for this tool.
    case 'strapi_update_blog_post': return await this.updateBlogPost(headers, request.params.arguments)
  • Defines the input schema for the tool, specifying parameters like document_id (required), title, content, etc.
    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']

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