Red pushpin marking the first day on a calendar grid, highlighting an appointment date.

Building with the GitHub Copilot SDK, Part 5: Pulling Calendar Data from Outlook

In my previous post, I added Mermaid.js diagram generation to the Design tab of Chad’s Copilot. Copilot read the workspace, generated valid diagram syntax from plain-language prompts, and made architecture docs something you’d actually keep up to date.

This post is about something different. I wanted to pull in Outlook calendar data and make it genuinely useful — not just a meeting list, but something that tells you how much of your week is already spoken for.

Why Outlook / Microsoft Graph?

Most of us live in Outlook whether we love it or not. That’s where meetings land, focus time gets scheduled, and weeks fill up before we notice.

Microsoft Graph is the API that exposes all of that data, and it’s well-designed. Getting it running smoothly inside an Electron desktop app, though that took some figuring out.

Here’s How I Did It

There are three things that had to work for this to be useful.

1. Authentication That Doesn’t Get in the Way

The challenge with OAuth in a desktop app is that you need somewhere to catch the redirect. Browsers expect a URL. Electron doesn’t have one.

I solved this with @azure/msal-node and a small local HTTP server trick. When the user kicks off authentication, I spin up a temporary server on localhost, redirect them to the Microsoft login page, and catch the OAuth code when it comes back. Once I have the code, I shut the server down. The whole thing takes a second and stays out of the way.

2. Sync That Makes the UI Feel Fast

Calendar data is stored locally in SQLite. A background sync process pulls the last four months of events from Microsoft Graph and writes them into the local database. When you open the calendar view, it renders immediately. No network wait, no loading spinner.

This matters more than it might seem. A calendar view that loads in 50ms feels like part of your tool. One that hangs for two seconds feels like an interruption.

3. Numbers That Actually Tell You Something

This is the part I’m most pleased with. In the week and month views, I calculate two things:

  • Allocated % — how much of your normal work hours are already committed to meetings
  • Deep Work Potential — how many solid, uninterrupted focus blocks you still have left
Calendar weekly summary for Feb 22–28, 2026 showing 69% time allocated and 16% deep work, with daily best deep‑work time windows Monday through Friday.

The math behind these isn’t complicated. But seeing those two numbers every day changes how you think about your week. I catch myself protecting focus blocks I would have given away before, because I can see exactly what I’m trading when I say yes to another meeting.

What’s Coming Next

You’ll have to check back next week to find out.

If you have suggestions or questions, ping me on X at @chadmichel.

author avatar
Chad Michel Chief Technology Officer
Chad is a lifelong Nebraskan. He grew up in rural Nebraska and now lives in Lincoln. Chad and his wife have a son and daughter.

Related posts