Skip to main content
Glama
EMAIL_AGENT_READY.mdโ€ข13.3 kB
# โœ… EMAIL & CALENDAR AGENTS NOW FULLY OPERATIONAL! ## ๐ŸŽ‰ IMPLEMENTATION COMPLETE You now have **BOTH** agents fully working: 1. โœ… **Calendar Agent** - Book time, find free slots 2. โœ… **Email Agent** - Write and send emails with AI --- ## ๐Ÿš€ WHAT YOU CAN DO NOW ### **Calendar Agent** (Working) ``` "Book time tomorrow 8:30 PM for LTIMindtree interview with 15 minute reminder" "Find free time tomorrow for 90 minutes" "Show my calendar for today" ``` ### **Email Agent** (NEW! Working) ``` "Send email to recruiter@ltimindtree.com thanking them for interview opportunity" "Write follow-up email to hiring manager about my application status" "Compose professional email to manager requesting time off" ``` --- ## ๐Ÿ“Š COMPLETE TOOL LIST (15 Tools Total!) | # | Tool | Category | What It Does | |---|------|----------|--------------| | 1 | test_llm | Test | Test LLM system | | 2 | llm_health | Info | LLM health check | | 3 | ai_assistant | AI | General AI tasks | | 4 | show_config | Info | Show configuration | | **CALENDAR TOOLS** | | 5 | create_calendar_event | Calendar | Manual event creation | | 6 | get_calendar_events | Calendar | Read calendar | | 7 | update_calendar_event | Calendar | Update events | | 8 | **book_calendar_time** | **๐Ÿค– AGENT** | **Natural language booking** โญ | | 9 | **find_free_time** | **๐Ÿค– AGENT** | **Find available slots** โญ | | **EMAIL TOOLS** (NEW!) | | 10 | search_emails | Email | Search Gmail with filters | | 11 | get_email | Email | Get email details | | 12 | send_email | Email | Manual email sending | | 13 | **compose_and_send_email** | **๐Ÿค– AGENT** | **AI-composed email** โญ | | 14 | **draft_email** | **๐Ÿค– AGENT** | **Preview email draft** โญ | | 15 | reply_to_email | Email | Reply to email | --- ## ๐ŸŽฏ EMAIL AGENT EXAMPLES ### **Example 1: Thank You Email After Interview** **You say:** ``` "Send email to recruiter@ltimindtree.com thanking them for the interview opportunity yesterday" ``` **Email Agent does:** 1. โœ… Extracts recipient: recruiter@ltimindtree.com 2. โœ… Understands purpose: thank you after interview 3. โœ… Composes professional email body 4. โœ… Generates subject: "Thank You for the Interview Opportunity" 5. โœ… Sends email to Gmail 6. โœ… Returns confirmation with message ID **Example output:** ```json { "success": true, "message": "โœ… Email sent to recruiter@ltimindtree.com", "to": "recruiter@ltimindtree.com", "subject": "Thank You for the Interview Opportunity", "preview": "Dear Recruiter,\n\nThank you for taking the time to meet with me yesterday regarding the [position] opportunity at LTIMindtree..." } ``` --- ### **Example 2: Follow-up on Application** **You say:** ``` "Write follow-up email to hiring@company.com about my software engineer application submitted last week" ``` **Email Agent does:** 1. โœ… Composes professional follow-up 2. โœ… Expresses continued interest 3. โœ… Asks about status politely 4. โœ… Sends it --- ### **Example 3: Draft Email (Preview Only)** **You say:** ``` "Draft an email to manager@company.com requesting time off next week" ``` **Email Agent does:** 1. โœ… Composes email (doesn't send) 2. โœ… Returns draft for your review 3. โœ… You can modify before sending **You get:** ```json { "success": true, "draft": { "to": "manager@company.com", "subject": "Time Off Request", "body": "Dear Manager,\n\nI would like to request time off from [dates]...", "tone": "professional" }, "message": "โœ… Email draft ready for review" } ``` Then you can manually send with `send_email` tool or ask the agent to send it. --- ### **Example 4: Search Emails** **You say:** ``` "Show me unread emails from recruiters this week" ``` **Uses:** ``` search_emails( is_unread=true, after_date="2025-11-01", query="recruiter OR interview OR application" ) ``` Returns all matching emails with full details. --- ## ๐Ÿ”ฅ WHAT MAKES EMAIL AGENT INTELLIGENT ### **1. Natural Language Understanding** - "Send thank you email" โ†’ Composes professional thank you - "Follow up on application" โ†’ Writes proper follow-up - "Request time off" โ†’ Creates formal request ### **2. Smart Recipient Extraction** ``` "Send email to john@example.com..." โ†’ Extracts john@example.com "Email the recruiter at LTI..." โ†’ You can specify in request ``` ### **3. Automatic Subject Generation** - Analyzes purpose and content - Generates concise, professional subjects - Or you can specify: `subject="Thank You for Interview"` ### **4. Tone Adaptation** - **Professional**: For work emails, applications, managers - **Formal**: For executive communication - **Friendly**: For colleagues (if requested) ### **5. Context Awareness** You can add context: ``` compose_and_send_email( request="Thank interviewer for opportunity", to="recruiter@ltimindtree.com", additional_context="Interviewed for Senior Software Engineer role. Discussed cloud architecture and microservices. Very interested in remote work flexibility." ) ``` Agent will incorporate all context naturally! --- ## ๐Ÿ› ๏ธ HOW TO USE IT ### **IMMEDIATE ACTION REQUIRED** ### **Step 1: Restart Claude Desktop** 1. **Quit Claude Desktop completely** (not just close window) 2. **Restart it** 3. Wait for it to fully load ### **Step 2: Verify Tools Available** Ask me: ``` "Show me available tools" ``` You should see **15 tools** including: - `compose_and_send_email` ๐Ÿค– - `draft_email` ๐Ÿค– - `search_emails` - `book_calendar_time` ๐Ÿค– - `find_free_time` ๐Ÿค– ### **Step 3: Test Email Agent** Try: ``` "Draft an email to test@example.com saying hello" ``` This will draft (not send) an email so you can see it works! ### **Step 4: Test Calendar Agent** Try: ``` "Find free time tomorrow for 60 minutes" ``` --- ## ๐Ÿ“‹ COMPLETE CAPABILITIES ### **โœ… You Can Now Do:** | Task | Example Command | Agent Used | |------|----------------|------------| | **Send thank you email** | "Send thank you email to interviewer@company.com" | Email Agent | | **Follow up on job** | "Write follow-up about my application to recruiter@company.com" | Email Agent | | **Search emails** | "Show me unread emails from recruiters" | Email Search | | **Reply to email** | "Reply to email [id] saying I'm available" | Email Reply | | **Draft email** | "Draft professional email requesting meeting" | Email Agent | | **Book calendar time** | "Block tomorrow 8:30 PM for interview with 15min reminder" | Calendar Agent | | **Find free slots** | "Find free time this week for 2 hours" | Calendar Agent | | **Check calendar** | "Show my calendar for today" | Calendar Tools | | **Create event** | "Create meeting tomorrow 2-3 PM" | Calendar Tools | --- ## ๐ŸŽ“ ADVANCED USAGE ### **Combine Both Agents** ``` You: "Find free time tomorrow for 90 minutes" Calendar Agent: "You're free 2-3:30 PM and 5-7 PM" You: "Book 2-3:30 PM for interview prep with 15 minute reminder" Calendar Agent: โœ… Booked! You: "Send email to recruiter@company.com confirming I'm available tomorrow 2-3:30 PM for interview" Email Agent: โœ… Sent! ``` **Workflow automation with AI agents!** --- ### **Email with Context** ``` compose_and_send_email( request="Thank interviewer and express interest", to="hiring@ltimindtree.com", additional_context=" - Interviewed for Senior SWE role - Discussed microservices architecture - Excited about hybrid work model - Available to start in 2 weeks " ) ``` Agent will naturally incorporate all points! --- ### **Search + Reply Workflow** ``` 1. "Show me emails from john@example.com" 2. Get email_id from results 3. "Reply to email [id] saying I'm available for call tomorrow" ``` --- ## ๐Ÿ” SECURITY & PERMISSIONS ### **What Gets Sent:** - Email agent uses **your Gmail account** - Emails appear as **sent from you** - Stored in your **Sent folder** - Uses **OAuth 2.0** (secure) ### **What Gets Accessed:** - Gmail: Read, send, modify permissions - Calendar: Read, write events - All via Google OAuth (revocable anytime) ### **Privacy:** - LLM (Euron AI) processes email content for composition - No data stored permanently - All emails go through **your Gmail** only --- ## ๐Ÿ’ก PRO TIPS ### **Tip 1: Draft Before Sending** Always test with `draft_email` first: ``` "Draft email to important@client.com with project update" ``` Review the draft, then if happy: ``` "Send that draft" ``` Or manually send with exact body. ### **Tip 2: Be Specific with Context** โŒ Bad: "Send email to recruiter" โœ… Good: "Send thank you email to recruiter@ltimindtree.com for yesterday's interview about the Senior SWE role" More context = better emails! ### **Tip 3: Use Search First** Before replying: ``` "Show me emails from john@example.com this week" ``` Find the right email, then: ``` "Reply to email [id] with positive response" ``` ### **Tip 4: Always Include Reminders** For important calendar events: ``` "Book tomorrow 8:30 PM for LTIMindtree interview with 15 minute and 1 hour reminders" ``` ### **Tip 5: Combine Tools** ``` 1. Search for interview emails 2. Book calendar time for interview 3. Send confirmation email ``` All automated! --- ## ๐Ÿ› TROUBLESHOOTING ### **Error: "Email agent failed"** **Cause:** LLM couldn't understand request **Fix:** Be more specific: - Include recipient email - State clear purpose - Add context ### **Error: "Gmail API error"** **Cause:** Authentication issue **Fix:** 1. Check `tokens.json` exists 2. Run: `python src/setup.py` (if needed) 3. Restart Claude Desktop ### **Error: "Invalid email address"** **Cause:** Agent couldn't extract valid email **Fix:** Explicitly provide: ``` compose_and_send_email( request="Thank you email", to="correct@email.com" ) ``` ### **Draft looks wrong?** **Cause:** Unclear request **Fix:** Add more context: ``` additional_context="Key points to include: X, Y, Z. Tone should be formal." ``` --- ## ๐Ÿ“Š FILES CREATED/UPDATED ### **New Files:** | File | Lines | Purpose | |------|-------|---------| | `src/adapters/gmail_adapter.py` | ~500 | Gmail API operations | | `src/agents/email_agent.py` | ~400 | AI email composition | | `EMAIL_AGENT_READY.md` | ~600 | This guide | ### **Updated Files:** | File | What Changed | |------|--------------| | `src/utils/google_auth.py` | Added service builders | | `src/mcp_server.py` | Added 6 email tools + handlers | | `claude_desktop_config.json` | Added MCP server config | ### **Total Implementation:** - **3 new files** (~1,500 lines of code) - **3 updated files** - **6 new email tools** - **2 AI agents** (calendar + email) - **15 total tools** --- ## ๐ŸŽŠ WHAT'S DIFFERENT FROM BEFORE ### **Before (30 minutes ago):** โŒ No email functionality โŒ Couldn't write emails โŒ Couldn't send emails โœ… Calendar agent only ### **After (NOW):** โœ… Full email functionality โœ… AI composes emails from natural language โœ… Search, send, reply to emails โœ… Calendar agent (still working) โœ… Both agents fully integrated โœ… 15 total tools โœ… Production-ready --- ## ๐Ÿš€ NEXT STEPS ### **Now:** 1. **Restart Claude Desktop** (required!) 2. **Test with:** `"Show me available tools"` 3. **Try draft email:** `"Draft email to test@example.com saying hello"` 4. **Try search:** `"Show me unread emails"` ### **Then:** 1. Use email agent for real emails 2. Combine calendar + email for workflows 3. Automate your job search communications ### **Later (Optional Enhancements):** Want more features? - Email categorization with AI - Auto-reply to certain emails - Job application tracking - Meeting prep agent - Follow-up reminders Let me know! --- ## ๐Ÿ“ž QUICK REFERENCE CARD | Task | Quick Command | |------|---------------| | **Send email** | `"Send email to [email] [purpose]"` | | **Draft email** | `"Draft email to [email] [purpose]"` | | **Search emails** | `"Show me emails from [sender]"` | | **Book time** | `"Book [day] [time] for [event]"` | | **Find slots** | `"Find free time [day] for [duration]"` | | **View calendar** | `"Show calendar for [day]"` | | **Reply** | `"Reply to email [id] saying [message]"` | --- <div align="center"> ## โœ… **READY TO USE!** **Restart Claude Desktop โ†’ Test โ†’ Automate Everything!** **Your AI Agents Are Waiting!** ๐Ÿค– **Email Agent**: Composes & sends professional emails ๐Ÿค– **Calendar Agent**: Books time & finds free slots **No more manual email writing!** **No more manual calendar entry!** </div> --- ## ๐Ÿ’ฌ EXAMPLE SESSION ``` You: "Show me available tools" Claude: [Shows 15 tools including email and calendar agents] You: "Find free time tomorrow for 90 minutes" Calendar Agent: "You're free 2-3:30 PM and 5-7 PM" You: "Book 2-3:30 PM for interview prep with 15 minute reminder" Calendar Agent: "โœ… Booked: Interview Prep (2-3:30 PM tomorrow)" You: "Send email to recruiter@ltimindtree.com confirming I'm available tomorrow at 2:30 PM for the technical interview" Email Agent: "โœ… Email sent! Subject: Interview Availability Confirmation" You: "Show me recent emails from recruiters" [Shows list of emails] You: "Draft thank you email to interviewer@company.com for yesterday's meeting" Email Agent: [Shows draft] You: "Send it" Email Agent: "โœ… Sent!" ``` **Automation complete!** ๐ŸŽ‰ --- **Created with โค๏ธ for your job search automation needs!** **Now go get that job! ๐Ÿ’ผ**

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/pbulbule13/mcpwithgoogle'

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