Microsoft 365 Integration
Connect Microsoft 365 to access SharePoint, OneDrive, Outlook, Calendar, and Teams directly from your AI conversations.

Overview
The Microsoft 365 integration connects GPT Workbench to your organization's Microsoft ecosystem. Context blocks pull files from SharePoint and OneDrive into the AI's context, allowing it to reference your documents throughout a conversation. Tools give the AI the ability to search files, read and send emails, manage calendar events, and access Teams messages in real time.
This integration authenticates through Azure AD using the OAuth 2.0 protocol. GPT Workbench requests only the permissions necessary for the capabilities you enable, and all tool interactions are logged in the thread's message history.
Setup
Prerequisites
Before connecting Microsoft 365, ensure:
- Your organization administrator has configured the Azure AD app registration credentials in Organization Settings > Integrations
- You have a Microsoft 365 account (business or enterprise) with appropriate licenses
- Your Azure AD tenant allows third-party application consent (or an admin has pre-approved the application)
Connecting Your Account

- Go to Profile > Integrations
- Locate Microsoft 365 in the integrations list
- Click Connect
- A popup opens with the Microsoft sign-in page
- Enter your Microsoft 365 credentials
- Review the permissions being requested
- Click Accept
- The popup closes and GPT Workbench confirms the connection
The connection is immediate. SharePoint context blocks and Microsoft 365 tools become available in your threads right away.
Required Permissions
GPT Workbench requests the following Microsoft Graph API permissions:
| Permission | Purpose |
|---|---|
| Files.Read.All | Read files in SharePoint and OneDrive |
| Mail.ReadWrite | Read and send Outlook emails |
| Mail.Send | Send emails on your behalf |
| Calendars.ReadWrite | Read and create calendar events |
| ChannelMessage.Read.All | Read Teams channel messages |
| Sites.Read.All | Browse SharePoint sites and libraries |
| User.Read | Read your basic profile information |
Your Azure AD administrator may require admin consent for some of these permissions depending on your tenant's consent policy.
Context Blocks
Microsoft 365 context blocks pull files from SharePoint and OneDrive into the AI conversation. Files are downloaded, their content is extracted (using the same pipeline as document uploads), and the extracted text is included in the AI's context.
Adding a SharePoint Context Block

- Open your thread
- Click Manage Context
- Go to the Add New tab
- Click SharePoint
- Browse your SharePoint sites and document libraries
- Navigate through folders to find the file you need
- Select one or more files
- Optionally configure the cache duration
- Click Add Context
Supported File Formats
Files from SharePoint and OneDrive are processed through the same extraction pipeline as uploaded documents:
| Format | Extraction |
|---|---|
| DOCX | Full text extraction with structure preservation |
| Text extraction with OCR fallback for scanned documents | |
| XLSX | Spreadsheet data converted to structured text |
| PPTX | Slide content extracted as sequential text |
| CSV | Raw data preserved in tabular format |
| TXT | Direct text inclusion |
Cache Duration
SharePoint files are downloaded and cached for a configurable period. After the cache expires, files are re-downloaded on the next thread interaction.
| Duration | Use Case |
|---|---|
| 1 hour | Frequently updated documents (shared spreadsheets, living documents) |
| 24 hours | Standard documents (reports, specifications, policies) |
| 7 days | Archival content (completed project documentation, reference materials) |
File Size Considerations
Large files consume significant tokens from the model's context window. When a file exceeds the token threshold, GPT Workbench displays a warning with the option to summarize the content. For very large files (spreadsheets with thousands of rows, presentations with dozens of slides), consider summarizing or limiting the context to the most relevant sections.
Available Tools
When Microsoft 365 tools are enabled in a thread, the AI can interact with your Microsoft ecosystem during a conversation. Tools allow dynamic operations that go beyond static file context.
Enabling Microsoft 365 Tools
- Open your thread
- Click the Tools configuration
- Locate the Microsoft 365 tools section
- Enable the specific tools you want the AI to have access to
Email (Outlook)

Reading Emails
- Search your inbox by sender, subject, date range, or content keywords
- Read full email threads with all replies
- Access email metadata (timestamps, recipients, CC/BCC)
- View attachment names and types
Sending Emails
- Compose and send new emails
- Reply to existing email threads
- Set recipients (To, CC, BCC)
- Format email body with appropriate structure
Important: When the AI drafts an email, the tool call and email content are displayed in the thread before sending. In Console Mode, you must explicitly approve the send action. In Chat Mode, the AI will ask for confirmation before sending.
Calendar
Viewing Events
- List upcoming events for a date range
- Check availability and free/busy times
- View event details including attendees, location, and agenda
- Access recurring event patterns
Creating Events
- Schedule new meetings with title, time, and description
- Add attendees by email address
- Set reminders and recurrence patterns
- Specify physical or virtual meeting location
SharePoint and OneDrive
File Search
- Search across all SharePoint sites and OneDrive by filename
- Search by file content (full-text search when indexed by SharePoint)
- Filter by file type, modification date, or site
File Operations
- Read file contents directly during a conversation
- List folder contents to browse document libraries
- Access file metadata (author, last modified, version)
Teams
Channel Messages
- Access Teams channels within your organization
- Read conversation threads in channels
- Search message history by keyword or date range
- View message reactions and replies
Use Cases
Document Analysis
Add SharePoint files as context blocks and ask the AI to:
- Summarize a lengthy report or specification document
- Compare two versions of a contract or proposal
- Extract key data points from a spreadsheet
- Identify inconsistencies across multiple documents
Email Drafting and Management
Enable email tools and ask the AI to:
- Draft a professional response to a client email, referencing attached documents for accuracy
- Summarize a long email thread into key discussion points and action items
- Search for emails from a specific sender about a particular topic
- Compose a meeting follow-up email that references calendar event details
Meeting Preparation
Combine calendar and file tools to:
- List today's meetings and retrieve related documents from SharePoint
- Create a meeting brief with agenda items from email threads
- Prepare talking points based on documents shared in a Teams channel
- Draft meeting notes templates with attendee information from the calendar event
Cross-System Research
Use multiple Microsoft 365 capabilities together:
- Search emails for a project topic, find related SharePoint documents, and create a summary
- Check calendar availability and draft a meeting invite with relevant files attached
- Review Teams channel discussions and compile key decisions into a report
- Search OneDrive for recent files and cross-reference with email conversations
Configuration
Per-Thread Tool Selection
Each thread can have a different set of Microsoft 365 tools enabled. This allows you to:
- Enable only email tools for communication-focused threads
- Enable only SharePoint tools for document analysis threads
- Enable all tools for comprehensive research threads
Limiting the enabled tools reduces token consumption and helps the AI focus on the relevant capabilities.
Organization-Level Controls
Organization administrators can configure:
- Available capabilities -- Enable or disable specific tool categories (email, calendar, files, Teams) for the entire organization
- Usage policies -- Set guidelines for email sending and other write operations
- Domain restrictions -- Limit which SharePoint sites or email domains are accessible
Best Practices
- Be specific with file searches. Include the SharePoint site name or folder path when asking the AI to find files. "Find the Q4 report in the Marketing SharePoint" is more effective than "Find the Q4 report."
- Use folder navigation. When you know the approximate location of a file, ask the AI to list folder contents and navigate to it rather than relying on search alone.
- Review before sending. Always review AI-composed emails before approving the send action. Verify recipients, tone, and factual accuracy.
- Combine with context blocks. For document analysis, add the file as a context block rather than using the file read tool. Context blocks persist throughout the conversation, while tool reads are one-time fetches.
- Manage calendar carefully. When asking the AI to create calendar events, provide explicit details (exact time, duration, attendees) to avoid miscommunication.
- Check permissions first. If the AI reports access denied errors, verify that your Microsoft 365 account has the necessary permissions for the resource you are trying to access.
Troubleshooting
Connection Issues
"Connection expired" error Your Microsoft 365 OAuth token has expired. Go to Profile > Integrations and click Reconnect on your Microsoft 365 connection.
"Admin consent required" during connection Your Azure AD tenant requires administrator approval for the application. Contact your IT administrator to grant admin consent for the GPT Workbench application in Azure AD.
Cannot access certain SharePoint sites SharePoint permissions are inherited from your Microsoft 365 account. If you cannot access a site through GPT Workbench, you also cannot access it through SharePoint directly. Request access from the site owner.
Tool Issues
Email search returns no results Microsoft Graph search indexes emails asynchronously. Very recent emails (less than a few minutes old) may not appear in search results. Try again after a short wait, or search by sender email address for more reliable results.
Calendar events not showing Verify that the calendar you are querying is your primary calendar. Shared calendars and group calendars may require additional permissions.
Related Documentation
- Integration Overview - How integrations work in GPT Workbench
- Context Blocks - Managing context blocks across all types
- Tools Overview - Understanding native and MCP tools
- Documents - Document upload and management
