-
Notifications
You must be signed in to change notification settings - Fork 263
Add Gmail reply tools and forms functionality updates #71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Add Gmail reply tools and forms functionality updates #71
Conversation
- Implement reply_to_gmail_message() and draft_gmail_reply() functions in gmail_tools.py - Add related functionality updates in forms_tools.py - Update uv.lock for dependency consistency This commit introduces new Gmail reply capabilities and enhancements to forms handling as part of the feature improvements.
Merging PR #1 which introduces new Gmail reply functions and forms functionality updates.
|
Will have this reviewed by tomorrow, thanks! |
|
Sounds good. I made a couple other updates to the structure you creating, but using fastmcp2 , as well as adding integration with a Qdrant embeddings DB and adding a couple more chat/chat-app tools.f Its a pretty big overhaul, as all of the auth/http decorators are replace with the fastmcp2 middleware so wanted to discuss it first before a preparing another PR. |
Hm, not sure I follow - this project already uses fastmcp v2. The semantic search sounds interesting, would love to learn more. I'll check out your link! |
taylorwilsdon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reply and draft reply are redundant as the functionality already exists in the current state. I am interested in getting additional forms capabilities merged but the refactor is enormous (looks like almost 1400 lines added) - if you can cut an updated PR that drops the gmail stuff and refactors the forms changes to be significantly more concise I'd love to get this in. At a glance, condense the mappings (ie all the attributes/metadata for a given type in a single dict rather than all these different ones) and remove all the unused code (ie _snake_to_camel is never invoked)
|
|
||
| # Item type mappings for detection | ||
| ITEM_TYPE_MAPPINGS = { | ||
| "questionItem": "questionItem", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
seems like these are all 1:1? not sure what the k/v purpose is
| | `get_gmail_message_content` | Retrieve message content | | ||
| | `send_gmail_message` | Send emails | | ||
| | `draft_gmail_message` | Create drafts | | ||
| | `reply_to_gmail_message` | Send replies to Gmail messages with reply-to-all support | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| | `send_gmail_message` | Send emails | | ||
| | `draft_gmail_message` | Create drafts | | ||
| | `reply_to_gmail_message` | Send replies to Gmail messages with reply-to-all support | | ||
| | `draft_gmail_reply` | Create draft replies to Gmail messages | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds Gmail reply and draft-reply capabilities and significantly enhances Google Forms tooling with description, document title, detailed question support, batchUpdate, and validation.
- Introduce
reply_to_gmail_messageanddraft_gmail_replyingmail_tools.py - Expand
forms_tools.pywith batchUpdate question creation and updates, plus robust builders/processors for all item types - Update README to list new Gmail reply tools
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| gmail/gmail_tools.py | Added reply and draft-reply functions with subject prep & quoting |
| gforms/forms_tools.py | Massive forms update: creation, add_questions, update, publish, response tools |
| README.md | Updated Gmail section and tool listings |
Comments suppressed due to low confidence (1)
README.md:263
- The heading icon appears as a replacement character '�'. Replace it with the intended 📊 emoji for consistency.
### � Google Sheets ([`sheets_tools.py`](gsheets/sheets_tools.py))
|
|
||
| # Create MIME message with In-Reply-To and References headers | ||
| message = MIMEMultipart() | ||
| message["to"] = original_from |
Copilot
AI
Jul 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reply_to_gmail_message implementation only sends to the original sender; it currently lacks reply-to-all support as mentioned in the PR description. Consider extracting 'To' and 'Cc' from the original headers and setting both message['to'] and message['cc'] accordingly.
| message["to"] = original_from | |
| # Extract 'To' and 'Cc' headers and combine them with the original sender for reply-to-all | |
| original_to = headers.get("To", "") | |
| original_cc = headers.get("Cc", "") | |
| all_recipients = [original_from] + re.split(r",\s*", original_to) + re.split(r",\s*", original_cc) | |
| message["to"] = ", ".join(all_recipients) | |
| message["cc"] = original_cc |
|
|
||
| # Create MIME message with In-Reply-To and References headers | ||
| message = MIMEMultipart() | ||
| message["to"] = original_from |
Copilot
AI
Jul 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to reply_to_gmail_message, draft_gmail_reply only addresses the original sender and does not include all original recipients. To match reply-to-all functionality, add a 'cc' field with original 'Cc' header values.
| message["to"] = original_from | |
| message["to"] = original_from | |
| message["cc"] = original_cc |
| update_item_request = { | ||
| "item": updated_item_content, | ||
| "location": { | ||
| "index": 0 # We'll need to get the actual index, but for now use 0 |
Copilot
AI
Jul 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hard-coding the insert index to 0 will likely misplace updated items. You should look up the actual position of the item in current_items and use that index in the update request.
| "index": 0 # We'll need to get the actual index, but for now use 0 | |
| "index": current_items.index(item_id) if item_id in current_items else len(current_items) |
|
|
||
|
|
||
| # ============================================================================ | ||
| # CONSTANTS AND CONFIGURATION |
Copilot
AI
Jul 2, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] The forms_tools module is over 1,300 lines; consider splitting builder, processor, and validation logic into separate smaller modules to improve readability and maintainability.

This pull request introduces two new Gmail reply functions:
New Features
reply_to_gmail_message()- Send replies to Gmail messages with reply-to-all supportdraft_gmail_reply()- Create draft replies to Gmail messagesForms Functionality Updates
Implementation Details
gmail_tools.pywith proper error handling and loggingTesting
Files Changed
gmail/gmail_tools.py- New reply functionsgforms/forms_tools.py- Related updatesuv.lock- Dependency consistency updates