fc_get_space_analytics
Retrieve analytics and statistics for community spaces to track engagement metrics and performance data within specified date ranges.
Instructions
Get analytics and statistics for a space
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| space_id | Yes | The space ID to get analytics for | |
| date_from | No | Start date (YYYY-MM-DD) | |
| date_to | No | End date (YYYY-MM-DD) |
Implementation Reference
- src/tools/fluent-community.ts:519-531 (handler)Handler function that fetches space analytics via WordPress API endpoint 'fc-manager/v1/analytics/space' using provided space_id and optional date range, returns JSON-formatted response or error.fc_get_space_analytics: async (args: any) => { try { const params: any = { space_id: args.space_id }; if (args.date_from) params.date_from = args.date_from; if (args.date_to) params.date_to = args.date_to; const response = await makeWordPressRequest('GET', 'fc-manager/v1/analytics/space', params); return { toolResult: { content: [{ type: 'text', text: JSON.stringify(response, null, 2) }] } }; } catch (error: any) { return { toolResult: { isError: true, content: [{ type: 'text', text: `Error: ${error.message}` }] } }; } },
- Zod input schema defining required space_id and optional date_from/date_to parameters for the tool.const getSpaceAnalyticsSchema = z.object({ space_id: z.number().describe('The space ID to get analytics for'), date_from: z.string().optional().describe('Start date (YYYY-MM-DD)'), date_to: z.string().optional().describe('End date (YYYY-MM-DD)') });
- src/tools/fluent-community.ts:260-264 (registration)Tool registration entry in the fluentCommunityTools array, specifying name, description, and input schema reference.{ name: 'fc_get_space_analytics', description: 'Get analytics and statistics for a FluentCommunity space', inputSchema: { type: 'object', properties: getSpaceAnalyticsSchema.shape } },