Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Microsoft 365

Scalekit connector
Open markdown

The Microsoft 365 connector lets your AI agent act in each user's Microsoft 365 account. Each user signs in to Microsoft 365 once, and Scalekit stores and refreshes their tokens, so your agent never handles credentials. It comes with 317 tools.

Tools
317
What they doRead · write · destructive
127 · 150 · 40127 read150 write40 destructive
Users sign in with
OAuth app
Scalekit's or your own

What you can do

  • Read and send email: list, search, send, reply to, forward, and move Outlook messages, including shared mailboxes
  • Manage calendars: create, update, and respond to Outlook events, check free/busy time, and find meeting times
  • Work in Teams: send channel and chat messages, reply to threads, create teams and channels, and schedule online meetings
  • Manage OneDrive and SharePoint files: upload, download, move, share, and search files and folders across drives and sites
  • Update Excel workbooks: read and write ranges, manage tables and worksheets, and create charts
  • Manage tasks, contacts, and notes: create and update To Do tasks and Outlook contacts, and create OneNote pages

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. Find values in app.scalekit.com > Developers > API Credentials.

    .env
    SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
    SCALEKIT_CLIENT_ID=<your-client-id>
    SCALEKIT_CLIENT_SECRET=<your-client-secret>
  3. Create the Microsoft 365 connection

    In AgentKit > Connections, create a Microsoft 365 connection. The name you give it is the connection_name your code passes. See Configure connections.

    Scalekit credentials are available for Microsoft 365, so you don't need to register an OAuth app. To show your own app on the consent screen, use your own credentials instead.

    Use your own OAuth app

    Register your Scalekit environment with the Microsoft 365 connector so Scalekit handles the authentication flow and token lifecycle for you. The connection name you create will be used to identify and invoke the connection programmatically. Then complete the configuration in your application as follows:

    1. Create the Microsoft 365 connection in Scalekit

      • In Scalekit dashboard, go to AgentKit > Connections > Create Connection. Search for Microsoft 365 and click Create.

      • In the Configure Microsoft 365 Connection dialog, copy the Redirect URI. You will need this when registering your app in Azure.

    2. Register an application in Azure

      • Sign into portal.azure.com and go to Microsoft Entra ID → App registrations.

      • Click New registration. Enter a name for your app (for example, “Scalekit Microsoft 365 Connector”).

      • Under Supported account types, select Accounts in any organizational directory (Any Microsoft Entra ID tenant - Multitenant) and personal Microsoft accounts.

      • Under Redirect URI, select Web and paste the redirect URI you copied from the Scalekit dashboard. Click Register.

    3. Get your client credentials

      • From the app’s Overview page, copy the Application (client) ID.

      • Go to Certificates & secrets in the left sidebar, then click + New client secret.

      • Enter a description (for example, “Secret for Scalekit Agent Actions”), set an expiry period, and click Add. Copy the secret Value immediately — it is only shown once.

    4. Add credentials in Scalekit

      • In Scalekit dashboard, go to AgentKit > Connections and open the Microsoft 365 connection you created.

      • Enter your credentials:

        • Client ID — the Application (client) ID from the Azure app overview
        • Client Secret — the secret value from Certificates & secrets
        • Scopes — select the permissions your app needs (for example, Calendars.Read, Calendars.ReadWrite, Mail.Read, Mail.ReadWrite, Mail.Send, Contacts.Read, Contacts.ReadWrite, User.Read, offline_access). See Microsoft Graph permissions reference for the full list.
      • Click Save.

  4. Authorize a user and make your first call

    quickstart.mts
    import { ScalekitClient } from '@scalekit-sdk/node'
    import 'dotenv/config'
    import { createInterface } from 'node:readline/promises'
    const scalekit = new ScalekitClient(
    process.env.SCALEKIT_ENVIRONMENT_URL,
    process.env.SCALEKIT_CLIENT_ID,
    process.env.SCALEKIT_CLIENT_SECRET,
    )
    const actions = scalekit.actions
    const connector = 'microsoft365'
    const identifier = 'user_123'
    // Generate an authorization link for the user
    const { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })
    console.log('Authorize Microsoft 365:', link)
    const rl = createInterface({ input: process.stdin, output: process.stdout })
    await rl.question('Press Enter after authorizing...')
    rl.close()
    // Make your first call
    const result = await actions.executeTool({
    connector,
    identifier,
    toolName: 'microsoft365_onedrive_get_drive',
    toolInput: {},
    })
    console.log(result)
    Terminal window
    npx tsx quickstart.mts

    Each user signs in once. See Authorize a user for the full flow and statuses.

Tools

Pass the exact name to execute_tool
Try in PlaygroundRequest a tool
  • microsoft365_excel_export_to_pdfExport an Excel workbook stored in OneDrive to PDF format.Read-only

    Export Excel to PDF

    Export an Excel workbook stored in OneDrive to PDF format. Uses the Microsoft Graph OneDrive content endpoint with format=pdf query parameter. Returns the PDF binary content. The response may be a direct 200 with the PDF body or a 302 redirect to a download URL depending on file size.

    Inputs

    item_idstringrequired
    OneDrive item ID of the Excel (.xlsx) file to export. Example: '01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K'.
  • microsoft365_excel_get_rangeRetrieve the values, formulas, format, and address of a cell range in an Excel worksheet stored in OneDrive.Read-only

    Get Excel Range

    Retrieve the values, formulas, format, and address of a cell range in an Excel worksheet stored in OneDrive. Specify the range using standard Excel notation (e.g., 'A1:C10' or 'B2'). Optionally accepts a workbook session ID.

    Inputs

    addressstringrequired
    Cell range address in Excel notation to retrieve. Examples: 'A1' for a single cell, 'A1:C10' for a multi-cell range, 'Sheet1!A1:B5' to target a specific sheet within the address.
    item_idstringrequired
    OneDrive item ID of the Excel (.xlsx) file. Example: '01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K'.
    worksheet_idstringrequired
    Worksheet name or GUID containing the range. Example: 'Sheet1' or '{00000000-0001-0000-0000-000000000000}'.
    session_idstring
    Optional workbook session ID from createSession. When provided, sent as the workbook-session-id header. Example: 'cluster=SN2&session=...'.
  • microsoft365_excel_get_tableRetrieve details of a specific table in an Excel workbook stored in OneDrive, including its name, style, column count, and header/total row settings.Read-only

    Get Excel Table

    Retrieve details of a specific table in an Excel workbook stored in OneDrive, including its name, style, column count, and header/total row settings. Accepts either a numeric table ID or the table name.

    Inputs

    item_idstringrequired
    OneDrive item ID of the Excel (.xlsx) file. Example: '01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K'.
    table_idstringrequired
    Table name or numeric ID to retrieve. Example: 'Table1' or '1'. Both the table name and the workbook-assigned numeric ID are accepted.
    session_idstring
    Optional workbook session ID from createSession. When provided, sent as the workbook-session-id header. Example: 'cluster=SN2&session=...'.
  • microsoft365_excel_get_used_rangeGet the smallest range that encompasses all cells in a worksheet that have a value or formatting, without needing to know the data's exact boundaries ahead of time.Read-only

    Get Excel Used Range

    Get the smallest range that encompasses all cells in a worksheet that have a value or formatting, without needing to know the data's exact boundaries ahead of time.

    Inputs

    item_idstringrequired
    OneDrive item ID of the Excel (.xlsx) file.
    worksheet_idstringrequired
    Worksheet name or GUID containing the data.
    session_idstring
    Optional workbook session ID from createSession. When provided, sent as the workbook-session-id header. Example: 'cluster=SN2&session=...'.
  • microsoft365_excel_get_worksheetRetrieve the properties of a specific worksheet in an Excel workbook stored in OneDrive.Read-only

    Get Excel Worksheet

    Retrieve the properties of a specific worksheet in an Excel workbook stored in OneDrive. Use the worksheet name or its GUID as the worksheet_id. Optionally accepts a workbook session ID.

    Inputs

    item_idstringrequired
    OneDrive item ID of the Excel (.xlsx) file. Example: '01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K'.
    worksheet_idstringrequired
    The worksheet name or GUID to retrieve. Use the sheet tab name (e.g., 'Sheet1') or the worksheet's unique GUID. Example: 'Sheet1' or '{00000000-0001-0000-0000-000000000000}'.
    session_idstring
    Optional workbook session ID from createSession. When provided, sent as the workbook-session-id header. Example: 'cluster=SN2&session=...'.
  • microsoft365_excel_list_chartsList all charts in an Excel worksheet stored in OneDrive.Read-only

    List Excel Charts

    List all charts in an Excel worksheet stored in OneDrive. Returns chart names, IDs, type, dimensions, and position. Supports OData $top for pagination.

    Inputs

    item_idstringrequired
    OneDrive item ID of the Excel (.xlsx) file. Example: '01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K'.
    worksheet_idstringrequired
    Worksheet name or GUID containing the charts to list. Example: 'Sheet1'.
    session_idstring
    Optional workbook session ID from createSession. When provided, sent as the workbook-session-id header. Example: 'cluster=SN2&session=...'.
    topinteger
    Maximum number of charts to return (1–1000). Defaults to server-defined page size.
  • microsoft365_excel_list_commentsList all comments in an Excel workbook stored in OneDrive.Read-only

    List Excel Comments

    List all comments in an Excel workbook stored in OneDrive. Returns comment IDs, author information, content, cell location, and creation date. Supports OData $top for pagination.

    Inputs

    item_idstringrequired
    OneDrive item ID of the Excel (.xlsx) file. Example: '01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K'.
    session_idstring
    Optional workbook session ID from createSession. When provided, sent as the workbook-session-id header. Example: 'cluster=SN2&session=...'.
    topinteger
    Maximum number of comments to return (1–1000). Defaults to server-defined page size.
  • microsoft365_excel_list_named_itemsList all named items (named ranges and constants) in an Excel workbook stored in OneDrive.Read-only

    List Excel Named Items

    List all named items (named ranges and constants) in an Excel workbook stored in OneDrive. Returns the name, type, value, and scope for each named item. Supports OData $top for pagination and $select for field projection.

    Inputs

    item_idstringrequired
    OneDrive item ID of the Excel (.xlsx) file. Example: '01BYE5RZ6QN3ZWBTUFOFD3GSPGOHDJD36K'.
    selectstring
    Comma-separated list of properties to return for each named item. Example: 'name,type,value' to return only those fields.
    session_idstring
    Optional workbook session ID from createSession. When provided, sent as the workbook-session-id header. Example: 'cluster=SN2&session=...'.
    topinteger
    Maximum number of named items to return (1–1000). Defaults to server-defined page size.

Workflows

Proxy API call
const result = await actions.request({
connectionName: 'microsoft365',
identifier: 'user_123',
path: '/v1.0/me/messages',
method: 'GET',
});
console.log(result);
Execute a tool
const result = await actions.executeTool({
connector: 'microsoft365',
identifier: 'user_123',
toolName: 'microsoft365_outlook_create_calendar_event',
toolInput: {
subject: 'Project sync',
start_datetime: '2026-10-15T10:00:00',
start_timezone: 'UTC',
end_datetime: '2026-10-15T10:30:00',
end_timezone: 'UTC',
},
});
console.log(result);