LiraX Tool icon

LiraX Tool

Provides LiraX telephony operations as tools for AI Agent with standardized output format

🧠 Get AI Context

AI-generated

Summary

Retrieve full customer context (contact info and recent call history) for AI Agent consumption.

Inputs

  • phone — Phone number for the operation. If provided, recent call history is filtered to numbers matching this ANI/destination. Will be automatically normalized. Include country code for international numbers. Default: empty string. Note: UI marks as required, but runtime treats it as optional (default '') per source implementation where phone filtering is conditional on presence.
  • email — Email address for contact lookup or creation. Default: empty string.

Output shape

Standardized AI output object. On success: contains customer context (phone, email, identified boolean, contact details from getContact), call history (last 30 days stats: total calls, average duration, last call; recent calls sliced to first 5), and generatedAt ISO timestamp. Confidence is 0.9 if successful, 0.1 if error. Summary (if includeSummary) reads 'Retrieved context for customer '. _standardized block includes type 'utility', operation, result, confidence, actionable flag (confidence >= threshold), next steps ['Use context to personalize next conversation', 'Review customer history for patterns'], and masked context (phone/email). On error: details based on errorMode setting (strict throws, lenient returns standardized error, silent returns empty data).

Phone and email are optional at runtime; if omitted, contact fetch and call history still execute but without filtering. Errors during contact or call fetch are silently ignored per source implementation.

Examples

Example 1: Basic usage with phone

phone: '380501234567', email omitted, aiSettings default (includeSummary=true, standardizedOutput=true, errorMode=lenient, includeRawResponse=false, confidenceThreshold=0.7). Returns customer context with call history from last 30 days filtered to the provided phone number.

Example 2: Usage with email only

phone omitted, email: 'john.smith@example.com'. Returns contact info found by email and associated call history (no phone filtering).

Links

Discussion