strapi_publish_event
Publish or unpublish event content in Strapi CMS by specifying the document ID and desired publication status.
Instructions
Publish or unpublish an event
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes | Event document ID | |
| publish | No | true to publish, false to unpublish |
Implementation Reference
- index.js:775-791 (handler)Executes the tool logic: sends PUT request to Strapi API to set publishedAt field for the event, publishing or unpublishing it.async publishEvent (headers, args) { const data = { publishedAt: args.publish ? new Date().toISOString() : null } const response = await axios.put( `${this.strapiUrl}/content-manager/collection-types/api::event.event/${args.document_id}`, data, { headers } ) return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] }
- index.js:339-350 (schema)Defines the tool's input schema, name, and description for validation in ListTools and CallTool requests.{ name: 'strapi_publish_event', description: 'Publish or unpublish an event', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Event document ID' }, publish: { type: 'boolean', description: 'true to publish, false to unpublish', default: true } }, required: ['document_id'] } }
- index.js:418-419 (registration)Registers the tool handler in the switch statement for CallToolRequestSchema, dispatching calls to the publishEvent method.case 'strapi_publish_event': return await this.publishEvent(headers, request.params.arguments)
- index.js:103-352 (registration)Registers the tool in the ListToolsRequestSchema response, making it discoverable by MCP clients.this.server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: [ { 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'] } }, { name: 'strapi_list_blog_posts', description: 'List all blog posts with advanced filtering, sorting, and pagination', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number', default: 1 }, pageSize: { type: 'number', description: 'Results per page', default: 25 }, status: { type: 'string', enum: ['published', 'draft', 'all'], description: 'Filter by status', default: 'all' }, category_id: { type: 'number', description: 'Filter by category ID' }, author_id: { type: 'number', description: 'Filter by author ID' }, tag_id: { type: 'number', description: 'Filter by tag ID' }, sort: { type: 'string', description: 'Sort field and direction (e.g., "publishedAt:desc", "title:asc")', default: 'createdAt:desc' }, search: { type: 'string', description: 'Search in title and content' } } } }, { name: 'strapi_get_blog_post', description: 'Get a specific blog post by document ID', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Blog post document ID' } }, required: ['document_id'] } }, { 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'] } }, { name: 'strapi_publish_blog_post', description: 'Publish or unpublish a blog post', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Blog post document ID' }, publish: { type: 'boolean', description: 'true to publish, false to unpublish', default: true } }, required: ['document_id'] } }, { name: 'strapi_list_authors', description: 'List all authors', inputSchema: { type: 'object', properties: {} } }, { name: 'strapi_list_categories', description: 'List all categories', inputSchema: { type: 'object', properties: {} } }, { name: 'strapi_list_tags', description: 'List all tags', inputSchema: { type: 'object', properties: {} } }, // ==================== TUTORIAL OPERATIONS ==================== { name: 'strapi_create_tutorial', description: 'Create a new tutorial with step-by-step content in markdown', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Tutorial title' }, content: { type: 'string', description: 'Tutorial content in MARKDOWN format' }, description: { type: 'string', description: 'Short description' }, difficulty: { type: 'string', enum: ['beginner', 'intermediate', 'advanced'], description: 'Difficulty level' }, duration: { type: 'number', description: 'Estimated duration in minutes' }, author_id: { type: 'number', description: 'Author ID' }, category_id: { type: 'number', description: 'Category ID' }, tag_ids: { type: 'array', items: { type: 'number' }, description: 'Array of tag IDs' }, publishedAt: { type: 'string', description: 'Publication date (ISO 8601) or null for draft' } }, required: ['title', 'content', 'author_id'] } }, { name: 'strapi_list_tutorials', description: 'List all tutorials with filtering and pagination', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number', default: 1 }, pageSize: { type: 'number', description: 'Results per page', default: 25 }, status: { type: 'string', enum: ['published', 'draft', 'all'], description: 'Filter by status', default: 'all' }, difficulty: { type: 'string', enum: ['beginner', 'intermediate', 'advanced'], description: 'Filter by difficulty' }, category_id: { type: 'number', description: 'Filter by category ID' }, sort: { type: 'string', description: 'Sort field and direction', default: 'createdAt:desc' } } } }, { name: 'strapi_get_tutorial', description: 'Get a specific tutorial by document ID', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Tutorial document ID' } }, required: ['document_id'] } }, { name: 'strapi_update_tutorial', description: 'Update an existing tutorial', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Tutorial document ID' }, title: { type: 'string', description: 'New title' }, content: { type: 'string', description: 'New content in MARKDOWN' }, description: { type: 'string', description: 'New description' }, difficulty: { type: 'string', enum: ['beginner', 'intermediate', 'advanced'], description: 'New difficulty' }, duration: { type: 'number', description: 'New duration in minutes' } }, required: ['document_id'] } }, { 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'] } }, // ==================== EVENT OPERATIONS ==================== { name: 'strapi_create_event', description: 'Create a new event (webinar, workshop, meetup, conference)', inputSchema: { type: 'object', properties: { title: { type: 'string', description: 'Event title' }, description: { type: 'string', description: 'Event description in MARKDOWN' }, event_type: { type: 'string', enum: ['webinar', 'workshop', 'meetup', 'conference'], description: 'Type of event' }, start_date: { type: 'string', description: 'Event start date/time (ISO 8601)' }, end_date: { type: 'string', description: 'Event end date/time (ISO 8601)' }, location: { type: 'string', description: 'Physical location or virtual platform' }, registration_url: { type: 'string', description: 'Registration/signup URL' }, max_attendees: { type: 'number', description: 'Maximum number of attendees' }, publishedAt: { type: 'string', description: 'Publication date (ISO 8601) or null for draft' } }, required: ['title', 'description', 'event_type', 'start_date'] } }, { name: 'strapi_list_events', description: 'List all events with filtering and pagination', inputSchema: { type: 'object', properties: { page: { type: 'number', description: 'Page number', default: 1 }, pageSize: { type: 'number', description: 'Results per page', default: 25 }, status: { type: 'string', enum: ['published', 'draft', 'all'], description: 'Filter by status', default: 'all' }, event_type: { type: 'string', enum: ['webinar', 'workshop', 'meetup', 'conference'], description: 'Filter by event type' }, upcoming: { type: 'boolean', description: 'Show only upcoming events', default: false }, sort: { type: 'string', description: 'Sort field and direction', default: 'start_date:asc' } } } }, { name: 'strapi_get_event', description: 'Get a specific event by document ID', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Event document ID' } }, required: ['document_id'] } }, { name: 'strapi_update_event', description: 'Update an existing event', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Event document ID' }, title: { type: 'string', description: 'New title' }, description: { type: 'string', description: 'New description' }, start_date: { type: 'string', description: 'New start date/time' }, end_date: { type: 'string', description: 'New end date/time' }, location: { type: 'string', description: 'New location' }, registration_url: { type: 'string', description: 'New registration URL' } }, required: ['document_id'] } }, { name: 'strapi_publish_event', description: 'Publish or unpublish an event', inputSchema: { type: 'object', properties: { document_id: { type: 'string', description: 'Event document ID' }, publish: { type: 'boolean', description: 'true to publish, false to unpublish', default: true } }, required: ['document_id'] } } ] }))