Extraction · beginner
Email → calendar event
Detect meeting requests in email and emit a structured event with start/end in ISO format.
Inbox copilot: when an email proposes a meeting, surface a one-click 'add to calendar' with the right time, attendees, and title.
The prompt
Copy this verbatim. Replace the {{ … }} placeholders with your values.
<instructions>
Determine whether the email proposes a specific meeting time. If yes, extract the event.
If no, return {"is_meeting": false}.
Assume the reader's timezone is in <user_tz>. Convert times to that timezone if the email gives a different one.
Today's date is in <today>.
Return JSON inside <result> tags.
</instructions>
<user_tz>America/Los_Angeles</user_tz>
<today>{{ today_iso }}</today>
<format>
{
"is_meeting": true,
"title": "string",
"start": "ISO-8601 with timezone",
"end": "ISO-8601 with timezone",
"attendees": ["string"],
"location": "string or null",
"notes": "string or null"
}
</format>
<email>{{ email_body }}</email>
Return inside <result> tags.
Sample input
Hi — let's sync on the launch this Thursday at 3pm PT for 30 min. Zoom: https://zoom.us/j/123. — Sam
Expected output
<result>
{
"is_meeting": true,
"title": "Launch sync",
"start": "2026-05-28T15:00:00-07:00",
"end": "2026-05-28T15:30:00-07:00",
"attendees": ["Sam"],
"location": "https://zoom.us/j/123",
"notes": null
}
</result>
Notes & tuning tips
- Passing
and is what makes "this Thursday at 3pm" resolvable. - If the email is ambiguous ("sometime next week"), the model should set is_meeting=false rather than guess.
- Validate the resulting ISO timestamp parses cleanly in your calendar library before showing the user the button.
What this example uses
Tags: <instructions> <context> <format>
Patterns: structured output
More like this
extraction
Structured JSON extractor from email
Pull sender, subject, intent, urgency, and action items from a raw email body.
extractionInvoice / receipt line-item extractor
Convert an OCR'd invoice into structured JSON: vendor, totals, line items.
extractionRésumé → structured JSON
Convert a free-form résumé into a normalized candidate profile.
Cite this page
Email → calendar event. claudexml.com. https://claudexml.com/examples/email-to-calendar-event/