strapi_list_events
Retrieve and filter events from Strapi CMS with pagination options, status filtering, and sorting capabilities for event management.
Instructions
List all events with filtering and pagination
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number | |
| pageSize | No | Results per page | |
| status | No | Filter by status | all |
| event_type | No | Filter by event type | |
| upcoming | No | Show only upcoming events | |
| sort | No | Sort field and direction | start_date:asc |
Implementation Reference
- index.js:716-736 (handler)The handler function that executes the tool logic by fetching events from Strapi CMS using axios GET request with pagination parameters.
async listEvents (headers, args = {}) { const { page = 1, pageSize = 25 } = args const response = await axios.get( `${this.strapiUrl}/content-manager/collection-types/api::event.event`, { headers, params: { page, pageSize } } ) return { content: [{ type: 'text', text: JSON.stringify(response.data, null, 2) }] } } - index.js:299-309 (schema)Input schema defining parameters for pagination, status filtering, event type, upcoming filter, and sorting.
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' } } } - index.js:296-310 (registration)Registration of the strapi_list_events tool in the ListTools response, including name, description, and input schema.
{ 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' } } } }, - index.js:409-410 (registration)Dispatch/registration in the CallToolRequestSchema switch statement that routes to the listEvents handler.
case 'strapi_list_events': return await this.listEvents(headers, request.params.arguments)