Fix calendar tool execution: add calendar to CustomProvider valid_tools list

- Added calendar and other missing tools to valid_tools whitelist in CustomProvider
- This fixes issue where calendar tool calls were shown in response instead of being executed
- Also added edit_file, cron, email to the whitelist for completeness
This commit is contained in:
tanyar09
2026-03-05 16:52:34 -05:00
parent 760a7d776e
commit bc5f169bc8
4 changed files with 187 additions and 16 deletions
+25 -8
View File
@@ -124,33 +124,50 @@ When the scheduled time arrives, the cron system will send the message back to y
## Calendar Integration
When an email mentions a meeting (e.g., "meeting tomorrow at 2pm", "call scheduled for next week"), you should:
**CRITICAL: When processing emails that mention meetings, you MUST automatically schedule them in the calendar.**
When an email mentions a meeting (e.g., "meeting tomorrow at 2pm", "reminder about our meeting on March 7 at 15:00", "call scheduled for next week"), you MUST:
1. **Extract meeting details** from the email:
- Title/subject
- Date and time
- Title/subject (use email subject if no explicit title)
- Date and time (parse formats like "March 7 at 15:00", "tomorrow 2pm", etc.)
- Location (if mentioned)
- Attendees (email addresses)
2. **Use the `calendar` tool** to create the event:
2. **Check if meeting already exists** (optional but recommended):
- Use `calendar(action="list_events")` to check upcoming events
- Look for events with similar title/time
3. **Use the `calendar` tool** to create the event:
```
calendar(
action="create_event",
title="Meeting Title",
start_time="tomorrow 2pm", # or ISO format
end_time="tomorrow 3pm", # optional, defaults to 1 hour after start
start_time="March 7 15:00", # Use natural language format, NOT ISO format
end_time="March 7 16:00", # optional, defaults to 1 hour after start
location="Conference Room A", # optional
attendees=["colleague@example.com"] # optional
)
```
**CRITICAL:** Always use natural language time formats like "March 7 15:00" or "tomorrow 2pm".
**DO NOT** generate ISO format strings like "2024-03-06T19:00:00" - the calendar tool will parse
natural language correctly and handle the current year automatically. If you generate ISO format
with the wrong year (e.g., 2024 instead of 2026), the meeting will be scheduled in the past.
3. **Confirm to the user** that the meeting was scheduled.
4. **Confirm to the user** that the meeting was scheduled (include the calendar link if available).
**Time formats supported:**
- Month names: `"March 7 at 15:00"`, `"March 7th at 3pm"`, `"on March 7 at 15:00"`
- Relative: `"tomorrow 2pm"`, `"in 1 hour"`, `"in 2 days"`
- ISO format: `"2024-01-15T14:00:00"`
**Automatic scheduling:** If `auto_schedule_from_email` is enabled, automatically schedule meetings when detected in emails without asking the user first.
**Automatic scheduling:** When `auto_schedule_from_email` is enabled (default: true), automatically schedule meetings when detected in emails. Do NOT just acknowledge - actually create the calendar event using the `calendar` tool.
**Examples of emails that should trigger scheduling:**
- "Reminder about our meeting on March 7 at 15:00" → Schedule for March 7 at 3 PM
- "Meeting tomorrow at 2pm" → Schedule for tomorrow at 2 PM
- "Call scheduled for next week" → Extract date and schedule
## Heartbeat Tasks