Skip to main content
Glama
test_meeting_scheduler_flow.pyβ€’11.3 kB
""" Meeting Scheduler Flow Test Demonstrates how IRIS would use MCP tools to schedule meetings. This is a simulation showing the conversation flow and tool calls. """ def simulate_internal_meeting_flow(): """ Simulate: "Schedule meeting with Giovanni and Daniele next week" """ print("=" * 70) print("WORKFLOW 1: INTERNAL MEETING (Multi-participant)") print("=" * 70) print("\nπŸ‘€ USER: \"Schedule meeting with Giovanni and Daniele next week\"\n") # Step 1: Search first participant print("πŸ€– IRIS: Searching for 'Giovanni'...") print(" πŸ“‘ TOOL CALL: GET /user/search?query=Giovanni") print(" πŸ“₯ RESPONSE:") giovanni_results = [ { "displayName": "Giovanni Albero", "mail": "giovanni.albero@infocert.it", "jobTitle": "Responsabile IT Infrastrutture", "department": "Technology", "officeLocation": "Roma" }, { "displayName": "Giovanni Bianchi", "mail": "giovanni.bianchi@infocert.it", "jobTitle": "HR Manager", "department": "Human Resources", "officeLocation": "Milano" } ] for i, user in enumerate(giovanni_results, 1): print(f" {i}. {user['displayName']} - {user['jobTitle']} - {user['mail']}") print("\nπŸ€– IRIS: \"I found 2 people named Giovanni:") print(" 1. Giovanni Albero - Responsabile IT Infrastrutture - giovanni.albero@infocert.it") print(" 2. Giovanni Bianchi - HR Manager - giovanni.bianchi@infocert.it") print(" Which one?\"\n") print("πŸ‘€ USER: \"The first one\"\n") # Step 2: Search second participant print("πŸ€– IRIS: Got it! Now searching for 'Daniele'...") print(" πŸ“‘ TOOL CALL: GET /user/search?query=Daniele") print(" πŸ“₯ RESPONSE:") daniele_results = [ { "displayName": "Daniele Castellari", "mail": "daniele.castellari@infocert.it", "jobTitle": "Senior Software Engineer", "department": "Technology", "officeLocation": "Roma" } ] for i, user in enumerate(daniele_results, 1): print(f" {i}. {user['displayName']} - {user['jobTitle']} - {user['mail']}") print("\nπŸ€– IRIS: \"Found Daniele Castellari - Senior Software Engineer\"\n") # Step 3: Find common availability print("πŸ€– IRIS: Checking availability for you, Giovanni Albero, and Daniele Castellari next week...") print(" πŸ“‘ TOOL CALL: POST /calendar/findMeetingTimes") print(" πŸ“€ REQUEST BODY:") print(" {") print(" \"attendees\": [") print(" \"YYI9910@infocert.it\", // You (Filippo)") print(" \"giovanni.albero@infocert.it\",") print(" \"daniele.castellari@infocert.it\"") print(" ],") print(" \"duration\": 60,") print(" \"start_time\": \"2025-10-20T08:00:00Z\",") print(" \"end_time\": \"2025-10-24T18:00:00Z\",") print(" \"max_candidates\": 7") print(" }") print(" πŸ“₯ RESPONSE:") meeting_slots = [ {"start": "2025-10-20T10:00:00", "end": "2025-10-20T11:00:00", "confidence": 100}, {"start": "2025-10-20T14:00:00", "end": "2025-10-20T15:00:00", "confidence": 100}, {"start": "2025-10-21T09:00:00", "end": "2025-10-21T10:00:00", "confidence": 100}, {"start": "2025-10-22T15:00:00", "end": "2025-10-22T16:00:00", "confidence": 100}, ] for i, slot in enumerate(meeting_slots, 1): print(f" {i}. {slot['start']} - {slot['end']} (confidence: {slot['confidence']}%)") print("\nπŸ€– IRIS: \"Great! You're all free at these times:") print(" 1. Monday 20th at 10:00-11:00") print(" 2. Monday 20th at 14:00-15:00") print(" 3. Tuesday 21st at 09:00-10:00") print(" 4. Wednesday 22nd at 15:00-16:00") print(" Which works best?\"\n") print("πŸ‘€ USER: \"Tuesday morning\"\n") # Step 4: Create meeting print("πŸ€– IRIS: Perfect! Creating Teams meeting for Tuesday 21st at 9am...") print(" πŸ“‘ TOOL CALL: POST /calendar/events") print(" πŸ“€ REQUEST BODY:") print(" {") print(" \"subject\": \"Team Meeting\",") print(" \"start_datetime\": \"2025-10-21T09:00:00Z\",") print(" \"end_datetime\": \"2025-10-21T10:00:00Z\",") print(" \"attendees\": [") print(" \"giovanni.albero@infocert.it\",") print(" \"daniele.castellari@infocert.it\"") print(" ],") print(" \"is_online_meeting\": true,") print(" \"body\": \"Meeting scheduled by IRIS\"") print(" }") print(" πŸ“₯ RESPONSE:") print(" {") print(" \"success\": true,") print(" \"event\": {") print(" \"id\": \"AAMkAGI1...\",") print(" \"subject\": \"Team Meeting\",") print(" \"onlineMeeting\": {") print(" \"joinUrl\": \"https://teams.microsoft.com/l/meetup/...\"") print(" }") print(" }") print(" }") print("\nπŸ€– IRIS: \"βœ… Done! Meeting created for Tuesday, October 21st at 9:00 AM.") print(" Participants: You, Giovanni Albero, Daniele Castellari") print(" Teams link: https://teams.microsoft.com/l/meetup/...") print(" Calendar invites sent to everyone!\"\n") print("βœ… WORKFLOW COMPLETE\n") def simulate_mixed_meeting_flow(): """ Simulate: "Meeting with Giovanni and external@company.com" """ print("=" * 70) print("WORKFLOW 3: MIXED MEETING (Internal + External)") print("=" * 70) print("\nπŸ‘€ USER: \"Set up meeting with Giovanni and mario.rossi@external.com\"\n") # Step 1: Search Giovanni print("πŸ€– IRIS: Searching for 'Giovanni'...") print(" πŸ“‘ TOOL CALL: GET /user/search?query=Giovanni") print(" πŸ“₯ RESPONSE: [2 results]") print("\nπŸ€– IRIS: \"I found 2 people named Giovanni:") print(" 1. Giovanni Albero - Responsabile IT - giovanni.albero@infocert.it") print(" 2. Giovanni Bianchi - HR Manager - giovanni.bianchi@infocert.it") print(" Which one?\"\n") print("πŸ‘€ USER: \"Giovanni Albero\"\n") # Step 2: Recognize external print("πŸ€– IRIS: Detected participants:") print(" 🏒 INTERNAL: Giovanni Albero (giovanni.albero@infocert.it)") print(" 🌍 EXTERNAL: mario.rossi@external.com\n") # Step 3: Find internal availability print("πŸ€– IRIS: Checking when you and Giovanni are both free...") print(" πŸ“‘ TOOL CALL: POST /calendar/findMeetingTimes") print(" πŸ“€ REQUEST BODY:") print(" {") print(" \"attendees\": [") print(" \"YYI9910@infocert.it\",") print(" \"giovanni.albero@infocert.it\"") print(" ],") print(" \"duration\": 60,") print(" \"start_time\": \"2025-10-20T08:00:00Z\",") print(" \"end_time\": \"2025-10-27T18:00:00Z\",") print(" \"max_candidates\": 10") print(" }") print(" πŸ“₯ RESPONSE: [7 common slots found]") print("\nπŸ€– IRIS: \"You and Giovanni are both free at:") print(" 1. Monday 10:00-11:00") print(" 2. Monday 14:00-15:00") print(" 3. Tuesday 09:00-10:00") print(" 4. Tuesday 14:00-15:00") print(" 5. Wednesday 10:00-11:00") print(" 6. Thursday 15:00-16:00") print(" 7. Friday 11:00-12:00") print("") print(" Which 2-3 should I propose to Mario Rossi?\"\n") print("πŸ‘€ USER: \"1, 3, and 5\"\n") # Step 4: Confirmation print("πŸ€– IRIS: \"I'll email Mario Rossi proposing these times:") print(" β€’ Monday, October 20th at 10:00-11:00") print(" β€’ Tuesday, October 21st at 09:00-10:00") print(" β€’ Wednesday, October 22nd at 10:00-11:00") print("") print(" Participants: You (Filippo Savarese), Giovanni Albero, Mario Rossi") print(" Should I send? (yes/no)\"\n") print("πŸ‘€ USER: \"yes\"\n") # Step 5: Send email print("πŸ€– IRIS: Sending email to Mario...") print(" πŸ“‘ TOOL CALL: POST /email/send") print(" πŸ“€ REQUEST BODY:") print(" {") print(" \"to\": [\"mario.rossi@external.com\"],") print(" \"subject\": \"Meeting Request - Filippo Savarese, Giovanni Albero\",") print(" \"body\": \"<html>...") print(" Dear Mario,") print("") print(" We would like to schedule a meeting with you.") print("") print(" Participants:") print(" - Filippo Savarese (YYI9910@infocert.it)") print(" - Giovanni Albero (giovanni.albero@infocert.it)") print(" - Mario Rossi (mario.rossi@external.com)") print("") print(" Please let us know which of these times works best:") print("") print(" A) Monday, October 20th at 10:00-11:00 (UTC)") print(" B) Tuesday, October 21st at 09:00-10:00 (UTC)") print(" C) Wednesday, October 22nd at 10:00-11:00 (UTC)") print("") print(" Please reply with your preferred option (A, B, or C).") print("") print(" Best regards,") print(" Filippo Savarese") print(" ...</html>\",") print(" \"body_type\": \"HTML\"") print(" }") print(" πŸ“₯ RESPONSE: {\"success\": true}") print("\nπŸ€– IRIS: \"βœ… Email sent to Mario Rossi!") print(" I'll monitor for his response and let you know when he replies.\"\n") print(" [IRIS monitors inbox using GET /email/messages with filter]") print(" [When response arrives, IRIS parses it and creates the meeting]") print("\nβœ… WORKFLOW COMPLETE (waiting for external response)\n") def main(): """Run flow simulations.""" print("\n" + "="*70) print("MEETING SCHEDULER - FLOW SIMULATIONS") print("Demonstrating how IRIS orchestrates MCP tools via conversation") print("="*70 + "\n") simulate_internal_meeting_flow() simulate_mixed_meeting_flow() print("="*70) print("SUMMARY") print("="*70) print("\nβœ… Key Takeaways:") print(" 1. IRIS decides which tools to call based on conversation context") print(" 2. Tools are atomic: search, find slots, create meeting, send email") print(" 3. Logic is in the PROMPT, not hardcoded workflows") print(" 4. Natural conversation maintains state across turns") print(" 5. User controls the flow via natural language responses") print("\nβœ… MCP Tools Used:") print(" β€’ GET /user/search - Find internal users") print(" β€’ POST /calendar/findMeetingTimes - Find common availability") print(" β€’ POST /calendar/events - Create Teams meeting") print(" β€’ POST /email/send - Send proposals to externals") print(" β€’ GET /email/messages - Monitor responses") print("\nβœ… Next Steps:") print(" 1. Integrate prompt into IRIS system prompt") print(" 2. Test with valid OAuth tokens") print(" 3. Test end-to-end via Telegram bot") print("\n" + "="*70 + "\n") if __name__ == "__main__": main()

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ilvolodel/iris-legacy'

If you have feedback or need assistance with the MCP directory API, please join our Discord server