[
  { "type": "function", "function": { "name": "get_customer_info", "description": "Get customer account information: name, type, territory, contact details, flags", "parameters": { "type": "object", "properties": { "customer_id": { "type": "string", "description": "Customer ID (e.g. C-LPB4)" } }, "required": ["customer_id"] } } },
  { "type": "function", "function": { "name": "get_subscriptions", "description": "Get active service subscriptions: plan names, prices, billing frequency, status", "parameters": { "type": "object", "properties": { "customer_id": { "type": "string" } }, "required": ["customer_id"] } } },
  { "type": "function", "function": { "name": "get_invoices", "description": "Get recent invoices: amounts, dates, payment status, outstanding balance", "parameters": { "type": "object", "properties": { "customer_id": { "type": "string" }, "limit": { "type": "number", "description": "Max invoices (default 5)" } }, "required": ["customer_id"] } } },
  { "type": "function", "function": { "name": "get_outstanding_balance", "description": "Get total outstanding (unpaid) balance across all invoices", "parameters": { "type": "object", "properties": { "customer_id": { "type": "string" } }, "required": ["customer_id"] } } },
  { "type": "function", "function": { "name": "get_service_locations", "description": "Get service locations (addresses) with connection type", "parameters": { "type": "object", "properties": { "customer_id": { "type": "string" } }, "required": ["customer_id"] } } },
  { "type": "function", "function": { "name": "get_equipment", "description": "Get equipment (routers, ONTs) installed: serial numbers, MAC, status", "parameters": { "type": "object", "properties": { "customer_id": { "type": "string" } }, "required": ["customer_id"] } } },
  { "type": "function", "function": { "name": "check_device_status", "description": "Quick snapshot of device status via TR-069 + SNMP. Returns online/offline, uptime, signal levels. NOTE: if the device appears offline, do NOT tell the customer it is offline — instead call start_connection_check to run a thorough background verification.", "parameters": { "type": "object", "properties": { "serial_number": { "type": "string", "description": "Device serial number" } }, "required": ["serial_number"] } } },
  { "type": "function", "function": { "name": "check_onu_status", "description": "Check ONU status from OLT SNMP: online/offline, signal levels, last offline cause (Dying Gasp, Branch Fiber Cut, LOSi), recent events history.", "parameters": { "type": "object", "properties": { "serial_number": { "type": "string", "description": "Device serial number (ONU serial)" } }, "required": ["serial_number"] } } },
  { "type": "function", "function": { "name": "start_connection_check", "description": "IMPORTANT: Use this tool instead of telling the customer their connection is offline. Launches a background verification that polls the device 3 times over ~90 seconds via both TR-069 and OLT SNMP, then automatically sends the diagnostic result to the customer. Tell the customer 'Nous vérifions votre connexion, un instant...' while the check runs. Do NOT announce the device as offline before this check completes.", "parameters": { "type": "object", "properties": { "serial_number": { "type": "string", "description": "Device serial number" }, "customer_id": { "type": "string", "description": "Customer ID" } }, "required": ["serial_number", "customer_id"] } } },
  { "type": "function", "function": { "name": "analyze_outage", "description": "Analyze a device outage by correlating with other ONUs on the same OLT port. Determines if the problem is isolated (single customer) or widespread (multiple customers affected). Returns severity, cause type (power outage, fiber cut, backbone issue), recommended action (none/simple_tech/fiber_splicer/escalate_noc). Use this after check_onu_status shows a device offline to understand the scope.", "parameters": { "type": "object", "properties": { "serial_number": { "type": "string", "description": "Device serial number (ONU serial)" } }, "required": ["serial_number"] } } },
  { "type": "function", "function": { "name": "get_open_tickets", "description": "Get open support tickets: subject, status, priority, date", "parameters": { "type": "object", "properties": { "customer_id": { "type": "string" } }, "required": ["customer_id"] } } },
  { "type": "function", "function": { "name": "create_ticket", "description": "Create a support ticket when customer reports a problem needing agent follow-up", "parameters": { "type": "object", "properties": { "customer_id": { "type": "string" }, "subject": { "type": "string" }, "description": { "type": "string" }, "priority": { "type": "string", "enum": ["Low", "Medium", "High", "Urgent"] } }, "required": ["customer_id", "subject"] } } },
  { "type": "function", "function": { "name": "get_chat_link", "description": "Get the web chat link for this conversation so the customer can continue chatting in a browser instead of SMS", "parameters": { "type": "object", "properties": {} } } },
  { "type": "function", "function": { "name": "create_dispatch_job", "description": "Create an emergency dispatch job and auto-assign to the nearest available technician. Use when: device offline with fiber issue (Rx power < -25 dBm, Branch Fiber Cut), customer reports no internet and troubleshooting fails, or any situation requiring on-site technician.", "parameters": { "type": "object", "properties": { "customer_id": { "type": "string", "description": "Customer ID (e.g. C-LPB4)" }, "service_location": { "type": "string", "description": "Service Location name (from get_service_locations)" }, "subject": { "type": "string", "description": "Job description (e.g. 'Branch Fiber Cut - 691 rue des Hirondelles')" }, "priority": { "type": "string", "enum": ["low", "medium", "high"], "description": "Job priority (default: high for emergencies)" }, "job_type": { "type": "string", "enum": ["Installation", "Réparation", "Maintenance", "Retrait", "Dépannage", "Autre"], "description": "Type of work (default: Dépannage)" }, "notes": { "type": "string", "description": "Additional context (signal levels, error details, customer complaint)" } }, "required": ["customer_id", "subject"] } } }
]
