- Add `_extract_mcp_content_text()` helper in naliia_tools.py to safely
extract text from MCP results, preventing IndexError on empty content
- Replace all direct `result.content[0].text` accesses with safe helper
- Improve customer identification with preservation of existing state
- Add proper JSON parsing with fallback and error handling
- Simplify webhook state management (use agent's checkpointer internally)
- Update system prompt to remove check_mcp_connection tool reference
- Fix tests to use async mocks and correct expected values
- Agent now auto-calls find_customer_by_identifier when user provides identifier
- Added register_customer and check_mcp_connection tools
- Refactored chat_hook to resume existing conversations from state
- Reduced default max_iterations (100) and timeout (15s)
- Update prompt to use customer name for personalized greetings
- Pass state to tools via agent execution
- schedule_appointment now gets customer_id from state if not provided
- Add find_customer_by_identifier tool to NaliiaTools
- Add customer_name and customer_id to MessagesState schema
- Update NALIIA_PROMPT template with new tools
- Integrate customer lookup in chat webhook using phone number