Check Address Tool
Thecheck_address tool validates delivery addresses and determines which location should serve the customer. It’s critical for ensuring successful delivery orders and proper location selection in multi-location organizations.
Overview
Address validation serves multiple purposes:- Service Area Validation: Ensures address is within delivery zone
- Location Selection: Finds best location in organization mode
- Delivery Feasibility: Calculates fees and estimated delivery times
- Address Parsing: Handles various address formats and coordinates
Tool Parameters
Required (One Of)
address_string: Full delivery address as textlatitude+longitude: Coordinate-based location
Optional
- Service type is inferred from order draft (defaults to delivery)
Behavior by Mode
Location Mode (Single Restaurant)
Simple validation against the restaurant’s delivery zone:- Geocode the address
- Check if coordinates fall within delivery polygon
- Calculate distance and delivery fee
- Return validation result with fee and timing
Organization Mode (Multi-Location Chain)
Finds the best location to serve the customer:- Geocode the address
- Check all organization locations
- Return best location (lowest fee/shortest distance)
- Automatically trigger location switch
- Provide location-specific pricing and timing
Response Handling
Successful Validation
Location Mode Response
Organization Mode Response
Validation Failures
Address Outside Delivery Zone
Invalid Address Format
Common Error Codes
POSTAL_CODE_NOT_SERVED: Address outside delivery areaOUT_OF_DELIVERY_RADIUS: Address too far from locationINVALID_ADDRESS: Address format couldn’t be parsedNEXUS_CALL_FAILED: Server error during validation
Integration with Other Tools
Automatic Location Switching
In organization mode, successful address validation automatically:- Sets the best location on conversation context
- Calls
switch_locationtool internally - Updates order draft with new location
- Prepares for menu operations with correct catalog
Menu Integration
After address validation:Order Draft Updates
Address validation flows directly into order updates:Coordinate-Based Validation
For location pins and map links:- Google Maps shared links
- WhatsApp location pins
- Other coordinate-based inputs
High Delivery Fees
When delivery fees exceed €9.50, the tool provides special instructions:Best Practices
When to Call check_address
- Early in delivery conversations - As soon as customer indicates delivery
- Before building large orders - Validate serviceability first
- When customer provides new address - Even if they’ve ordered before
- For coordinate-based locations - When customer shares location pins
Error Handling
- Ask for clarification on INVALID_ADDRESS errors
- Suggest pickup alternative for out-of-zone addresses
- Request location pins when address parsing fails
- Use report tool for NEXUS_CALL_FAILED errors
Organization Mode Considerations
- Always check if location was automatically switched
- Use returned locationId for subsequent menu operations
- Handle location switching errors gracefully
- Confirm location switch with customer when relevant
Address Formats Supported
Complete Addresses
- “123 Rue de la Paix, 75001 Paris, France”
- “45 Baker Street, London W1U 6TW”
- “Via Roma 15, 20121 Milano, Italy”
Partial Addresses (May Need Clarification)
- “Rue de Rivoli, Paris” (missing number)
- “75001” (postal code only)
- “Near the Louvre” (landmark reference)
Coordinate Formats
- Decimal degrees: 48.8566, 2.3522
- Google Maps links containing coordinates
- WhatsApp location pins
Flow Examples
Successful Delivery Setup
Address Outside Zone
Organization Mode Location Selection
Performance Notes
- Address validation typically takes 1-3 seconds
- Coordinate-based validation is faster than text parsing
- Organization mode requires checking multiple locations
- Results are not cached (addresses may change serviceability)
Security Considerations
- No customer address data is stored permanently by the tool
- Addresses are passed to Nexus API for geocoding
- Failed addresses are logged for debugging but contain no PII
- Location switching updates are tracked for audit purposes
check_address tool is the foundation of reliable delivery service, ensuring customers receive accurate information about serviceability, pricing, and timing before they invest time in placing an order.