phone_get_conversation_history
Retrieve recent call conversation history from the Asterisk S2S MCP Server, specifying the number of conversations to fetch for efficient review and analysis.
Instructions
Obtener el historial de conversaciones telefónicas recientes
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Número máximo de conversaciones a obtener |
Implementation Reference
- operations/realtime-assistant.ts:406-410 (handler)Core implementation of getConversationHistory that returns the most recent conversation processing results from the global conversationHistory array.export function getConversationHistory(limit: number = 50): ConversationProcessingResult[] { return conversationHistory .slice(-limit) .reverse(); }
- tools/realtime-assistant.ts:190-202 (handler)Intermediate wrapper function getConversationHistory in tools layer that calls the operations implementation.export async function getConversationHistory(args?: { limit?: number; }): Promise<Array<{ callId: string; success: boolean; processed: boolean; response_for_user: string; actions_taken?: string[]; errors?: string[]; }>> { const limit = args?.limit || 20; return phoneOps.getConversationHistory(limit); }
- index.ts:115-141 (registration)MCP tool registration for 'phone_get_conversation_history' including input schema, handler logic that formats and returns conversation history.server.tool( "phone_get_conversation_history", "Obtener el historial de conversaciones telefónicas recientes", { limit: z.number().optional().default(10).describe("Número máximo de conversaciones a obtener") }, async (args) => { const result = await phoneTools.getConversationHistory({ limit: args.limit }); if (result.length === 0) { return { content: [{ type: "text", text: "📭 No hay conversaciones en el historial" }], }; } const historyText = result.map(conv => `**${conv.callId}** - ${conv.success ? '✅' : '❌'}\n${conv.response_for_user}\n---` ).join('\n\n'); return { content: [{ type: "text", text: `📚 **Historial de Conversaciones (${result.length} últimas)**\n\n${historyText}` }], }; } );