Prerequisites

1. Create Entra Application

  1. Go to Microsoft Entra admin center > App registrations > New registration.
  2. Set Supported account types (Recommended: “Accounts in this organizational directory only”).
  3. Set Redirect URI:
    • Docker (Web): https://allm.loca.zone/api/agent-skills/outlook/auth-callback (Use HTTPS domain if hosted on server).
    • Desktop: Select Public client/native (mobile & desktop) and enter anythingllm://outlook-agent-skill-entra-register-callback.

2. Configure API Permissions

  1. Go to the registered application > API permissions.
  2. Add the following permissions:
    • email
    • Mail.Read
    • Mail.ReadWrite
    • Mail.Send
    • offline_access
    • User.Read
  3. Save changes.

3. Generate Client Secret (Docker Only)

  1. Go to Certificates & secrets > New client secret.
  2. Set description and expiration > Click Add.
  3. Copy the Value (not the ID) for AnythingLLM configuration.

4. Configure & Authenticate AnythingLLM

  1. Copy the Application (client) ID and Directory (tenant) ID from the application Overview tab.
  2. In AnythingLLM, go to Settings > Agent Skills > Outlook Agent.
  3. Select Application Type, input the credentials, and click Authenticate with Microsoft.

Agent Capabilities & Command Reference

Search & Read

No approval required. Attachment downloads require confirmation.

  • Outlook Get Inbox: Retrieves recent emails (subject, sender, date, read status).
  • Outlook Search: Searches mailboxes using Microsoft Search syntax.
    • Syntax examples: from:email, subject:word, hasAttachments:true.
  • Outlook Read Thread: Retrieves full email conversation by conversation ID.

Drafts

Actions marked with ✏️ require user approval.

  • Create Draft ✏️: Creates a draft with recipients (To, CC, BCC), body (text/HTML), and attachments. Can reply to existing message IDs.
  • Update Draft ✏️: Modifies recipients, subject, body, or CC of an existing draft.
  • List Drafts: Returns summary of all drafts (ID, subject, recipients, preview).
  • Delete Draft ✏️: Permanently deletes a draft.
  • Send Draft ✏️: Sends an existing draft.

Send & Reply

Actions marked with ✏️ require user approval.

  • Send Email ✏️: Sends an email immediately (To, CC, BCC, text/HTML, attachments).
  • Reply to Thread ✏️: Sends a reply or reply-all to a thread. Supports attachments.

Account Stats

  • Get Mailbox Stats: Returns total/unread counts for Inbox, Drafts, Sent Items, and Deleted Items.

Tear Down / Decommissioning

  1. Disable the Outlook Agent skill in AnythingLLM settings.
  2. Go to Microsoft Entra admin center > App registrations > select the application.
  3. Click Delete and confirm.