Outlook CLI for AI Agents

Framework Integration Gradient
Outlook Logo
CLI Logo
divider

Introduction

CLIs are eating MCPs. The industry is converging on the very same idea. MCPs for all their merit can be token hungry, slow, and unreliable for complex tool chaining. However, coding agents have become incredibly good at working with CLIs, and in fact they are far more comfortable working with CLI tools than MCP.

With Composio's Universal CLI, your coding agents can talk to over 850+ SaaS applications. With Outlook, agents can download latest attachments from your inbox, create new calendar for project deadlines, add rule to move newsletters to folder, and more — all without worrying about authentication.

This guide walks you through Composio Universal CLI and explains how you can connect it with coding agents like Claude Code, Codex, OpenCode, etc, for end-to-end Outlook automation.

Also integrate Outlook with

What is Universal CLI and why use it?

The idea behind building the universal CLI is to give agents a single command interface to interact with all your external applications. Here's what you'll get with it:

  • Agent-friendly: Coding agents like Claude Code, Codex, and OpenCode can use CLI tools natively — no MCP setup required.
  • Authentication handled: Connect once via OAuth or API Key, and all CLI commands work with your credentials automatically.
  • Tool discovery: Search, inspect, and execute 20,000+ tools across 850+ apps from one interface.
  • Trigger support: Use triggers to listen for events across your apps, powered by real-time webhooks or polling under the hood.
  • Type generation: Generate typed schemas for autocomplete and type safety in your projects.

Prerequisites

Install the Composio CLI, authenticate, and initialize your project:

bash
# Install the Composio CLI
curl -fsSL https://composio.dev/install | bash

# Authenticate with Composio
composio login

During login you'll be redirected to sign in page, finish the complete flow and you're all set.

Composio CLI authentication flow

Connecting Outlook to Coding Agents via Universal CLI

Once it is installed, it's essentially done. Claude Code, Codex, OpenCode, OpenClaw, or any other agent will be able to access the CLI. A few steps to give agents access to your apps.

  1. Launch your Coding Agent — Claude Code, Codex, OpenCode, anything you prefer.
  2. Prompt it to "Authenticate with Outlook"
  3. Complete the authentication and authorization flow and your Outlook integration is all set.
  4. Start asking anything you want.

Supported Tools & Triggers

Tools
Triggers
Add mail attachmentTool to add an attachment to an email message.
Create calendarTool to create a new calendar in the signed-in user's mailbox.
Create contact folderTool to create a new contact folder in the user's mailbox.
Create Email RuleCreate email rule filter with conditions and actions
Create mail folderTool to create a new mail folder.
Create master categoryTool to create a new category in the user's master category list.
Delete mail folderDelete a mail folder from the user's mailbox.
Download Outlook attachmentDownloads a specific file attachment from an email message in a microsoft outlook mailbox; the attachment must contain 'contentbytes' (binary data) and not be a link or embedded item.
Get mailbox settingsTool to retrieve mailbox settings.
Get mail deltaTool to retrieve incremental changes (delta) of messages in a mailbox.
Get mail tipsTool to retrieve mail tips such as automatic replies and mailbox full status.
Get master categoriesTool to retrieve the user's master category list.
Get supported languagesTool to retrieve supported languages in the user's mailbox.
Get supported time zonesTool to retrieve supported time zones in the user's mailbox.
List Outlook calendarsTool to list calendars in the signed-in user's mailbox.
List event attachmentsTool to list attachments for a specific outlook calendar event.
List Outlook attachmentsLists metadata (like name, size, and type, but not `contentbytes`) for all attachments of a specified outlook email message.
List event remindersTool to retrieve reminders for events occurring within a specified time range.
Add event attachmentAdds an attachment to a specific outlook calendar event.
Create Calendar EventCreates a new outlook calendar event, ensuring `start datetime` is chronologically before `end datetime`.
Create contactCreates a new contact in a microsoft outlook user's contacts folder.
Create email draftCreates an outlook email draft with subject, body, recipients, and an optional attachment.
Create a draft replyCreates a draft reply in the specified user's outlook mailbox to an existing message (identified by a valid `message id`), optionally including a `comment` and cc/bcc recipients.
Delete ContactPermanently deletes an existing contact, using its `contact id` (obtainable via 'list user contacts' or 'get contact'), from the outlook contacts of the user specified by `user id`.
Delete Calendar EventDeletes an existing calendar event, identified by its unique `event id`, from a specified user's microsoft outlook calendar, with an option to send cancellation notifications to attendees.
Get contactRetrieves a specific outlook contact by its `contact id` from the contacts of a specified `user id` (defaults to 'me' for the authenticated user).
Get contact foldersTool to retrieve a list of contact folders in the signed-in user's mailbox.
Get calendar eventRetrieves the full details of a specific calendar event by its id from a user's outlook calendar, provided the event exists.
Get email messageRetrieves a specific email message by its id from the specified user's outlook mailbox.
Get Outlook profileRetrieves the microsoft outlook profile for a specified user.
Get scheduleRetrieves free/busy schedule information for specified email addresses within a defined time window.
List Outlook contactsRetrieves a user's microsoft outlook contacts, from the default or a specified contact folder.
List eventsRetrieves events from a user's outlook calendar via microsoft graph api, supporting pagination, filtering, property selection, sorting, and timezone specification.
List mail foldersTool to list a user's top-level mail folders.
List MessagesRetrieves a list of email messages from a specified mail folder in an outlook mailbox, with options for filtering (including by conversationid to get all messages in a thread), pagination, and sorting; ensure 'user id' and 'folder' are valid, and all date/time strings are in iso 8601 format.
Move message to folderMove a message to another folder within the specified user's mailbox.
Reply to EmailSends a plain text reply to an outlook email message, identified by `message id`, allowing optional cc and bcc recipients.
Search Outlook messagesSearches messages in a microsoft 365 or enterprise outlook account mailbox, supporting filters for sender, subject, attachments, pagination, and sorting by relevance or date.
Send emailSends an email with subject, body, recipients, and an optional attachment via microsoft graph api; attachments require a non-empty file with valid name and mimetype.
Update calendar eventUpdates specified fields of an existing outlook calendar event.
Update ContactUpdates an existing outlook contact, identified by `contact id` for the specified `user id`, requiring at least one other field to be modified.
Update email messageUpdates specified properties of an existing email message; `message id` must identify a valid message within the specified `user id`'s mailbox.
Update mailbox settingsTool to update mailbox settings for the signed-in user.

Universal CLI Commands for Outlook

You can also manually execute CLI commands to interact with your Outlook.

Connect your Outlook account

Link your Outlook account and verify the connection:

bash
# Connect your Outlook account (opens OAuth flow)
composio connected-accounts link outlook

# Verify the connection
composio connected-accounts list --toolkits outlook

Discover Outlook tools

Search and inspect available Outlook tools:

bash
# List all available Outlook tools
composio tools list --toolkit outlook

# Search for Outlook tools by action
composio tools search "outlook"

# Inspect a tool's input schema
composio tools info OUTLOOK_ADD_MAIL_ATTACHMENT

Common Outlook Actions

Add mail attachmentTool to add an attachment to an email message

bash
composio tools execute OUTLOOK_ADD_MAIL_ATTACHMENT \
  --name "report.pdf" \
  --message_id "AAMkAGI2TAAA=" \
  --odata_type "#microsoft.graph.fileAttachment" \
  --contentBytes "SGVsbG8gd29ybGQh"

Create calendarTool to create a new calendar in the signed-in user's mailbox

bash
composio tools execute OUTLOOK_CREATE_CALENDAR \
  --name "Family Calendar"

Create contact folderTool to create a new contact folder in the user's mailbox

bash
composio tools execute OUTLOOK_CREATE_CONTACT_FOLDER \
  --displayName "Friends"

Create Email RuleCreate email rule filter with conditions and actions

bash
composio tools execute OUTLOOK_CREATE_EMAIL_RULE \
  --actions "<object>" \
  --conditions "<object>" \
  --displayName "High Priority Filter"

Set up Outlook Triggers

Listen for events in real time using triggers:

New Contact AddedTriggered when a new contact is added in the Outlook contacts

bash
# Find your connected account ID
composio connected-accounts list --toolkits outlook

# Create a trigger
composio triggers create OUTLOOK_CONTACT_TRIGGER \
  --connected-account-id <your-connected-account-id> \
  --trigger-config '{}'

# Listen for trigger events in real time
composio triggers listen --toolkits outlook --table

Calendar Event ChangesTriggered when a new calendar event occurs (created, updated, or deleted) in the Outlook calendar

bash
# Find your connected account ID
composio connected-accounts list --toolkits outlook

# Create a trigger
composio triggers create OUTLOOK_EVENT_CHANGE_TRIGGER \
  --connected-account-id <your-connected-account-id> \
  --trigger-config '{}'

# Listen for trigger events in real time
composio triggers listen --toolkits outlook --table

New Calendar EventTriggered when a new calendar event is created in the Outlook calendar

bash
# Find your connected account ID
composio connected-accounts list --toolkits outlook

# Create a trigger
composio triggers create OUTLOOK_EVENT_TRIGGER \
  --connected-account-id <your-connected-account-id> \
  --trigger-config '{}'

# Listen for trigger events in real time
composio triggers listen --toolkits outlook --table

Generate Type Definitions

Generate typed schemas for Outlook tools to get autocomplete and type safety in your project:

bash
# Auto-detect language
composio generate --toolkits outlook

# TypeScript
composio ts generate --toolkits outlook

# Python
composio py generate --toolkits outlook

Tips & Tricks

  • Always inspect a tool's input schema before executing: composio tools info <TOOL_NAME>
  • Pipe output with jq for better readability: composio tools execute TOOL_NAME -d '{}' | jq
  • Set COMPOSIO_API_KEY as an environment variable for CI/CD pipelines
  • Use composio dev logs tools to inspect execution logs and debug issues

Next Steps

  • Try asking your coding agent to perform various Outlook operations
  • Explore cross-app workflows by connecting more toolkits
  • Set up triggers for real-time automation
  • Use composio generate for typed schemas in your projects

How to build Outlook MCP Agent with another framework

FAQ

What is the Composio Universal CLI?

The Composio Universal CLI is a single command-line interface that lets coding agents and developers interact with 850+ SaaS applications. It handles authentication, tool discovery, action execution, and trigger setup — all from the terminal, without needing to configure MCP servers.

Which coding agents work with the Composio CLI?

Any coding agent that can run shell commands works with the Composio CLI — including Claude Code, Codex, OpenCode, OpenClaw, and others. Once the CLI is installed, agents automatically discover and use the composio commands to interact with Outlook and other connected apps.

How is the CLI different from using an MCP server for Outlook?

MCP servers require configuration and can be token-heavy for complex workflows. The CLI gives agents a direct, lightweight interface — no server setup needed. Agents simply call composio commands like any other shell tool. It's faster to set up, more reliable for multi-step tool chaining, and works natively with how coding agents already operate.

How safe is my Outlook data when using the Composio CLI?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Outlook data and credentials are handled as safely as possible. You can also bring your own OAuth credentials for full control.

Used by agents from

Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai

Never worry about agent reliability

We handle tool reliability, observability, and security so you never have to second-guess an agent action.