get_call_analytics
Retrieve call analytics and statistics by specifying a date and period using JWT token authentication within the MCP JSON Database Server.
Instructions
Çağrı analitikleri ve istatistikleri getirir
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| date | No | Analiz tarihi (YYYY-MM-DD) | |
| period | No | Analiz periyodu (daily, weekly, monthly) | |
| token | Yes | JWT token |
Implementation Reference
- src/index.js:1193-1229 (handler)Main execution logic for the get_call_analytics tool. Performs permission check, filters call analytics data from database by optional date parameter, logs access via audit, and returns JSON response with analytics data.case 'get_call_analytics': { const { token, date, period = 'daily' } = args; try { const user = checkPermissionWithToken(token, PERMISSIONS.TRANSCRIPT_ANALYTICS); let analytics = db.call_analytics; if (date) { analytics = analytics.filter(a => a.date === date); } await auditLogger.dataAccessed(user.userId, user.role, 'call_analytics', { date, period }); return { content: [{ type: 'text', text: JSON.stringify({ success: true, data: analytics, period, requestedBy: { id: user.userId, role: user.role } }, null, 2) }] }; } catch (error) { return { content: [{ type: 'text', text: JSON.stringify({ success: false, message: error.message, requiredPermission: PERMISSIONS.TRANSCRIPT_ANALYTICS }) }] }; }
- src/index.js:206-218 (registration)Tool registration in the ListToolsRequestHandler response. Defines the tool name, description, and input schema specification.{ name: 'get_call_analytics', description: 'Çağrı analitikleri ve istatistikleri getirir', inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'JWT token' }, date: { type: 'string', description: 'Analiz tarihi (YYYY-MM-DD)' }, period: { type: 'string', description: 'Analiz periyodu (daily, weekly, monthly)', enum: ['daily', 'weekly', 'monthly'] } }, required: ['token'] } },
- src/index.js:209-217 (schema)Input schema definition for the get_call_analytics tool, specifying required JWT token and optional date/period parameters.inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'JWT token' }, date: { type: 'string', description: 'Analiz tarihi (YYYY-MM-DD)' }, period: { type: 'string', description: 'Analiz periyodu (daily, weekly, monthly)', enum: ['daily', 'weekly', 'monthly'] } }, required: ['token'] }