Skip to main content

Overview

This example demonstrates end-to-end testing of an AI calendar agent that can:
  • Check user availability
  • Create calendar events
  • Handle conflicts
  • Send notifications

Complete Test Suite

test.json

Setup

Create a .env file with your OpenAI API key:
.env

Running the Tests

Expected output:

Test Breakdown

Test 1: Basic Scheduling

Validates the happy path where the agent successfully schedules a meeting:
  1. Check conflicts - Agent must check availability first
  2. Create event - Agent creates the meeting with correct details
  3. Send notifications - Agent notifies attendees

Test 2: Conflict Handling

Validates the agent handles conflicts gracefully:
  • Detects existing meetings
  • Informs user about conflicts
  • Does NOT create conflicting events
  • Offers alternatives

Test 3: Multiple Attendees

Ensures the agent correctly handles group meetings:
  • Validates attendee list is preserved
  • Checks userId is correct
  • Verifies all required fields

Key Patterns

Tool Order Validation

Forbidden Actions

Argument Validation

Integration with Real Calendar API

Replace MockData with actual API calls:

Advanced Scenarios

Testing Retry Logic

Testing Time Zones

Next Steps

Tool Validation

Learn advanced tool validation

Multi-turn Conversations

Test conversational AI agents

Error Handling

Handle errors gracefully

ValidateTools Block

Complete tool validation docs