list_call_transcripts
Retrieve and filter call transcripts by category or sentiment using JWT authentication, with customizable limit options for efficient data access.
Instructions
Telefon görüşmeleri transkriptlerini listeler
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| category | No | Kategori filtresi (destek, satış, şikayet) | |
| limit | No | Gösterilecek kayıt sayısı (varsayılan: 50) | |
| sentiment | No | Duygu durumu filtresi (positive, negative, neutral) | |
| token | Yes | JWT token |
Implementation Reference
- src/index.js:955-1017 (handler)The handler function for the list_call_transcripts tool. It checks user permissions via token, filters call transcripts based on user role (employees see only their assigned transcripts), applies optional category and sentiment filters, limits the results, logs the access, and returns the filtered list of transcripts.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:133-146 (registration)Tool registration in the ListTools response, including name, description, and input schema definition for list_call_transcripts.{ 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:136-144 (schema)Input schema definition for the list_call_transcripts tool, specifying required token and optional filters.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']