KosmoKrator

email

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.

7 functions 5 read 2 write Manual OAuth token auth

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 use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token MICROSOFT_OUTLOOK_ACCESS_TOKEN Secret secret yes Access Token
base_url MICROSOFT_OUTLOOK_BASE_URL URL url no Graph API URL

Call Microsoft Outlook Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call microsoft-outlook.outlook_list_messages '{
  "top": 1,
  "filter": "example_filter",
  "orderby": "example_orderby",
  "select": "example_select",
  "skip": 1
}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:microsoft-outlook outlook_list_messages '{
  "top": 1,
  "filter": "example_filter",
  "orderby": "example_orderby",
  "select": "example_select",
  "skip": 1
}' --json

Agent Discovery Commands

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

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Microsoft Outlook.

microsoft-outlook.outlook_list_messages

Read read

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.

Parameters
top, filter, orderby, select, skip

Generic CLI call

kosmo integrations:call microsoft-outlook.outlook_list_messages '{"top":1,"filter":"example_filter","orderby":"example_orderby","select":"example_select","skip":1}' --json

Provider shortcut

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

Read read

Retrieve a single email message by its id. Returns the full message including body, sender, recipients, subject, and attachments metadata.

Parameters
message_id, select

Generic CLI call

kosmo integrations:call microsoft-outlook.outlook_get_message '{"message_id":"example_message_id","select":"example_select"}' --json

Provider shortcut

kosmo integrations:microsoft-outlook outlook_get_message '{"message_id":"example_message_id","select":"example_select"}' --json

microsoft-outlook.outlook_send_message

Write write

Send an email message via Outlook. Specify recipients, subject, and body. Supports HTML and plain-text bodies, CC, BCC, and reply-to addresses.

Parameters
to, subject, body, content_type, cc, bcc, reply_to

Generic CLI call

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

Provider shortcut

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

Read read

List all calendars in the signed-in user's Outlook mailbox. Returns calendar names, ids, and default calendar indicator.

Parameters
top, select

Generic CLI call

kosmo integrations:call microsoft-outlook.outlook_list_calendars '{"top":1,"select":"example_select"}' --json

Provider shortcut

kosmo integrations:microsoft-outlook outlook_list_calendars '{"top":1,"select":"example_select"}' --json

microsoft-outlook.outlook_list_events

Read read

List upcoming calendar events from the default Outlook calendar. Supports filtering by date range, subject, and more via OData query parameters.

Parameters
top, filter, orderby, select, start_date_time, end_date_time

Generic CLI call

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

Provider shortcut

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

Write write

Create a new event on the default Outlook calendar. Specify subject, start/end time, body, and optionally attendees and location.

Parameters
subject, start, end, time_zone, body, body_type, location, attendees, is_all_day

Generic CLI call

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

Provider shortcut

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

Read read

Get the signed-in user's profile information including display name, email address, and job title. Useful for identifying which account is connected.

Parameters
select

Generic CLI call

kosmo integrations:call microsoft-outlook.outlook_get_current_user '{"select":"example_select"}' --json

Provider shortcut

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

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.

Operation
Read read
Schema command
kosmo integrations:schema microsoft-outlook.outlook_list_messages --json
ParameterTypeRequiredDescription
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

Retrieve a single email message by its id. Returns the full message including body, sender, recipients, subject, and attachments metadata.

Operation
Read read
Schema command
kosmo integrations:schema microsoft-outlook.outlook_get_message --json
ParameterTypeRequiredDescription
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

Send an email message via Outlook. Specify recipients, subject, and body. Supports HTML and plain-text bodies, CC, BCC, and reply-to addresses.

Operation
Write write
Schema command
kosmo integrations:schema microsoft-outlook.outlook_send_message --json
ParameterTypeRequiredDescription
to array yes Array of recipient email addresses, e.g. ["[email protected]", "[email protected]"].
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

List all calendars in the signed-in user's Outlook mailbox. Returns calendar names, ids, and default calendar indicator.

Operation
Read read
Schema command
kosmo integrations:schema microsoft-outlook.outlook_list_calendars --json
ParameterTypeRequiredDescription
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

List upcoming calendar events from the default Outlook calendar. Supports filtering by date range, subject, and more via OData query parameters.

Operation
Read read
Schema command
kosmo integrations:schema microsoft-outlook.outlook_list_events --json
ParameterTypeRequiredDescription
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

Create a new event on the default Outlook calendar. Specify subject, start/end time, body, and optionally attendees and location.

Operation
Write write
Schema command
kosmo integrations:schema microsoft-outlook.outlook_create_event --json
ParameterTypeRequiredDescription
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. ["[email protected]", "[email protected]"].
is_all_day boolean no Whether this is an all-day event. Defaults to false.

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.

Operation
Read read
Schema command
kosmo integrations:schema microsoft-outlook.outlook_get_current_user --json
ParameterTypeRequiredDescription
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.