microsoft-graph
Microsoft Graph
Interact with Microsoft 365 services via the Graph API.
Environment Variables
MS_GRAPH_TOKEN- OAuth2 bearer token (delegated or application)
My profile
curl -s -H "Authorization: Bearer $MS_GRAPH_TOKEN" \
"https://graph.microsoft.com/v1.0/me" | jq '{displayName, mail, jobTitle}'
List emails (Outlook)
curl -s -H "Authorization: Bearer $MS_GRAPH_TOKEN" \
"https://graph.microsoft.com/v1.0/me/messages?\$top=10&\$select=subject,from,receivedDateTime,isRead" | jq '.value[] | {subject, from: .from.emailAddress.address, received: .receivedDateTime, isRead}'
Send email (Outlook)
curl -s -X POST -H "Authorization: Bearer $MS_GRAPH_TOKEN" \
-H "Content-Type: application/json" \
"https://graph.microsoft.com/v1.0/me/sendMail" \
-d '{
"message": {
"subject": "Hello from ThinkFleetBot",
"body": {"contentType": "Text", "content": "Message body here"},
"toRecipients": [{"emailAddress": {"address": "recipient@example.com"}}]
}
}'
echo "Email sent"
List calendar events
curl -s -H "Authorization: Bearer $MS_GRAPH_TOKEN" \
"https://graph.microsoft.com/v1.0/me/events?\$top=10&\$select=subject,start,end,location&\$orderby=start/dateTime" | jq '.value[] | {subject, start: .start.dateTime, end: .end.dateTime, location: .location.displayName}'
Create calendar event
curl -s -X POST -H "Authorization: Bearer $MS_GRAPH_TOKEN" \
-H "Content-Type: application/json" \
"https://graph.microsoft.com/v1.0/me/events" \
-d '{
"subject": "Team Standup",
"start": {"dateTime": "2025-01-15T09:00:00", "timeZone": "UTC"},
"end": {"dateTime": "2025-01-15T09:30:00", "timeZone": "UTC"},
"attendees": [{"emailAddress": {"address": "colleague@example.com"}, "type": "required"}]
}' | jq '{id, subject, webLink}'
Send Teams message
curl -s -X POST -H "Authorization: Bearer $MS_GRAPH_TOKEN" \
-H "Content-Type: application/json" \
"https://graph.microsoft.com/v1.0/teams/TEAM_ID/channels/CHANNEL_ID/messages" \
-d '{"body": {"content": "Hello from ThinkFleetBot!"}}' | jq '{id, createdDateTime}'
List Teams channels
curl -s -H "Authorization: Bearer $MS_GRAPH_TOKEN" \
"https://graph.microsoft.com/v1.0/me/joinedTeams" | jq '.value[] | {id, displayName}'
List OneDrive files
curl -s -H "Authorization: Bearer $MS_GRAPH_TOKEN" \
"https://graph.microsoft.com/v1.0/me/drive/root/children" | jq '.value[] | {name, size, lastModifiedDateTime, webUrl}'
Upload file to OneDrive
curl -s -X PUT -H "Authorization: Bearer $MS_GRAPH_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary @/tmp/report.pdf \
"https://graph.microsoft.com/v1.0/me/drive/root:/Documents/report.pdf:/content" | jq '{name, webUrl}'
Notes
- Tokens expire; use refresh tokens or app-only auth for long-running operations.
- Delegated tokens act on behalf of a user; application tokens act as the app.
- Use
$select,$filter,$top,$orderbyOData query params for efficient queries. - Always confirm before sending emails, creating events, or posting messages.
More from thinkfleetai/thinkfleet-engine
local-whisper
Local speech-to-text using OpenAI Whisper. Runs fully offline after model download. High quality transcription with multiple model sizes.
149flyio-cli-public
Use the Fly.io flyctl CLI for deploying and operating apps on Fly.io: deploys (local or remote builder), viewing status/logs, SSH/console, secrets/config, scaling, machines, volumes, and Fly Postgres (create/attach/manage databases). Use when asked to deploy to Fly.io, debug fly deploy/build/runtime failures, set up GitHub Actions deploys/previews, or safely manage Fly apps and Postgres.
24kagi-search
Web search using Kagi Search API. Use when you need to search the web for current information, facts, or references. Requires KAGI_API_KEY in the environment.
22feishu-bridge
Connect a Feishu (Lark) bot to ThinkFleet via WebSocket long-connection. No public server, domain, or ngrok required. Use when setting up Feishu/Lark as a messaging channel, troubleshooting the Feishu bridge, or managing the bridge service (start/stop/logs). Covers bot creation on Feishu Open Platform, credential setup, bridge startup, macOS launchd auto-restart, and group chat behavior tuning.
13video-subtitles
Generate SRT subtitles from video/audio with translation support. Transcribes Hebrew (ivrit.ai) and English (whisper), translates between languages, burns subtitles into video. Use for creating captions, transcripts, or hardcoded subtitles for WhatsApp/social media.
10freshrss
Query headlines and articles from a self-hosted FreshRSS instance. Use when the user asks for RSS news, latest headlines, feed updates, or wants to browse articles from their FreshRSS reader. Supports filtering by category, time range, and count.
9