ms-graph-calendar

Find available meeting times and free/busy slots for company employees using Microsoft Graph API. Use when user asks to schedule a meeting, find a free slot, check when employees are available, or look up someone's calendar availability.

3,891 stars

Best use case

ms-graph-calendar is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Find available meeting times and free/busy slots for company employees using Microsoft Graph API. Use when user asks to schedule a meeting, find a free slot, check when employees are available, or look up someone's calendar availability.

Teams using ms-graph-calendar should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/ms-graph-calendar/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/artisong/ms-graph-calendar/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/ms-graph-calendar/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How ms-graph-calendar Compares

Feature / Agentms-graph-calendarStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Find available meeting times and free/busy slots for company employees using Microsoft Graph API. Use when user asks to schedule a meeting, find a free slot, check when employees are available, or look up someone's calendar availability.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# Microsoft Graph Calendar — Find Free Slots

Use this skill when the user wants to:
- Find a time when multiple employees are all free
- Check if a specific person is available at a given time
- List upcoming meetings / busy blocks for one or more people
- Suggest meeting slots across the company

## Setup (ทำครั้งแรกครั้งเดียว)

ถ้าผู้ใช้ยังไม่เคย setup หรือระบบแจ้งว่าขาด credentials ให้ทำดังนี้:

1. ถามผู้ใช้ 3 ค่านี้ทีละค่า:
   - AZURE_TENANT_ID (Azure Portal → Azure Active Directory → Overview)
   - AZURE_CLIENT_ID (App registrations → your app → Application (client) ID)
   - AZURE_CLIENT_SECRET (App registrations → your app → Certificates & secrets)

2. เมื่อได้ครบแล้ว รันคำสั่ง:
```bash
node skills/ms-graph-calendar/scripts/setup.js \
  --tenant-id <AZURE_TENANT_ID> \
  --client-id <AZURE_CLIENT_ID> \
  --client-secret <AZURE_CLIENT_SECRET>
```

ค่าจะถูกบันทึกไว้ที่ `~/.openclaw/ms-graph-calendar.json` (permission 600) และจะถูกโหลดอัตโนมัติทุกครั้งที่ใช้ skill

3. ทดสอบด้วย:
```bash
node skills/ms-graph-calendar/scripts/get-token.js
```
ถ้าได้ "✅ Token acquired" แปลว่าพร้อมใช้งานแล้ว

**App Registration ต้องมี Application Permissions:**
- `Calendars.Read` — read all users' calendars
- `User.Read.All` — list employees
- Admin ต้อง Grant consent ก่อน

---

## Configuration

Authentication is cached after first login. No environment variables required for device code flow.

For headless/automated operation, set these environment variables:
- AZURE_CLIENT_ID - Azure AD app client ID
- AZURE_CLIENT_SECRET - Azure AD app secret
- AZURE_TENANT_ID - Tenant ID (use "consumers" for personal accounts)


---

## Tools

This skill runs Node.js scripts via bash. Files:
- `scripts/` — Node.js scripts
- `nicknames.md` — ตาราง mapping ชื่อเล่น → email (แก้ไขได้เลย)

---

## Instructions

### Step 1 — Get Access Token
Before any Graph API call, get an app-only token:
```bash
node skills/ms-graph-calendar/scripts/get-token.js
```
Store the token in a temp variable for subsequent calls.

### Step 2 — Parse the User's Request
Extract from the user's message:
- **Who**: names or emails of attendees (e.g. "Alice and Bob", "the marketing team")
- **When**: date range to search (e.g. "this week", "next Monday", "March 5–7")
- **Duration**: how long the meeting should be (default 60 minutes)
- **Timezone**: default to `Asia/Bangkok` if not specified

If any info is missing, ask the user before proceeding.

### Step 3 — Resolve Employee Emails

**3a. ลองแปลงชื่อเล่นก่อน** (เร็วกว่า ไม่ต้องเรียก API):
```bash
node skills/ms-graph-calendar/scripts/resolve-nicknames.js --names "แบงค์,มิ้ว,โบ้"
```
อ่านจาก `nicknames.md` ในโฟลเดอร์ skill — แก้ไขได้ตรงนั้นเลย

**3b. ถ้าหาไม่เจอใน nicknames.md** ให้ fallback ไปค้น Graph API:
```bash
node skills/ms-graph-calendar/scripts/list-users.js --search "ชื่อ"
```
Confirm กับ user ถ้ามีคนชื่อเดียวกันหลายคน

### Step 4 — Find Free Slots (choose one method)

**Method A — findMeetingTimes** (best for small groups, ≤10 people):
```bash
node skills/ms-graph-calendar/scripts/find-meeting-times.js \
  --attendees "alice@company.com,bob@company.com" \
  --start "2025-03-01T08:00:00" \
  --end "2025-03-01T18:00:00" \
  --duration 60 \
  --timezone "Asia/Bangkok" \
  --max 5
```

**Method B — getSchedule** (best for large groups or viewing free/busy blocks):
```bash
node skills/ms-graph-calendar/scripts/get-schedule.js \
  --emails "alice@company.com,bob@company.com,carol@company.com" \
  --start "2025-03-01T00:00:00" \
  --end "2025-03-07T00:00:00" \
  --timezone "Asia/Bangkok" \
  --interval 30
```

### Step 5 — Present Results

Format the available slots clearly:
```
📅 Available slots where everyone is free:

1. Monday 3 Mar · 10:00–11:00
2. Tuesday 4 Mar · 14:00–15:00
3. Wednesday 5 Mar · 09:00–10:00

Which slot works best?
```

If no slots are found, widen the search window and try again, or report that no common availability exists in that period.

---

## Example Conversations

**User:** "Find a 1-hour slot this week where Alice, Bob, and Carol are all free"
**Agent:**
1. Resolves emails for Alice, Bob, Carol
2. Runs `find-meeting-times.js` with date range = this Mon–Fri
3. Returns top 3 available slots

**User:** "Is John free tomorrow afternoon?"
**Agent:**
1. Resolves John's email
2. Runs `get-schedule.js` for tomorrow 12:00–18:00
3. Reports free/busy blocks

**User:** "Show me everyone in the marketing team's availability next week"
**Agent:**
1. Lists users in the Marketing group via `list-users.js --group "Marketing"`
2. Runs `get-schedule.js` for all their emails
3. Presents a visual free/busy summary

---

## Error Handling

| Error | Cause | Fix |
|---|---|---|
| `401 Unauthorized` | Token expired or wrong credentials | Re-run `get-token.js`, check env vars |
| `403 Forbidden` | Missing Admin Consent | Ask IT admin to grant consent in Azure Portal |
| `404 Not Found` | User email doesn't exist | Verify email via `list-users.js` |
| No slots found | Everyone is busy | Widen time range or reduce attendees |

---

## Security Notes

- Credentials are read from env vars only — never log or echo them
- This skill has **read-only** access to calendars (`Calendars.Read`)
- It cannot create, edit, or delete any events
- To restrict which mailboxes the app can read, ask your IT admin to set an **App Access Policy** in Exchange Online:
  ```powershell
  New-ApplicationAccessPolicy -AppId <ClientId> -PolicyScopeGroupId <GroupId> -AccessRight RestrictAccess
  ```

Related Skills

Photography Mastery

3891
from openclaw/skills

Complete photography system — exposure, composition, lighting, genre-specific workflows, editing, gear selection, portfolio building, and client management. From beginner to professional.

afrexai-email-to-calendar

3891
from openclaw/skills

Extract calendar events, deadlines, action items, and follow-ups from emails. Works with any calendar provider (Google, Outlook, Apple, Notion, etc.). No external dependencies — pure agent intelligence. Use when the user forwards an email, asks to check inbox for events, or wants to extract structured scheduling data from any text.

Workflow & Productivity

calendar-optimizer

3891
from openclaw/skills

Analyzes and rewrites calendar events into clear, actionable tasks. Removes meeting fluff and converts vague descriptions into specific deliverables with deadlines.

calendar

3891
from openclaw/skills

Query and manage the operator's calendar — check availability and create new entries

ews-calendar

3891
from openclaw/skills

Extract calendar events from Microsoft Exchange via EWS API

feishu-calendar

3891
from openclaw/skills

Manage Feishu (Lark) Calendars. Use this skill to list calendars, check schedules, and sync events.

Cortex — Graph Memory Skill

3891
from openclaw/skills

You have access to **Cortex**, a self-organizing knowledge graph for persistent memory. Use it to remember facts, decisions, goals, patterns, and observations across sessions. Knowledge is stored as nodes in a graph that auto-links, decays stale information, detects contradictions, and computes trust from topology.

caldav-calendar

3891
from openclaw/skills

Sync and query CalDAV calendars (iCloud, Google, Fastmail, Nextcloud, etc.) using vdirsyncer + khal. Works on Linux.

use-cartograph

3891
from openclaw/skills

Use when Cartograph CLI or MCP is available and you need repository orientation, task-scoped context, or doc inputs with minimal token cost.

anime-calendar

3891
from openclaw/skills

国内动漫每周更新日历。用于查询动漫更新时间、本周新番列表、追番日历。当用户询问动漫更新时间表、本周更新、追番日历、新番列表时触发此技能。

capability-graph-mapper

3891
from openclaw/skills

Helps map the composite permission surface across AI agent skill dependency chains. Traces what each skill can do individually, then computes what they can do together — revealing emergent capabilities nobody explicitly approved.

justcalendar

3891
from openclaw/skills

Use this skill when a user needs to install, authenticate, or operate the Just Calendar CLI against https://justcalendar.ai, including generating an agent token in the web UI and performing calendar/day-data management from terminal commands.