strapi_update_event
Modify existing event details in Strapi CMS by updating title, description, dates, location, or registration URL using the event 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)Handler function that updates a Strapi event by sending a PUT request to the content-manager API with the provided arguments, constructing the data object conditionally.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 defining the parameters for the strapi_update_event tool, including required document_id and optional fields for updating the 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'] }
- index.js:322-338 (registration)Tool registration in the tools array, including name, description, and input schema.{ 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'] } },
- index.js:415-417 (registration)Dispatch case in setupHandlers switch statement that routes the tool call to the updateEvent handler.case 'strapi_update_event': return await this.updateEvent(headers, request.params.arguments)