# Send Ms Graph Calendar to your agent
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
## Fast path
- Download the package from Yavira.
- Extract it into a folder your agent can access.
- Paste one of the prompts below and point your agent at the extracted folder.
## Suggested prompts
### New install

```text
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
```
### Upgrade existing

```text
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
```
## Machine-readable fields
```json
{
  "schemaVersion": "1.0",
  "item": {
    "slug": "ms-graph-calendar",
    "name": "Ms Graph Calendar",
    "source": "tencent",
    "type": "skill",
    "category": "效率提升",
    "sourceUrl": "https://clawhub.ai/ARTISONG/ms-graph-calendar",
    "canonicalUrl": "https://clawhub.ai/ARTISONG/ms-graph-calendar",
    "targetPlatform": "OpenClaw"
  },
  "install": {
    "downloadUrl": "/downloads/ms-graph-calendar",
    "sourceDownloadUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=ms-graph-calendar",
    "sourcePlatform": "tencent",
    "targetPlatform": "OpenClaw",
    "packageFormat": "ZIP package",
    "primaryDoc": "SKILL.md",
    "includedAssets": [
      "nicknames.md",
      "SKILL.md",
      "scripts/resolve-nicknames.js",
      "scripts/list-users.js",
      "scripts/find-meeting-times.js",
      "scripts/setup.js"
    ],
    "downloadMode": "redirect",
    "sourceHealth": {
      "source": "tencent",
      "slug": "ms-graph-calendar",
      "status": "healthy",
      "reason": "direct_download_ok",
      "recommendedAction": "download",
      "checkedAt": "2026-04-30T10:59:04.211Z",
      "expiresAt": "2026-05-07T10:59:04.211Z",
      "httpStatus": 200,
      "finalUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=ms-graph-calendar",
      "contentType": "application/zip",
      "probeMethod": "head",
      "details": {
        "probeUrl": "https://wry-manatee-359.convex.site/api/v1/download?slug=ms-graph-calendar",
        "contentDisposition": "attachment; filename=\"ms-graph-calendar-1.0.2.zip\"",
        "redirectLocation": null,
        "bodySnippet": null,
        "slug": "ms-graph-calendar"
      },
      "scope": "item",
      "summary": "Item download looks usable.",
      "detail": "Yavira can redirect you to the upstream package for this item.",
      "primaryActionLabel": "Download for OpenClaw",
      "primaryActionHref": "/downloads/ms-graph-calendar"
    },
    "validation": {
      "installChecklist": [
        "Use the Yavira download entry.",
        "Review SKILL.md after the package is downloaded.",
        "Confirm the extracted package contains the expected setup assets."
      ],
      "postInstallChecks": [
        "Confirm the extracted package includes the expected docs or setup files.",
        "Validate the skill or prompts are available in your target agent workspace.",
        "Capture any manual follow-up steps the agent could not complete."
      ]
    }
  },
  "links": {
    "detailUrl": "https://openagent3.xyz/skills/ms-graph-calendar",
    "downloadUrl": "https://openagent3.xyz/downloads/ms-graph-calendar",
    "agentUrl": "https://openagent3.xyz/skills/ms-graph-calendar/agent",
    "manifestUrl": "https://openagent3.xyz/skills/ms-graph-calendar/agent.json",
    "briefUrl": "https://openagent3.xyz/skills/ms-graph-calendar/agent.md"
  }
}
```
## Documentation

### 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 ให้ทำดังนี้:

ถามผู้ใช้ 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)



เมื่อได้ครบแล้ว รันคำสั่ง:

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

ทดสอบด้วย:

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 (แก้ไขได้เลย)

### Step 1 — Get Access Token

Before any Graph API call, get an app-only token:

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):

node skills/ms-graph-calendar/scripts/resolve-nicknames.js --names "แบงค์,มิ้ว,โบ้"

อ่านจาก nicknames.md ในโฟลเดอร์ skill — แก้ไขได้ตรงนั้นเลย

3b. ถ้าหาไม่เจอใน nicknames.md ให้ fallback ไปค้น Graph API:

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):

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):

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:

Resolves emails for Alice, Bob, Carol
Runs find-meeting-times.js with date range = this Mon–Fri
Returns top 3 available slots

User: "Is John free tomorrow afternoon?"
Agent:

Resolves John's email
Runs get-schedule.js for tomorrow 12:00–18:00
Reports free/busy blocks

User: "Show me everyone in the marketing team's availability next week"
Agent:

Lists users in the Marketing group via list-users.js --group "Marketing"
Runs get-schedule.js for all their emails
Presents a visual free/busy summary

### Error Handling

ErrorCauseFix401 UnauthorizedToken expired or wrong credentialsRe-run get-token.js, check env vars403 ForbiddenMissing Admin ConsentAsk IT admin to grant consent in Azure Portal404 Not FoundUser email doesn't existVerify email via list-users.jsNo slots foundEveryone is busyWiden 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:
New-ApplicationAccessPolicy -AppId <ClientId> -PolicyScopeGroupId <GroupId> -AccessRight RestrictAccess
## Trust
- Source: tencent
- Verification: Indexed source record
- Publisher: ARTISONG
- Version: 1.0.2
## Source health
- Status: healthy
- Item download looks usable.
- Yavira can redirect you to the upstream package for this item.
- Health scope: item
- Reason: direct_download_ok
- Checked at: 2026-04-30T10:59:04.211Z
- Expires at: 2026-05-07T10:59:04.211Z
- Recommended action: Download for OpenClaw
## Links
- [Detail page](https://openagent3.xyz/skills/ms-graph-calendar)
- [Send to Agent page](https://openagent3.xyz/skills/ms-graph-calendar/agent)
- [JSON manifest](https://openagent3.xyz/skills/ms-graph-calendar/agent.json)
- [Markdown brief](https://openagent3.xyz/skills/ms-graph-calendar/agent.md)
- [Download page](https://openagent3.xyz/downloads/ms-graph-calendar)