strapi_publish_tutorial
Publish or unpublish tutorial content in Strapi CMS by specifying document ID and publication status for content management workflows.
Instructions
Publish or unpublish a tutorial
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes | Tutorial document ID | |
| publish | No | true to publish, false to unpublish |
Implementation Reference
- index.js:669-686 (handler)The main handler function that publishes or unpublishes a tutorial by updating the publishedAt field via Strapi's content-manager API.async publishTutorial (headers, args) { const data = { publishedAt: args.publish ? new Date().toISOString() : null } const response = await axios.put( `${this.strapiUrl}/content-manager/collection-types/api::tutorial.tutorial/${args.document_id}`, data, { headers } ) return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] } }
- index.js:264-275 (schema)Input schema definition for the strapi_publish_tutorial tool, specifying parameters like document_id and publish boolean.{ name: 'strapi_publish_tutorial', description: 'Publish or unpublish a tutorial', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Tutorial document ID' }, publish: { type: 'boolean', description: 'true to publish, false to unpublish', default: true } }, required: ['document_id'] } },
- index.js:402-403 (registration)Registration of the tool handler in the switch statement within the CallToolRequestSchema handler.case 'strapi_publish_tutorial': return await this.publishTutorial(headers, request.params.arguments)