Automate Microsoft Teams tasks via Rube MCP (Composio): send messages, manage channels, create meetings, handle chats, and search messages. Always search tools first for current schemas.
Add this skill
npx mdskills install sickn33/microsoft-teams-automationComprehensive Teams automation with detailed workflows, ID formats, pitfalls, and pagination guidance
1---2name: microsoft-teams-automation3description: "Automate Microsoft Teams tasks via Rube MCP (Composio): send messages, manage channels, create meetings, handle chats, and search messages. Always search tools first for current schemas."4requires:5 mcp: [rube]6---78# Microsoft Teams Automation via Rube MCP910Automate Microsoft Teams operations through Composio's Microsoft Teams toolkit via Rube MCP.1112## Prerequisites1314- Rube MCP must be connected (RUBE_SEARCH_TOOLS available)15- Active Microsoft Teams connection via `RUBE_MANAGE_CONNECTIONS` with toolkit `microsoft_teams`16- Always call `RUBE_SEARCH_TOOLS` first to get current tool schemas1718## Setup1920**Get Rube MCP**: Add `https://rube.app/mcp` as an MCP server in your client configuration. No API keys needed — just add the endpoint and it works.2122231. Verify Rube MCP is available by confirming `RUBE_SEARCH_TOOLS` responds242. Call `RUBE_MANAGE_CONNECTIONS` with toolkit `microsoft_teams`253. If connection is not ACTIVE, follow the returned auth link to complete Microsoft OAuth264. Confirm connection status shows ACTIVE before running any workflows2728## Core Workflows2930### 1. Send Channel Messages3132**When to use**: User wants to post a message to a Teams channel3334**Tool sequence**:351. `MICROSOFT_TEAMS_TEAMS_LIST` - List teams to find target team [Prerequisite]362. `MICROSOFT_TEAMS_TEAMS_LIST_CHANNELS` - List channels in the team [Prerequisite]373. `MICROSOFT_TEAMS_TEAMS_POST_CHANNEL_MESSAGE` - Post the message [Required]3839**Key parameters**:40- `team_id`: UUID of the team (from TEAMS_LIST)41- `channel_id`: Channel ID (from LIST_CHANNELS, format: '19:...@thread.tacv2')42- `content`: Message text or HTML43- `content_type`: 'text' or 'html'4445**Pitfalls**:46- team_id must be a valid UUID format47- channel_id must be in thread format (e.g., '19:abc@thread.tacv2')48- TEAMS_LIST may paginate (~100 items/page); follow @odata.nextLink to find all teams49- LIST_CHANNELS can return 403 if user lacks access to the team50- Messages over ~28KB can trigger 400/413 errors; split long content51- Throttling may return 429; use exponential backoff (1s/2s/4s)5253### 2. Send Chat Messages5455**When to use**: User wants to send a direct or group chat message5657**Tool sequence**:581. `MICROSOFT_TEAMS_CHATS_GET_ALL_CHATS` - List existing chats [Optional]592. `MICROSOFT_TEAMS_LIST_USERS` - Find users for new chats [Optional]603. `MICROSOFT_TEAMS_TEAMS_CREATE_CHAT` - Create a new chat [Optional]614. `MICROSOFT_TEAMS_TEAMS_POST_CHAT_MESSAGE` - Send the message [Required]6263**Key parameters**:64- `chat_id`: Chat ID (from GET_ALL_CHATS or CREATE_CHAT)65- `content`: Message content66- `content_type`: 'text' or 'html'67- `chatType`: 'oneOnOne' or 'group' (for CREATE_CHAT)68- `members`: Array of member objects (for CREATE_CHAT)6970**Pitfalls**:71- CREATE_CHAT requires the authenticated user as one of the members72- oneOnOne chats return existing chat if one already exists between the two users73- group chats require at least one member with 'owner' role74- member user_odata_bind must use full Microsoft Graph URL format75- Chat filter support is very limited; filter client-side when needed7677### 3. Create Online Meetings7879**When to use**: User wants to schedule a Microsoft Teams meeting8081**Tool sequence**:821. `MICROSOFT_TEAMS_LIST_USERS` - Find participant user IDs [Optional]832. `MICROSOFT_TEAMS_CREATE_MEETING` - Create the meeting [Required]8485**Key parameters**:86- `subject`: Meeting title87- `start_date_time`: ISO 8601 start time (e.g., '2024-08-15T10:00:00Z')88- `end_date_time`: ISO 8601 end time (must be after start)89- `participants`: Array of user objects with user_id and role9091**Pitfalls**:92- end_date_time must be strictly after start_date_time93- Participants require valid Microsoft user_id (GUID) values, not emails94- This creates a standalone meeting not linked to a calendar event95- For calendar-linked meetings, use OUTLOOK_CALENDAR_CREATE_EVENT with is_online_meeting=true9697### 4. Manage Teams and Channels9899**When to use**: User wants to list, create, or manage teams and channels100101**Tool sequence**:1021. `MICROSOFT_TEAMS_TEAMS_LIST` - List all accessible teams [Required]1032. `MICROSOFT_TEAMS_GET_TEAM` - Get details for a specific team [Optional]1043. `MICROSOFT_TEAMS_TEAMS_LIST_CHANNELS` - List channels in a team [Optional]1054. `MICROSOFT_TEAMS_GET_CHANNEL` - Get channel details [Optional]1065. `MICROSOFT_TEAMS_TEAMS_CREATE_CHANNEL` - Create a new channel [Optional]1076. `MICROSOFT_TEAMS_LIST_TEAM_MEMBERS` - List team members [Optional]1087. `MICROSOFT_TEAMS_ADD_MEMBER_TO_TEAM` - Add a member to the team [Optional]109110**Key parameters**:111- `team_id`: Team UUID112- `channel_id`: Channel ID in thread format113- `filter`: OData filter string (e.g., "startsWith(displayName,'Project')")114- `select`: Comma-separated properties to return115116**Pitfalls**:117- TEAMS_LIST pagination: follow @odata.nextLink in large tenants118- Private/shared channels may be omitted unless permissions align119- GET_CHANNEL returns 404 if team_id or channel_id is wrong120- Always source IDs from list operations; do not guess ID formats121122### 5. Search Messages123124**When to use**: User wants to find messages across Teams chats and channels125126**Tool sequence**:1271. `MICROSOFT_TEAMS_SEARCH_MESSAGES` - Search with KQL syntax [Required]128129**Key parameters**:130- `query`: KQL search query (supports from:, sent:, attachments, boolean logic)131132**Pitfalls**:133- Newly posted messages may take 30-60 seconds to appear in search134- Search is eventually consistent; do not rely on it for immediate delivery confirmation135- Use message listing tools for real-time message verification136137## Common Patterns138139### Team and Channel ID Resolution140141```1421. Call MICROSOFT_TEAMS_TEAMS_LIST1432. Find team by displayName1443. Extract team id (UUID format)1454. Call MICROSOFT_TEAMS_TEAMS_LIST_CHANNELS with team_id1465. Find channel by displayName1476. Extract channel id (19:...@thread.tacv2 format)148```149150### User Resolution151152```1531. Call MICROSOFT_TEAMS_LIST_USERS1542. Filter by displayName or email1553. Extract user id (UUID format)1564. Use for meeting participants, chat members, or team operations157```158159### Pagination160161- Teams/Users: Follow @odata.nextLink URL for next page162- Chats: Auto-paginates up to limit; use top for page size (max 50)163- Use `top` parameter to control page size164- Continue until @odata.nextLink is absent165166## Known Pitfalls167168**Authentication and Permissions**:169- Different operations require different Microsoft Graph permissions170- 403 errors indicate insufficient permissions or team access171- Some operations require admin consent in the Azure AD tenant172173**ID Formats**:174- Team IDs: UUID format (e.g., '87b0560f-fc0d-4442-add8-b380ca926707')175- Channel IDs: Thread format (e.g., '19:abc123@thread.tacv2')176- Chat IDs: Various formats (e.g., '19:meeting_xxx@thread.v2')177- User IDs: UUID format178- Never guess IDs; always resolve from list operations179180**Rate Limits**:181- Microsoft Graph enforces throttling182- 429 responses include Retry-After header183- Keep requests to a few per second184- Batch operations help reduce total request count185186**Message Formatting**:187- HTML content_type supports rich formatting188- Adaptive cards require additional handling189- Message size limit is approximately 28KB190- Split long content into multiple messages191192## Quick Reference193194| Task | Tool Slug | Key Params |195|------|-----------|------------|196| List teams | MICROSOFT_TEAMS_TEAMS_LIST | filter, select, top |197| Get team details | MICROSOFT_TEAMS_GET_TEAM | team_id |198| List channels | MICROSOFT_TEAMS_TEAMS_LIST_CHANNELS | team_id, filter |199| Get channel | MICROSOFT_TEAMS_GET_CHANNEL | team_id, channel_id |200| Create channel | MICROSOFT_TEAMS_TEAMS_CREATE_CHANNEL | team_id, displayName |201| Post to channel | MICROSOFT_TEAMS_TEAMS_POST_CHANNEL_MESSAGE | team_id, channel_id, content |202| List chats | MICROSOFT_TEAMS_CHATS_GET_ALL_CHATS | user_id, limit |203| Create chat | MICROSOFT_TEAMS_TEAMS_CREATE_CHAT | chatType, members, topic |204| Post to chat | MICROSOFT_TEAMS_TEAMS_POST_CHAT_MESSAGE | chat_id, content |205| Create meeting | MICROSOFT_TEAMS_CREATE_MEETING | subject, start_date_time, end_date_time |206| List users | MICROSOFT_TEAMS_LIST_USERS | filter, select, top |207| List team members | MICROSOFT_TEAMS_LIST_TEAM_MEMBERS | team_id |208| Add team member | MICROSOFT_TEAMS_ADD_MEMBER_TO_TEAM | team_id, user_id |209| Search messages | MICROSOFT_TEAMS_SEARCH_MESSAGES | query |210| Get chat message | MICROSOFT_TEAMS_GET_CHAT_MESSAGE | chat_id, message_id |211| List joined teams | MICROSOFT_TEAMS_LIST_USER_JOINED_TEAMS | (none) |212
Full transparency — inspect the skill content before installing.