get_call_transcript_by_id
Retrieve phone call transcripts by ID using JWT authentication. Access specific conversation records from the database for review or analysis.
Instructions
ID'ye göre telefon transkripti getirir
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | JWT token | |
| id | Yes | Transkript ID'si |
Implementation Reference
- src/index.js:1019-1070 (handler)Main execution logic for the 'get_call_transcript_by_id' tool. Performs permission checks, retrieves the specific call transcript by ID from the database, enforces role-based access (employees see only assigned transcripts), audits access, and returns the transcript data as JSON.
case 'get_call_transcript_by_id': { const { token, id } = args; try { const user = checkPermissionWithToken(token, PERMISSIONS.TRANSCRIPT_READ); const transcript = db.call_transcripts.find(t => t.id === id); if (!transcript) { return { content: [{ type: 'text', text: JSON.stringify({ success: false, message: 'Transkript bulunamadı' }) }] }; } // Employee sadece kendi atandığı çağrıları görebilir if (user.role === ROLES.EMPLOYEE && transcript.assignedTo !== user.userId) { await auditLogger.permissionDenied(user.userId, user.role, 'get_call_transcript_by_id', PERMISSIONS.TRANSCRIPT_READ); return { content: [{ type: 'text', text: JSON.stringify({ success: false, message: 'Bu transkripti görüntüleme yetkiniz yok' }) }] }; } await auditLogger.dataAccessed(user.userId, user.role, 'call_transcript_detail', { transcriptId: id }); return { content: [{ type: 'text', text: JSON.stringify({ success: true, data: transcript, 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_READ }) }] }; } } - src/index.js:147-157 (schema)Tool schema definition including name, description, and input schema specifying required 'token' (JWT) and 'id' (transcript ID) parameters.
{ name: 'get_call_transcript_by_id', description: 'ID\'ye göre telefon transkripti getirir', inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'JWT token' }, id: { type: 'number', description: 'Transkript ID\'si' } }, required: ['token', 'id'] } - src/index.js:147-158 (registration)Registration of the tool in the ListTools response array, making it discoverable by MCP clients.
{ name: 'get_call_transcript_by_id', description: 'ID\'ye göre telefon transkripti getirir', inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'JWT token' }, id: { type: 'number', description: 'Transkript ID\'si' } }, required: ['token', 'id'] } },