Extract calendar events from Microsoft Exchange via EWS API
Fetch calendar events from Microsoft Exchange Web Services (EWS) and return them as structured JSON.
Credentials are stored in OS keyring, NOT in config files:
Only EWS_URL and EWS_USER are stored in OpenClaw config (non-secret). The password is retrieved securely at runtime.
# Debian/Ubuntu
sudo apt install libsecret-tools gnome-keyring
# Fedora
sudo dnf install libsecret gnome-keyring
# Arch
sudo pacman -S libsecret gnome-keyring
macOS has Keychain built-in.
{baseDir}/ews-calendar-setup.sh --user "DOMAIN\\username"
You will be prompted for your password. This stores it securely in the OS keyring.
Add to ~/.openclaw/openclaw.json:
{
skills: {
entries: {
"ews-calendar": {
enabled: true,
env: {
EWS_URL: "https://outlook.company.com/EWS/Exchange.asmx",
EWS_USER: "DOMAIN\\username"
}
}
}
}
}
Replace with your actual Exchange URL and username.
The skill runs {baseDir}/ews-calendar-secure.sh which:
EWS_PASS from OS keyring{baseDir}/ews-calendar-secure.sh --date <DATE> [--output <FILE>] [--verbose]
--date (required): Date filter
YYYY-MM-DD — specific date (e.g., 2026-03-03)today — today's datetomorrow — tomorrow's date--output <FILE>: Write JSON to file instead of stdout--verbose: Enable debug logging--debug-xml <FILE>: Save raw XML response for debuggingReturns JSON array of calendar events:
[
{
"subject": "Team Standup",
"start": "2026-03-03T10:00:00Z",
"end": "2026-03-03T10:30:00Z",
"location": "Conference Room A",
"organizer": "[email protected]",
"body": "Weekly sync meeting to discuss sprint progress...",
"links": ["https://zoom.us/j/12345", "https://confluence.example.com/doc"]
}
]
Returns empty array [] if no events found.
Get today's events:
{baseDir}/ews-calendar-secure.sh --date today
Get tomorrow's events to file:
{baseDir}/ews-calendar-secure.sh --date tomorrow --output /tmp/tomorrow.json
Get specific date with debug:
{baseDir}/ews-calendar-secure.sh --date 2026-03-03 --verbose --debug-xml /tmp/debug.xml
[ERROR] Password not found in keyring for user: DOMAIN\username
[HINT] Run: ./ews-calendar-setup.sh to store credentials
Solution: Run the setup script to store your password:
{baseDir}/ews-calendar-setup.sh --user "DOMAIN\\username"
[ERROR] 'secret-tool' not found. Install: apt install libsecret-tools
Solution: Install libsecret tools:
sudo apt install libsecret-tools gnome-keyring
On Linux, the keyring may be locked after login.
Solution: Unlock your keyring (usually happens automatically on desktop login). For headless servers, you may need to set up a keyring daemon.
[ERROR] HTTP request failed with status: 401
Possible causes:
[ERROR] SOAP Fault detected
Fault code: a:ErrorInvalidRequest
Fault string: The request is invalid.
Possible causes:
EWS_URL in config)YYYY-MM-DD){baseDir}/ews-calendar-setup.sh --user "DOMAIN\\username"
The script will overwrite the existing entry.
{baseDir}/ews-calendar-setup.sh --user "DOMAIN\\username" --delete
Or manually:
macOS:
security delete-generic-password -a "DOMAIN\\username" -s "ews-calendar"
Linux:
secret-tool clear service "ews-calendar" user "DOMAIN\\username"
security find-generic-password -a "DOMAIN\\username" -s "ews-calendar" -w
{baseDir}/
├── SKILL.md # This file
├── ews-calendar.sh # Main script (reads from env or .env)
├── ews-calendar-secure.sh # Wrapper that gets password from keyring
├── ews-calendar-setup.sh # Store credentials in keyring
├── templates/
│ ├── find-items.xml # SOAP template for finding calendar items
│ └── get-item.xml # SOAP template for getting item details
└── .env.example # Example config for standalone usage
For development or testing, you can run ews-calendar.sh directly with a .env file:
.env.example to .env./ews-calendar.sh --date todayWarning: This stores password in plaintext. Use keyring for production.