| name | msgraph-calendar |
| description | How to read, create, update, and manage Outlook calendar events via the Microsoft Graph CLI (mgc). Use this skill whenever the user wants to work with their Microsoft 365 calendar — listing events, checking the week's schedule, creating meetings, accepting or declining invitations, finding available meeting times, or managing Teams online meetings. |
Microsoft Graph CLI — Calendar
Binary
./mgc-cli/mgc
Use --user-id me in all commands to target the currently signed-in user.
Global flags (quick reference)
| Flag | Purpose |
|---|
--select <fields> | OData $select — comma-separated field names |
--filter <expr> | OData $filter |
--orderby <field> | OData $orderby |
--top <n> | Page size |
--all | Auto-paginate all results |
--output JSON|TABLE|TEXT|RAW_JSON|NONE | Output format |
--debug | Print full HTTP request/response |
List calendars
mgc users calendars list --user-id me --select "id,name,isDefaultCalendar"
Calendar view — preferred for time-range queries
calendar-view expands recurring event instances correctly. Use it instead of events list when querying by time window.
mgc users calendar-view list --user-id me \
--start-date-time "2026-04-07T00:00:00" \
--end-date-time "2026-04-13T23:59:59" \
--select "id,subject,start,end,location,isAllDay,organizer,attendees" \
--all
--start-date-time and --end-date-time are required (ISO 8601).
List events (no time-range filter)
mgc users events list --user-id me \
--filter "start/dateTime ge '2026-04-07T00:00:00'" \
--select "id,subject,start,end,location,organizer" \
--orderby "start/dateTime"
Get a specific event
mgc users events get --user-id me --event-id <id> \
--select "id,subject,body,start,end,location,attendees,organizer,isOnlineMeeting,onlineMeeting"
Create an event
mgc users events create --user-id me --body '{
"subject": "Team Sync",
"start": { "dateTime": "2026-04-10T10:00:00", "timeZone": "Europe/Vienna" },
"end": { "dateTime": "2026-04-10T11:00:00", "timeZone": "Europe/Vienna" },
"location": { "displayName": "Conference Room A" },
"body": { "contentType": "HTML", "content": "<p>Agenda here.</p>" },
"attendees": [
{
"emailAddress": { "address": "colleague@example.com", "name": "Colleague" },
"type": "required"
}
],
"isOnlineMeeting": true,
"onlineMeetingProvider": "teamsForBusiness"
}'
Always include timeZone in event bodies — omitting it defaults to UTC.
Update an event
mgc users events patch --user-id me --event-id <id> --body '{
"subject": "Updated title",
"start": { "dateTime": "2026-04-10T11:00:00", "timeZone": "Europe/Vienna" },
"end": { "dateTime": "2026-04-10T12:00:00", "timeZone": "Europe/Vienna" }
}'
Delete an event
mgc users events delete --user-id me --event-id <id>
Accept / decline / tentatively accept
mgc users events accept post --user-id me --event-id <id> \
--body '{ "sendResponse": true, "comment": "Looking forward to it!" }'
mgc users events decline post --user-id me --event-id <id> \
--body '{ "sendResponse": true, "comment": "Sorry, I have a conflict." }'
mgc users events tentatively-accept post --user-id me --event-id <id> \
--body '{ "sendResponse": true }'
Find meeting times
mgc users find-meeting-times post --user-id me --body '{
"attendees": [
{ "emailAddress": { "address": "colleague@example.com" }, "type": "required" }
],
"timeConstraint": {
"timeslots": [{
"start": { "dateTime": "2026-04-07T08:00:00", "timeZone": "Europe/Vienna" },
"end": { "dateTime": "2026-04-07T18:00:00", "timeZone": "Europe/Vienna" }
}]
},
"meetingDuration": "PT1H"
}'
Capture created event ID in a script
EVENT_ID=$(mgc users events create --user-id me --body '...' \
| python3 -c "import sys,json; print(json.load(sys.stdin)['id'])")
Troubleshooting
401 Unauthorized → missing scopes; run mgc logout then mgc login --scopes Calendars.ReadWrite
- Always include
timeZone in start/end objects — omitting it silently defaults to UTC
- Use
calendar-view (not events list) when you need recurring instances expanded in a time range
- Use
--debug to inspect the raw HTTP request/response