Skip to main content
Glama

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
NameRequiredDescriptionDefault
document_idYesEvent document ID
titleNoNew title
descriptionNoNew description
start_dateNoNew start date/time
end_dateNoNew end date/time
locationNoNew location
registration_urlNoNew registration URL

Implementation Reference

  • 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) }] } }
  • 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'] } },

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