get_call_analytics
Retrieve call analytics and statistics from the MCP JSON Database Server using JWT authentication. Specify date and period for detailed analysis.
Instructions
Çağrı analitikleri ve istatistikleri getirir
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | JWT token | |
| date | No | Analiz tarihi (YYYY-MM-DD) | |
| period | No | Analiz periyodu (daily, weekly, monthly) |
Implementation Reference
- src/index.js:1193-1230 (handler)The handler for the 'get_call_analytics' tool. It checks user permissions, filters the call analytics data from the database by optional date parameter, logs the access, and returns the analytics in JSON format.
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)Registration of the 'get_call_analytics' tool in the ListToolsRequestSchema handler, defining its name, description, and input schema.
{ 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 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'] }