What You’ll Build: An intelligent interview coordinator that automatically schedules interviews, sends confirmation emails to candidates, notifies your interview panel, and handles all follow-up communications.
Introduction
Coordinating interviews involves juggling multiple calendars, sending professional emails, and ensuring everyone has the right information at the right time. This tutorial shows you how to build an AI-powered interview coordinator that handles all of this automatically. The bot will:- Check calendar availability (using the authenticated user’s calendar)
- Create calendar events with multiple attendees
- Send professional confirmation emails to candidates
- Notify interview panel members with prep materials
- Request feedback from interviewers after completion
What You’ll Learn:
- Deploying Google Calendar and Gmail MCP servers
- Setting up OAuth for multiple Google services
- Creating an AI agent that coordinates between multiple tools
- Sending professional, AI-generated emails
- Managing complex multi-step workflows with Claude
Prerequisites
Before starting, make sure you have:- Metorial Account: Sign up and get your API key
- Google Workspace Account: With Calendar and Gmail access
- Anthropic API Key: Get one from Anthropic Console
- Development Environment: Node.js 18+ or Python 3.9+
Architecture Overview
Here’s how the interview coordinator works:- User provides interview details (candidate, role, date preferences, interviewers)
- AI checks calendar availability using Google Calendar MCP server (checks the authenticated user’s calendar)
- AI creates calendar event and adds interviewers as attendees
- AI sends confirmation email to candidate via Gmail
- AI sends prep email to interview panel via Gmail
Step 1: Deploy Google Calendar MCP Server
First, deploy the Google Calendar server from the Metorial catalog:Navigate to Server Catalog
Save your Calendar deployment ID - you’ll need it in Step 3. It looks like:
svd_abc123def456Note on Multiple Interviewers: This deployment accesses one Google Calendar (the authenticated user’s calendar). To check availability across multiple interviewers’ calendars, each interviewer would need their own Calendar MCP deployment and OAuth session. For simplicity, this tutorial uses a single calendar instance.Step 1b: Deploy Gmail MCP Server
Next, deploy the Gmail server for email communications:You now have two MCP servers deployed. Both will run in the same session, allowing the AI to coordinate between scheduling and email tools seamlessly.
Step 2: Set Up OAuth Authentication
Both Calendar and Gmail require OAuth authentication to access your Google Workspace.Authorize in Browser
Visit both URLs in your browser and complete the Google OAuth flow for Calendar and Gmail access. The script will wait for you to authorize before continuing.
OAuth Scopes: Calendar needs
calendar.events and calendar.readonly. Gmail needs gmail.send and gmail.readonly. These are configured automatically by Metorial.Step 3: Build the Interview Coordinator
Now let’s build the main coordinator that orchestrates interview scheduling and communications.Key Implementation Details:
- Single Session: Both Calendar and Gmail servers run in one session, allowing the AI to seamlessly switch between scheduling and emailing tools
- Agentic Workflow: The AI autonomously decides which tools to use and in what order - no explicit programming needed
- Anti-Hallucination: The prompt explicitly instructs using only actual calendar data to prevent AI from making up availability
- Professional Communications: AI generates context-appropriate emails for candidates and interviewers
Email Templates
The AI automatically generates professional emails tailored to each recipient. Here are examples of what the coordinator sends:Candidate Confirmation Email
Candidate Confirmation Email
Subject: Interview Scheduled - Senior Software EngineerBody:
Interviewer Prep Email
Interviewer Prep Email
Subject: Interview Prep - Sarah JohnsonBody:
Step 4: Test the Coordinator
Let’s test the coordinator with a realistic scenario:- Check availability on the authenticated user’s calendar (not all 3 interviewers - see note below)
- Find the first available slot (Feb 15 at 1:00 PM)
- Create a 90-minute calendar event with all 3 interviewers as attendees
- Send confirmation email to Alex with interview details
- Send prep email to all interviewers with candidate info
Calendar Availability Limitation: This example checks only the authenticated user’s calendar availability. To check all 3 interviewers’ calendars, you would need to deploy a separate Calendar MCP instance for each interviewer with their OAuth credentials. The interviewers array is used for adding attendees to the event and sending emails, not for checking their individual availability.
Troubleshooting
Calendar event not created
Calendar event not created
Possible causes:
- OAuth session expired or invalid
- Calendar API not enabled in Google Workspace
- Insufficient permissions (need
calendar.eventsscope) - No availability found in provided date range
- Re-run OAuth setup to refresh credentials
- Verify Calendar API is enabled at Google Cloud Console
- Check OAuth session has correct scopes in Metorial dashboard
- Expand preferred date range or reduce number of required attendees
Emails not being sent
Emails not being sent
Possible causes:
- OAuth session expired for Gmail
- Gmail API not enabled
- Insufficient permissions (need
gmail.sendscope) - Daily sending limit reached (500 emails/day for standard accounts)
- Re-run OAuth setup for Gmail specifically
- Enable Gmail API in Google Cloud Console
- Verify OAuth session includes
gmail.sendscope - Check your Gmail sending quota at Google Workspace Admin
Emails going to spam folder
Emails going to spam folder
Possible causes:
- Sending from unverified domain
- Email content triggers spam filters
- High volume of emails in short period
- Set up SPF and DKIM records for your sending domain
- Use professional, well-formatted email templates
- Add delays between bulk sends
- Test email content with spam checking tools
- Whitelist your sending address with recipients
AI creates event without checking availability
AI creates event without checking availability
Issue: Calendar event created despite conflictsSolution: This is likely a prompt issue. Ensure your prompt includes:The anti-hallucination instruction forces the AI to actually check calendars before proceeding.
Wrong people added to calendar event
Wrong people added to calendar event
Issue: Extra or missing attendeesSolution: Be explicit in your prompt about who should attend:Also verify the email addresses are correct in your request object.
Cannot check multiple interviewers' calendars
Cannot check multiple interviewers' calendars
Issue: Need to verify availability across multiple interviewers’ calendarsCurrent Limitation: A single Google Calendar MCP server instance can only access one calendar (the authenticated user’s calendar).Solution: To check availability across multiple interviewers:For this tutorial, we use a single calendar and add interviewers as attendees without checking their availability.
- Deploy a separate Calendar MCP server instance for each interviewer
- Set up individual OAuth sessions for each interviewer’s calendar
- Pass all calendar deployments to
serverDeploymentsarray in your session - Update your prompt to check all calendar instances before scheduling
Advanced Customization
Email Personalization
Customize email templates based on role, interview type, or company culture:Pass templates to your prompt for context-aware emails.
Multi-Stage Interviews
Coordinate complex interview pipelines:Schedule phone screen, technical, and panel interviews in sequence.
Feedback Collection
Request and aggregate interviewer feedback:Automate post-interview feedback workflow.
Calendar Preferences
Respect interviewer working hours and preferences:Include preferences in AI prompt for smarter scheduling.
Multi-Language Support
Send emails in candidate’s preferred language:AI automatically generates emails in requested language.
Multi-Calendar Support
Check availability across multiple interviewers’ calendars:Each interviewer needs their own Calendar MCP instance with OAuth.
Production Considerations
Before deploying to production:Error Handling
Add comprehensive error handling for common failures:Monitoring and Logging
Track key metrics for reliability:- Interview scheduling success rate
- Email delivery rate
- Calendar availability check duration
- AI tool call patterns
Testing Strategy
Test edge cases before production:- All interviewers unavailable on all dates
- Invalid email addresses
- Time zone edge cases (DST transitions)
- Calendar quota limits
- Gmail sending limits
Privacy and Compliance
Ensure GDPR/CCPA compliance:- Get consent before sending emails
- Don’t store candidate data longer than necessary
- Encrypt sensitive information in transit and at rest
Scalability
For high-volume hiring:- Implement request queuing to avoid rate limits
- Cache calendar availability queries
- Batch similar operations
- Use Metorial’s webhook support for async processing
What’s Next
Now that you have a working interview coordinator, explore more capabilities:SDK Documentation
Learn advanced SDK patterns and best practices
OAuth Guide
Deep dive into OAuth authentication flows
Monitoring Guide
Set up alerts and dashboards for your coordinator
Server Catalog
Explore more MCP servers to add capabilities