list_call_transcripts
Retrieve call transcripts from the MCP JSON Database Server using filters for category, sentiment, and result limits to analyze customer interactions.
Instructions
Telefon görüşmeleri transkriptlerini listeler
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | JWT token | |
| limit | No | Gösterilecek kayıt sayısı (varsayılan: 50) | |
| category | No | Kategori filtresi (destek, satış, şikayet) | |
| sentiment | No | Duygu durumu filtresi (positive, negative, neutral) |
Implementation Reference
- src/index.js:955-1017 (handler)Handler function for the 'list_call_transcripts' tool. Validates token and permissions, filters transcripts by role (employees see only assigned), applies category/sentiment filters, limits results, logs access, and returns JSON response.case 'list_call_transcripts': { const { token, limit = 50, category, sentiment } = args; try { console.error('DEBUG: list_call_transcripts called with token:', token ? 'PROVIDED' : 'MISSING'); console.error('DEBUG: PERMISSIONS.TRANSCRIPT_LIST:', PERMISSIONS.TRANSCRIPT_LIST); const user = checkPermissionWithToken(token, PERMISSIONS.TRANSCRIPT_LIST); console.error('DEBUG: User permission check passed:', user); let transcripts = db.call_transcripts; console.error('DEBUG: Total transcripts in DB:', transcripts.length); // Employee sadece kendi atandığı çağrıları görebilir if (user.role === ROLES.EMPLOYEE) { transcripts = transcripts.filter(t => t.assignedTo === user.userId); console.error('DEBUG: Filtered for employee, remaining:', transcripts.length); } // Filtreler if (category) { transcripts = transcripts.filter(t => t.category === category); } if (sentiment) { transcripts = transcripts.filter(t => t.sentiment === sentiment); } // Limit uygula transcripts = transcripts.slice(0, limit); await auditLogger.dataAccessed(user.userId, user.role, 'call_transcripts_list', { limit, category, sentiment }); return { content: [{ type: 'text', text: JSON.stringify({ success: true, data: transcripts, total: transcripts.length, filters: { category, sentiment }, requestedBy: { id: user.userId, role: user.role } }, null, 2) }] }; } catch (error) { console.error('DEBUG: Error in list_call_transcripts:', error.message); return { content: [{ type: 'text', text: JSON.stringify({ success: false, message: error.message, requiredPermission: PERMISSIONS.TRANSCRIPT_LIST, debug: { errorType: error.constructor.name, hasToken: !!token, permissionRequired: PERMISSIONS.TRANSCRIPT_LIST } }) }] }; } }
- src/index.js:134-146 (registration)Registration of the 'list_call_transcripts' tool in the ListToolsRequestHandler, including name, description, and input schema definition.name: 'list_call_transcripts', description: 'Telefon görüşmeleri transkriptlerini listeler', inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'JWT token' }, limit: { type: 'number', description: 'Gösterilecek kayıt sayısı (varsayılan: 50)' }, category: { type: 'string', description: 'Kategori filtresi (destek, satış, şikayet)' }, sentiment: { type: 'string', description: 'Duygu durumu filtresi (positive, negative, neutral)' } }, required: ['token'] } },
- src/index.js:137-144 (schema)Input schema definition for the 'list_call_transcripts' tool, specifying parameters like token (required), limit, category, and sentiment.type: 'object', properties: { token: { type: 'string', description: 'JWT token' }, limit: { type: 'number', description: 'Gösterilecek kayıt sayısı (varsayılan: 50)' }, category: { type: 'string', description: 'Kategori filtresi (destek, satış, şikayet)' }, sentiment: { type: 'string', description: 'Duygu durumu filtresi (positive, negative, neutral)' } }, required: ['token']