productivity
Microsoft Outlook CLI for AI Agents
Use the Microsoft Outlook CLI from KosmoKrator to call Microsoft Outlook tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.Microsoft Outlook CLI Setup
Microsoft Outlook can be configured headlessly with `kosmokrator integrations:configure microsoft-outlook`.
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash
# Configure and verify this integration.
kosmokrator integrations:configure microsoft-outlook --set access_token="$MICROSOFT_OUTLOOK_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor microsoft-outlook --json
kosmokrator integrations:status --json Credentials
Authentication type: Manual OAuth token oauth2_manual_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
access_token | MICROSOFT_OUTLOOK_ACCESS_TOKEN | Secret secret | yes | Access Token |
base_url | MICROSOFT_OUTLOOK_BASE_URL | URL url | no | Graph API URL |
Command Patterns
The generic command is stable across every integration. The provider shortcut is shorter for humans.
kosmo integrations:call microsoft-outlook.outlook_list_messages '{"top":1,"filter":"example_filter","orderby":"example_orderby","select":"example_select","skip":1}' --json kosmo integrations:microsoft-outlook outlook_list_messages '{"top":1,"filter":"example_filter","orderby":"example_orderby","select":"example_select","skip":1}' --json Discovery
These commands return structured output for coding agents that need to inspect capabilities before choosing a function.
kosmo integrations:docs microsoft-outlook --json
kosmo integrations:docs microsoft-outlook.outlook_list_messages --json
kosmo integrations:schema microsoft-outlook.outlook_list_messages --json
kosmo integrations:search "Microsoft Outlook" --json
kosmo integrations:list --json Automation Contexts
The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.
CLI Functions
Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.
microsoft-outlook.outlook_list_messages
List email messages in the signed-in user's Outlook mailbox. Supports filtering by subject, sender, date range, and read status. Returns a paginated list of messages with subject, sender, date, and preview.
read - Parameters
- top, filter, orderby, select, skip
kosmo integrations:call microsoft-outlook.outlook_list_messages '{"top":1,"filter":"example_filter","orderby":"example_orderby","select":"example_select","skip":1}' --json kosmo integrations:microsoft-outlook outlook_list_messages '{"top":1,"filter":"example_filter","orderby":"example_orderby","select":"example_select","skip":1}' --json microsoft-outlook.outlook_get_message
Retrieve a single email message by its id. Returns the full message including body, sender, recipients, subject, and attachments metadata.
read - Parameters
- message_id, select
kosmo integrations:call microsoft-outlook.outlook_get_message '{"message_id":"example_message_id","select":"example_select"}' --json kosmo integrations:microsoft-outlook outlook_get_message '{"message_id":"example_message_id","select":"example_select"}' --json microsoft-outlook.outlook_send_message
Send an email message via Outlook. Specify recipients, subject, and body. Supports HTML and plain-text bodies, CC, BCC, and reply-to addresses.
write - Parameters
- to, subject, body, content_type, cc, bcc, reply_to
kosmo integrations:call microsoft-outlook.outlook_send_message '{"to":"example_to","subject":"example_subject","body":"example_body","content_type":"example_content_type","cc":"example_cc","bcc":"example_bcc","reply_to":"example_reply_to"}' --json kosmo integrations:microsoft-outlook outlook_send_message '{"to":"example_to","subject":"example_subject","body":"example_body","content_type":"example_content_type","cc":"example_cc","bcc":"example_bcc","reply_to":"example_reply_to"}' --json microsoft-outlook.outlook_list_calendars
List all calendars in the signed-in user's Outlook mailbox. Returns calendar names, ids, and default calendar indicator.
read - Parameters
- top, select
kosmo integrations:call microsoft-outlook.outlook_list_calendars '{"top":1,"select":"example_select"}' --json kosmo integrations:microsoft-outlook outlook_list_calendars '{"top":1,"select":"example_select"}' --json microsoft-outlook.outlook_list_events
List upcoming calendar events from the default Outlook calendar. Supports filtering by date range, subject, and more via OData query parameters.
read - Parameters
- top, filter, orderby, select, start_date_time, end_date_time
kosmo integrations:call microsoft-outlook.outlook_list_events '{"top":1,"filter":"example_filter","orderby":"example_orderby","select":"example_select","start_date_time":"example_start_date_time","end_date_time":"example_end_date_time"}' --json kosmo integrations:microsoft-outlook outlook_list_events '{"top":1,"filter":"example_filter","orderby":"example_orderby","select":"example_select","start_date_time":"example_start_date_time","end_date_time":"example_end_date_time"}' --json microsoft-outlook.outlook_create_event
Create a new event on the default Outlook calendar. Specify subject, start/end time, body, and optionally attendees and location.
write - Parameters
- subject, start, end, time_zone, body, body_type, location, attendees, is_all_day
kosmo integrations:call microsoft-outlook.outlook_create_event '{"subject":"example_subject","start":"example_start","end":"example_end","time_zone":"example_time_zone","body":"example_body","body_type":"example_body_type","location":"example_location","attendees":"example_attendees"}' --json kosmo integrations:microsoft-outlook outlook_create_event '{"subject":"example_subject","start":"example_start","end":"example_end","time_zone":"example_time_zone","body":"example_body","body_type":"example_body_type","location":"example_location","attendees":"example_attendees"}' --json microsoft-outlook.outlook_get_current_user
Get the signed-in user's profile information including display name, email address, and job title. Useful for identifying which account is connected.
read - Parameters
- select
kosmo integrations:call microsoft-outlook.outlook_get_current_user '{"select":"example_select"}' --json kosmo integrations:microsoft-outlook outlook_get_current_user '{"select":"example_select"}' --json Function Schemas
Use these parameter tables when building CLI payloads without calling integrations:schema first.
microsoft-outlook.outlook_list_messages 5 parameters
kosmo integrations:schema microsoft-outlook.outlook_list_messages --json | Parameter | Type | Required | Description |
|---|---|---|---|
top | integer | no | Maximum number of messages to return (default: 25, max: 999). |
filter | string | no | OData filter expression, e.g. "isRead eq false" or "receivedDateTime ge 2025-01-01T00:00:00Z". |
orderby | string | no | OData orderby expression, e.g. "receivedDateTime desc". |
select | string | no | Comma-separated list of properties to include, e.g. "subject,from,receivedDateTime". |
skip | integer | no | Number of messages to skip (for pagination). |
microsoft-outlook.outlook_get_message 2 parameters
kosmo integrations:schema microsoft-outlook.outlook_get_message --json | Parameter | Type | Required | Description |
|---|---|---|---|
message_id | string | yes | The unique id of the message to retrieve. |
select | string | no | Comma-separated list of properties to include, e.g. "subject,body,from,toRecipients". |
microsoft-outlook.outlook_send_message 7 parameters
kosmo integrations:schema microsoft-outlook.outlook_send_message --json | Parameter | Type | Required | Description |
|---|---|---|---|
to | array | yes | Array of recipient email addresses, e.g. ["alice@example.com", "bob@example.com"]. |
subject | string | yes | The email subject line. |
body | string | yes | The email body content. |
content_type | string | no | Body content type: "HTML" (default) or "Text". |
cc | array | no | Array of CC email addresses. |
bcc | array | no | Array of BCC email addresses. |
reply_to | array | no | Array of reply-to email addresses. |
microsoft-outlook.outlook_list_calendars 2 parameters
kosmo integrations:schema microsoft-outlook.outlook_list_calendars --json | Parameter | Type | Required | Description |
|---|---|---|---|
top | integer | no | Maximum number of calendars to return (default: 25). |
select | string | no | Comma-separated list of properties to include, e.g. "id,name,isDefaultCalendar". |
microsoft-outlook.outlook_list_events 6 parameters
kosmo integrations:schema microsoft-outlook.outlook_list_events --json | Parameter | Type | Required | Description |
|---|---|---|---|
top | integer | no | Maximum number of events to return (default: 25, max: 999). |
filter | string | no | OData filter expression, e.g. "start/dateTime ge '2025-01-01T00:00:00'" or "isAllDay eq true". |
orderby | string | no | OData orderby expression, e.g. "start/dateTime". |
select | string | no | Comma-separated list of properties to include, e.g. "subject,start,end,location". |
start_date_time | string | no | Start of the date range to list events for (ISO 8601, e.g. "2025-01-01T00:00:00"). Sets $filter automatically when provided. |
end_date_time | string | no | End of the date range to list events for (ISO 8601, e.g. "2025-12-31T23:59:59"). Used with start_date_time. |
microsoft-outlook.outlook_create_event 9 parameters
kosmo integrations:schema microsoft-outlook.outlook_create_event --json | Parameter | Type | Required | Description |
|---|---|---|---|
subject | string | yes | The event subject / title. |
start | string | yes | Start date and time in ISO 8601 format, e.g. "2025-06-15T09:00:00". |
end | string | yes | End date and time in ISO 8601 format, e.g. "2025-06-15T10:00:00". |
time_zone | string | no | IANA time zone for start/end, e.g. "Europe/Amsterdam". Defaults to "UTC". |
body | string | no | The event body / description. |
body_type | string | no | Body content type: "HTML" (default) or "Text". |
location | string | no | The display name of the event location. |
attendees | array | no | Array of attendee email addresses, e.g. ["alice@example.com", "bob@example.com"]. |
is_all_day | boolean | no | Whether this is an all-day event. Defaults to false. |
microsoft-outlook.outlook_get_current_user 1 parameters
kosmo integrations:schema microsoft-outlook.outlook_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
select | string | no | Comma-separated list of properties to include, e.g. "displayName,mail,jobTitle". |
Permissions
Headless calls still follow the integration read/write permission policy. Configure read/write defaults with
integrations:configure. Add --force only for trusted automation that should bypass that policy.