mirror of
https://github.com/crewAIInc/crewAI.git
synced 2026-04-25 12:22:38 +00:00
* docs: add missing integration actions from OAuth config Sync enterprise integration docs with crewai-oauth apps.js config. Adds ~96 missing actions across 9 integrations: - Google Contacts: 4 contact group actions - Google Slides: 14 slide manipulation/content actions - Microsoft SharePoint: 27 file, Excel, and Word actions - Microsoft Excel: 2 actions (get_used_range_metadata, get_table_data) - Microsoft Word: 2 actions (copy_document, move_document) - Google Docs: 27 text formatting, table, and header/footer actions - Microsoft Outlook: 7 message and calendar event actions - Microsoft OneDrive: 5 path-based and discovery actions - Microsoft Teams: 8 meeting, channel, and reply actions * docs: add missing integration actions from OAuth config Sync pt-BR enterprise integration docs with crewai-oauth apps.js config. Adds ~96 missing actions across 9 integrations, translated to Portuguese: - Google Contacts: 2 contact group actions - Google Slides: 14 slide manipulation/content actions - Microsoft SharePoint: 27 file, Excel, and Word actions - Microsoft Excel: 2 actions (get_used_range_metadata, get_table_data) - Microsoft Word: 2 actions (copy_document, move_document) - Google Docs: 27 text formatting, table, and header/footer actions - Microsoft Outlook: 7 message and calendar event actions - Microsoft OneDrive: 5 path-based and discovery actions - Microsoft Teams: 8 meeting, channel, and reply actions * docs: add missing integration actions from OAuth config Sync Korean enterprise integration docs with crewai-oauth apps.js config. Adds ~96 missing actions across 9 integrations, translated to Korean: - Google Contacts: 2 contact group actions - Google Slides: 14 slide manipulation/content actions - Microsoft SharePoint: 27 file, Excel, and Word actions - Microsoft Excel: 2 actions (get_used_range_metadata, get_table_data) - Microsoft Word: 2 actions (copy_document, move_document) - Google Docs: 27 text formatting, table, and header/footer actions - Microsoft Outlook: 7 message and calendar event actions - Microsoft OneDrive: 5 path-based and discovery actions - Microsoft Teams: 8 meeting, channel, and reply actions --------- Co-authored-by: Greyson LaLonde <greyson.r.lalonde@gmail.com>
324 lines
12 KiB
Plaintext
324 lines
12 KiB
Plaintext
---
|
|
title: Microsoft Teams Integration
|
|
description: "Team collaboration and communication with Microsoft Teams integration for CrewAI."
|
|
icon: "users"
|
|
mode: "wide"
|
|
---
|
|
|
|
## Overview
|
|
|
|
Enable your agents to access Teams data, send messages, create meetings, and manage channels. Automate team communication, schedule meetings, retrieve messages, and streamline your collaboration workflows with AI-powered automation.
|
|
|
|
## Prerequisites
|
|
|
|
Before using the Microsoft Teams integration, ensure you have:
|
|
|
|
- A [CrewAI AMP](https://app.crewai.com) account with an active subscription
|
|
- A Microsoft account with Teams access
|
|
- Connected your Microsoft account through the [Integrations page](https://app.crewai.com/crewai_plus/connectors)
|
|
|
|
## Setting Up Microsoft Teams Integration
|
|
|
|
### 1. Connect Your Microsoft Account
|
|
|
|
1. Navigate to [CrewAI AMP Integrations](https://app.crewai.com/crewai_plus/connectors)
|
|
2. Find **Microsoft Teams** in the Authentication Integrations section
|
|
3. Click **Connect** and complete the OAuth flow
|
|
4. Grant the necessary permissions for Teams access
|
|
5. Copy your Enterprise Token from [Integration Settings](https://app.crewai.com/crewai_plus/settings/integrations)
|
|
|
|
### 2. Install Required Package
|
|
|
|
```bash
|
|
uv add crewai-tools
|
|
```
|
|
|
|
### 3. Environment Variable Setup
|
|
|
|
<Note>
|
|
To use integrations with `Agent(apps=[])`, you must set the
|
|
`CREWAI_PLATFORM_INTEGRATION_TOKEN` environment variable with your Enterprise
|
|
Token.
|
|
</Note>
|
|
|
|
```bash
|
|
export CREWAI_PLATFORM_INTEGRATION_TOKEN="your_enterprise_token"
|
|
```
|
|
|
|
Or add it to your `.env` file:
|
|
|
|
```
|
|
CREWAI_PLATFORM_INTEGRATION_TOKEN=your_enterprise_token
|
|
```
|
|
|
|
## Available Actions
|
|
|
|
<AccordionGroup>
|
|
<Accordion title="microsoft_teams/get_teams">
|
|
**Description:** Get all teams the user is a member of.
|
|
|
|
**Parameters:**
|
|
- No parameters required.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_teams/get_channels">
|
|
**Description:** Get channels in a specific team.
|
|
|
|
**Parameters:**
|
|
- `team_id` (string, required): The ID of the team.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_teams/send_message">
|
|
**Description:** Send a message to a Teams channel.
|
|
|
|
**Parameters:**
|
|
- `team_id` (string, required): The ID of the team.
|
|
- `channel_id` (string, required): The ID of the channel.
|
|
- `message` (string, required): The message content.
|
|
- `content_type` (string, optional): Content type (html or text). Enum: `html`, `text`. Default is `text`.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_teams/get_messages">
|
|
**Description:** Get messages from a Teams channel.
|
|
|
|
**Parameters:**
|
|
- `team_id` (string, required): The ID of the team.
|
|
- `channel_id` (string, required): The ID of the channel.
|
|
- `top` (integer, optional): Number of messages to retrieve (max 50). Default is `20`.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_teams/create_meeting">
|
|
**Description:** Create a Teams meeting.
|
|
|
|
**Parameters:**
|
|
- `subject` (string, required): Meeting subject/title.
|
|
- `startDateTime` (string, required): Meeting start time (ISO 8601 format with timezone).
|
|
- `endDateTime` (string, required): Meeting end time (ISO 8601 format with timezone).
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_teams/search_online_meetings_by_join_url">
|
|
**Description:** Search online meetings by Join Web URL.
|
|
|
|
**Parameters:**
|
|
- `join_web_url` (string, required): The join web URL of the meeting to search for.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_teams/search_online_meetings_by_meeting_id">
|
|
**Description:** Search online meetings by external Meeting ID.
|
|
|
|
**Parameters:**
|
|
- `join_meeting_id` (string, required): The meeting ID (numeric code) that attendees use to join. This is the joinMeetingId shown in meeting invitations, not the Graph API meeting id.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_teams/get_meeting">
|
|
**Description:** Get details of a specific online meeting.
|
|
|
|
**Parameters:**
|
|
- `meeting_id` (string, required): The Graph API meeting ID (a long alphanumeric string). Obtain from create_meeting or search_online_meetings actions. Different from the numeric joinMeetingId.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_teams/get_team_members">
|
|
**Description:** Get members of a specific team.
|
|
|
|
**Parameters:**
|
|
- `team_id` (string, required): The unique identifier of the team. Obtain from get_teams action.
|
|
- `top` (integer, optional): Maximum number of members to retrieve per page (1-999). Default is `100`.
|
|
- `skip_token` (string, optional): Pagination token from a previous response. When the response includes @odata.nextLink, extract the $skiptoken parameter value and pass it here to get the next page of results.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_teams/create_channel">
|
|
**Description:** Create a new channel in a team.
|
|
|
|
**Parameters:**
|
|
- `team_id` (string, required): The unique identifier of the team. Obtain from get_teams action.
|
|
- `display_name` (string, required): Name of the channel as displayed in Teams. Must be unique within the team. Max 50 characters.
|
|
- `description` (string, optional): Optional description explaining the channel's purpose. Visible in channel details. Max 1024 characters.
|
|
- `membership_type` (string, optional): Channel visibility. Enum: `standard`, `private`. "standard" = visible to all team members, "private" = visible only to specifically added members. Default is `standard`.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_teams/get_message_replies">
|
|
**Description:** Get replies to a specific message in a channel.
|
|
|
|
**Parameters:**
|
|
- `team_id` (string, required): The unique identifier of the team. Obtain from get_teams action.
|
|
- `channel_id` (string, required): The unique identifier of the channel. Obtain from get_channels action.
|
|
- `message_id` (string, required): The unique identifier of the parent message. Obtain from get_messages action.
|
|
- `top` (integer, optional): Maximum number of replies to retrieve per page (1-50). Default is `50`.
|
|
- `skip_token` (string, optional): Pagination token from a previous response. When the response includes @odata.nextLink, extract the $skiptoken parameter value and pass it here to get the next page of results.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_teams/reply_to_message">
|
|
**Description:** Reply to a message in a Teams channel.
|
|
|
|
**Parameters:**
|
|
- `team_id` (string, required): The unique identifier of the team. Obtain from get_teams action.
|
|
- `channel_id` (string, required): The unique identifier of the channel. Obtain from get_channels action.
|
|
- `message_id` (string, required): The unique identifier of the message to reply to. Obtain from get_messages action.
|
|
- `message` (string, required): The reply content. For HTML, include formatting tags. For text, plain text only.
|
|
- `content_type` (string, optional): Content format. Enum: `html`, `text`. "text" for plain text, "html" for rich text with formatting. Default is `text`.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_teams/update_meeting">
|
|
**Description:** Update an existing online meeting.
|
|
|
|
**Parameters:**
|
|
- `meeting_id` (string, required): The unique identifier of the meeting. Obtain from create_meeting or search_online_meetings actions.
|
|
- `subject` (string, optional): New meeting title.
|
|
- `startDateTime` (string, optional): New start time in ISO 8601 format with timezone. Example: "2024-01-20T10:00:00-08:00".
|
|
- `endDateTime` (string, optional): New end time in ISO 8601 format with timezone.
|
|
|
|
</Accordion>
|
|
|
|
<Accordion title="microsoft_teams/delete_meeting">
|
|
**Description:** Delete an online meeting.
|
|
|
|
**Parameters:**
|
|
- `meeting_id` (string, required): The unique identifier of the meeting to delete. Obtain from create_meeting or search_online_meetings actions.
|
|
|
|
</Accordion>
|
|
</AccordionGroup>
|
|
|
|
## Usage Examples
|
|
|
|
### Basic Microsoft Teams Agent Setup
|
|
|
|
```python
|
|
from crewai import Agent, Task, Crew
|
|
|
|
# Create an agent with Microsoft Teams capabilities
|
|
teams_agent = Agent(
|
|
role="Teams Coordinator",
|
|
goal="Manage Teams communication and meetings efficiently",
|
|
backstory="An AI assistant specialized in Microsoft Teams operations and team collaboration.",
|
|
apps=['microsoft_teams'] # All Teams actions will be available
|
|
)
|
|
|
|
# Task to list teams and channels
|
|
explore_teams_task = Task(
|
|
description="List all teams I'm a member of and then get the channels for the first team.",
|
|
agent=teams_agent,
|
|
expected_output="List of teams and channels displayed."
|
|
)
|
|
|
|
# Run the task
|
|
crew = Crew(
|
|
agents=[teams_agent],
|
|
tasks=[explore_teams_task]
|
|
)
|
|
|
|
crew.kickoff()
|
|
```
|
|
|
|
### Messaging and Communication
|
|
|
|
```python
|
|
from crewai import Agent, Task, Crew
|
|
|
|
# Create an agent focused on messaging
|
|
messenger = Agent(
|
|
role="Teams Messenger",
|
|
goal="Send and retrieve messages in Teams channels",
|
|
backstory="An AI assistant skilled in team communication and message management.",
|
|
apps=['microsoft_teams/send_message', 'microsoft_teams/get_messages']
|
|
)
|
|
|
|
# Task to send a message and retrieve recent messages
|
|
messaging_task = Task(
|
|
description="Send a message 'Hello team! This is an automated update from our AI assistant.' to the General channel of team 'your_team_id', then retrieve the last 10 messages from that channel.",
|
|
agent=messenger,
|
|
expected_output="Message sent successfully and recent messages retrieved."
|
|
)
|
|
|
|
crew = Crew(
|
|
agents=[messenger],
|
|
tasks=[messaging_task]
|
|
)
|
|
|
|
crew.kickoff()
|
|
```
|
|
|
|
### Meeting Management
|
|
|
|
```python
|
|
from crewai import Agent, Task, Crew
|
|
|
|
# Create an agent for meeting management
|
|
meeting_scheduler = Agent(
|
|
role="Meeting Scheduler",
|
|
goal="Create and manage Teams meetings",
|
|
backstory="An AI assistant that handles meeting scheduling and organization.",
|
|
apps=['microsoft_teams/create_meeting', 'microsoft_teams/search_online_meetings_by_join_url']
|
|
)
|
|
|
|
# Task to create a meeting
|
|
schedule_meeting_task = Task(
|
|
description="Create a Teams meeting titled 'Weekly Team Sync' scheduled for tomorrow at 10:00 AM lasting for 1 hour (use proper ISO 8601 format with timezone).",
|
|
agent=meeting_scheduler,
|
|
expected_output="Teams meeting created successfully with meeting details."
|
|
)
|
|
|
|
crew = Crew(
|
|
agents=[meeting_scheduler],
|
|
tasks=[schedule_meeting_task]
|
|
)
|
|
|
|
crew.kickoff()
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
### Common Issues
|
|
|
|
**Authentication Errors**
|
|
|
|
- Ensure your Microsoft account has the necessary permissions for Teams access.
|
|
- Required scopes include: `Team.ReadBasic.All`, `Channel.ReadBasic.All`, `ChannelMessage.Send`, `ChannelMessage.Read.All`, `OnlineMeetings.ReadWrite`, `OnlineMeetings.Read`.
|
|
- Verify that the OAuth connection includes all required scopes.
|
|
|
|
**Team and Channel Access**
|
|
|
|
- Ensure you are a member of the teams you're trying to access.
|
|
- Double-check team IDs and channel IDs for correctness.
|
|
- Team and channel IDs can be obtained using the `get_teams` and `get_channels` actions.
|
|
|
|
**Message Sending Issues**
|
|
|
|
- Ensure `team_id`, `channel_id`, and `message` are provided for `send_message`.
|
|
- Verify that you have permissions to send messages to the specified channel.
|
|
- Choose appropriate `content_type` (text or html) based on your message format.
|
|
|
|
**Meeting Creation**
|
|
|
|
- Ensure `subject`, `startDateTime`, and `endDateTime` are provided.
|
|
- Use proper ISO 8601 format with timezone for datetime fields (e.g., '2024-01-20T10:00:00-08:00').
|
|
- Verify that the meeting times are in the future.
|
|
|
|
**Message Retrieval Limitations**
|
|
|
|
- The `get_messages` action can retrieve a maximum of 50 messages per request.
|
|
- Messages are returned in reverse chronological order (newest first).
|
|
|
|
**Meeting Search**
|
|
|
|
- For `search_online_meetings_by_join_url`, ensure the join URL is exact and properly formatted.
|
|
- The URL should be the complete Teams meeting join URL.
|
|
|
|
### Getting Help
|
|
|
|
<Card title="Need Help?" icon="headset" href="mailto:support@crewai.com">
|
|
Contact our support team for assistance with Microsoft Teams integration setup
|
|
or troubleshooting.
|
|
</Card>
|