add_call_transcript
Adds new phone call transcripts to a JSON database, including caller details, conversation content, duration, category, and priority for tracking and analysis.
Instructions
Yeni telefon görüşmesi transkripti ekler
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| token | Yes | JWT token | |
| callerPhone | Yes | Arayan telefon numarası | |
| callerName | Yes | Arayan kişi adı | |
| callerCompany | No | Arayan şirket | |
| transcript | Yes | Konuşma transkripti | |
| duration | Yes | Görüşme süresi (saniye) | |
| category | Yes | Kategori (destek, satış, şikayet) | |
| priority | No | Öncelik (low, normal, high, urgent) | |
| keywords | No | Anahtar kelimeler |
Implementation Reference
- src/index.js:1131-1191 (handler)Handler for add_call_transcript tool: checks user permissions, creates a new call transcript entry with comprehensive details including auto-generated ID and timestamps, adds it to the database, logs the action, and returns the new transcript.case 'add_call_transcript': { const { token, callerPhone, callerName, callerCompany = "Bilinmiyor", transcript, duration, category, priority = "normal", keywords = [] } = args; try { const user = checkPermissionWithToken(token, PERMISSIONS.TRANSCRIPT_CREATE); const newTranscript = { id: generateId(db.call_transcripts), callId: `CALL_${new Date().toISOString().slice(0, 10).replace(/-/g, '')}_${String(db.call_transcripts.length + 1).padStart(3, '0')}`, callerPhone, callerName, callerCompany, receiverPhone: "+90 555 123 4567", // Sabit receiver phone receiverName: user.role === ROLES.EMPLOYEE ? db.users.find(u => u.id === user.userId)?.name : "Müşteri Hizmetleri", receiverDepartment: "Müşteri Hizmetleri", callDate: new Date().toISOString().slice(0, 10), callTime: new Date().toTimeString().slice(0, 8), duration, callType: "incoming", status: "completed", category, priority, transcript, keywords, sentiment: "neutral", // Default sentiment resolution: "pending", followUpRequired: false, assignedTo: user.userId, createdAt: new Date().toISOString(), updatedAt: new Date().toISOString() }; db.call_transcripts.push(newTranscript); await writeDatabase(db); await auditLogger.dataAccessed(user.userId, user.role, 'call_transcript_created', { transcriptId: newTranscript.id, category }); return { content: [{ type: 'text', text: JSON.stringify({ success: true, data: newTranscript, message: 'Transkript başarıyla eklendi', 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_CREATE }) }] }; } }
- src/index.js:175-188 (schema)Input schema definition for the add_call_transcript tool, specifying parameters like token, caller details, transcript, duration, category, with required fields.inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'JWT token' }, callerPhone: { type: 'string', description: 'Arayan telefon numarası' }, callerName: { type: 'string', description: 'Arayan kişi adı' }, callerCompany: { type: 'string', description: 'Arayan şirket' }, transcript: { type: 'string', description: 'Konuşma transkripti' }, duration: { type: 'number', description: 'Görüşme süresi (saniye)' }, category: { type: 'string', description: 'Kategori (destek, satış, şikayet)' }, priority: { type: 'string', description: 'Öncelik (low, normal, high, urgent)' }, keywords: { type: 'array', items: { type: 'string' }, description: 'Anahtar kelimeler' } }, required: ['token', 'callerPhone', 'callerName', 'transcript', 'duration', 'category']
- src/index.js:172-190 (registration)Registration of the add_call_transcript tool in the ListToolsRequestSchema handler, including name, description, and input schema.{ name: 'add_call_transcript', description: 'Yeni telefon görüşmesi transkripti ekler', inputSchema: { type: 'object', properties: { token: { type: 'string', description: 'JWT token' }, callerPhone: { type: 'string', description: 'Arayan telefon numarası' }, callerName: { type: 'string', description: 'Arayan kişi adı' }, callerCompany: { type: 'string', description: 'Arayan şirket' }, transcript: { type: 'string', description: 'Konuşma transkripti' }, duration: { type: 'number', description: 'Görüşme süresi (saniye)' }, category: { type: 'string', description: 'Kategori (destek, satış, şikayet)' }, priority: { type: 'string', description: 'Öncelik (low, normal, high, urgent)' }, keywords: { type: 'array', items: { type: 'string' }, description: 'Anahtar kelimeler' } }, required: ['token', 'callerPhone', 'callerName', 'transcript', 'duration', 'category'] } },