strapi_update_event
Modify event details in Strapi CMS by updating title, description, dates, location, or registration URL using the event's document ID.
Instructions
Update an existing event
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| document_id | Yes | Event document ID | |
| title | No | New title | |
| description | No | New description | |
| start_date | No | New start date/time | |
| end_date | No | New end date/time | |
| location | No | New location | |
| registration_url | No | New registration URL |
Implementation Reference
- index.js:752-773 (handler)The updateEvent method implements the core logic for the strapi_update_event tool. It constructs a data object from the provided arguments, performs a PUT request to the Strapi content-manager API endpoint for events using the document_id, and returns the response.async updateEvent (headers, args) { const data = {} if (args.title) data.title = args.title if (args.description) data.description = args.description if (args.start_date) data.start_date = args.start_date if (args.end_date) data.end_date = args.end_date if (args.location) data.location = args.location if (args.registration_url) data.registration_url = args.registration_url 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:325-337 (schema)Input schema definition for the strapi_update_event tool, specifying the required document_id and optional updatable fields.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'] }
- index.js:415-416 (registration)Handler registration in the CallToolRequestSchema switch statement, dispatching calls to the updateEvent method.case 'strapi_update_event': return await this.updateEvent(headers, request.params.arguments)
- index.js:322-338 (registration)Tool registration in the ListToolsRequestSchema response, defining name, description, and schema for strapi_update_event.{ 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'] } },