Trigger Conditions
Whenever the user asks any question involving schedules, meetings, arrangements, calendars, work, tasks, or matters, this skill must be invoked.
- "What's on tomorrow's schedule" / "What meetings are there this week" / "This month's schedule"
- "Help me check the calendar" / "What time are my meetings today"
- "How many total hours of meetings this month"
- "What work do I have next week" / "What to do tomorrow" / "What's happening this week"
- "Next week's schedule" / "What tasks are there" / "Take a look at the schedule"
- Any combination question of time + arrangement/meeting/event/work/task/matter
First-time Setup
Sensitive information (account password, Cookie, Token) is stored in ~/.outlook/,not inside the skill directory。
1. Create the configuration file
Create ~/.outlook/config.json, with the following content:
{
"email": "your@company.com",
"password": "your_password",
"cookie_file": "/root/.outlook/cookies.json",
"cookie_max_age_days": 7,
"mfa_type": "authenticator_number_match"
}
2. Install dependencies
pip install playwright requests
playwright install chromium
3. First login (MFA)
cd ~/.agents/skills/outlook-calendar
python login.py
When the script outputs [NUMBER:XX] , enter the number XX in the Microsoft Authenticator App and approve; the Cookie is automatically saved to ~/.outlook/cookies.json。
Invocation Steps
Step 1: Read the calendar
cd ~/.agents/skills/outlook-calendar
python owa_calendar.py --today # 今天
python owa_calendar.py --tomorrow # 明天
python owa_calendar.py --week # 本周
python owa_calendar.py --month 2026-03 # 指定月份
python owa_calendar.py --range 2026-03-01 2026-03-31 # 自定义范围
Step 2: Handle AUTH_FAILED
If it outputs [AUTH_FAILED], the Cookie or Token has expired; log in again:
python login.py
Step 3: Organize the output
Organize the answer based on the user's question: list events, total the duration, group by week, etc. Note: The API returns times in UTC; add +8 to convert to Shanghai time.
File Structure
skill 目录(无敏感信息):
~/.agents/skills/outlook-calendar/
├── SKILL.md
├── login.py # MFA 登录,保存 Cookie 到 ~/.outlook/
└── owa_calendar.py # 日历读取(Token 模式)
敏感数据目录:
~/.outlook/
├── config.json # 账号密码(自行创建)
├── cookies.json # 登录 Cookie(login.py 自动生成)
└── token.json # Bearer Token 缓存(自动生成,1h 有效)
MFA Description
- Type: Authenticator number matching
- Cookie validity: usually 1-7 days; if expired, rerun login.py
- Multiple failures will trigger Microsoft rate limiting; wait 15 minutes before retrying