> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jinba.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Microsoft Teams

> Manage Microsoft Teams channels and messages via Microsoft Graph

## Overview

Microsoft Teams tools let you list teams, channels, chats, channel messages, and chat messages, search messages, look up online meetings, add members to teams, private or shared channels, and group chats, send messages to channels or chats (DMs), reply to channel threads, create channels, and create one-on-one or group chats through Microsoft Graph.

## Key Features

* `TEAMS_LIST_TEAMS`
  * Get a list of teams the user has joined.
* `TEAMS_LIST_CHANNELS`
  * Get a list of channels in a team.
* `TEAMS_LIST_CHANNEL_MESSAGES`
  * Get messages posted in a channel, optionally including thread replies.
* `TEAMS_LIST_CHATS`
  * Get a list of chats the signed-in user participates in.
* `TEAMS_LIST_CHAT_MESSAGES`
  * Get messages posted in a one-on-one or group chat.
* `TEAMS_SEARCH_MESSAGES`
  * Search Teams chat messages with Microsoft Graph Search, with optional date-range bounds and pagination.
* `TEAMS_LIST_ONLINE_MEETINGS`
  * List Teams online meetings by join URL or video teleconference ID, or scan a calendar window for Teams meetings.
* `TEAMS_GET_ONLINE_MEETING`
  * Get a Teams online meeting by Graph meeting ID, join URL, or video teleconference ID.
* `TEAMS_ADD_CHANNEL_MEMBER`
  * Add a user to a private or shared channel as a member or owner.
* `TEAMS_ADD_TEAM_MEMBER`
  * Add a user to a team as a member or owner. Use this for standard (public) channels, which inherit team membership.
* `TEAMS_ADD_CHAT_MEMBER`
  * Add a user to an existing group chat, optionally sharing prior history.
* `TEAMS_SEND_MESSAGE`
  * Send messages to Teams channels (plain text or HTML format).
* `TEAMS_REPLY_TO_MESSAGE`
  * Reply to a Teams channel message thread.
* `TEAMS_CREATE_CHANNEL`
  * Create new channels within a team (public or private).
* `TEAMS_CREATE_CHAT`
  * Create a new 1-on-1 or group chat. The signed-in user is added automatically.
* `TEAMS_SEND_CHAT_MESSAGE`
  * Send a message to a Teams chat (DM). Supports plain text and HTML.

## Authentication

These tools require a Microsoft Graph OAuth token.

Go to the [Jinba secrets dashboard](https://flow.jinba.io/workspace/secrets) and connect a Microsoft account for Teams. Use the generated token in the tool config.

The Teams OAuth connection requests Microsoft Graph scopes for channel messages, chat messages, channels, channel membership, team membership, chat membership, teams, sending messages, and token refresh. Existing Teams secrets created before these scopes were added must be reconnected. Adding team members (`TeamMember.ReadWrite.All`) or chat members (`ChatMember.ReadWrite`) may require tenant admin consent.

### Example: List Teams, Create a Private Channel, Add a Member, and Send Message

```yaml theme={null}
- id: list_teams
  name: list_teams
  tool: TEAMS_LIST_TEAMS
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_TEAMS.access_token}}"
  input: []

- id: list_channels
  name: list_channels
  tool: TEAMS_LIST_CHANNELS
  needs: ["list_teams"]
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_TEAMS.access_token}}"
  input:
    - name: team_id
      value: "{{steps.list_teams.result.teams[0].id}}"

- id: list_channel_messages
  name: list_channel_messages
  tool: TEAMS_LIST_CHANNEL_MESSAGES
  needs: ["list_teams", "list_channels"]
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_TEAMS.access_token}}"
  input:
    - name: team_id
      value: "{{steps.list_teams.result.teams[0].id}}"
    - name: channel_id
      value: "{{steps.list_channels.result.channels[0].id}}"
    - name: include_replies
      value: true

- id: list_chats
  name: list_chats
  tool: TEAMS_LIST_CHATS
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_TEAMS.access_token}}"
  input: []

- id: list_chat_messages
  name: list_chat_messages
  tool: TEAMS_LIST_CHAT_MESSAGES
  needs: ["list_chats"]
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_TEAMS.access_token}}"
  input:
    - name: chat_id
      value: "{{steps.list_chats.result.chats[0].id}}"

- id: create_channel
  name: create_channel
  tool: TEAMS_CREATE_CHANNEL
  needs: ["list_teams"]
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_TEAMS.access_token}}"
  input:
    - name: team_id
      value: "{{steps.list_teams.result.teams[0].id}}"
    - name: channel_name
      value: "project-alpha-2025"
    - name: description
      value: "Project Alpha for FY2025"
    - name: is_private
      value: true

- id: add_channel_member
  name: add_channel_member
  tool: TEAMS_ADD_CHANNEL_MEMBER
  needs: ["create_channel"]
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_TEAMS.access_token}}"
  input:
    - name: team_id
      value: "{{steps.list_teams.result.teams[0].id}}"
    - name: channel_id
      value: "{{steps.create_channel.result.channel_id}}"
    - name: user_id
      value: "alice@example.com"
    - name: role
      value: "member"

- id: send_message
  name: send_message
  tool: TEAMS_SEND_MESSAGE
  needs: ["add_channel_member"]
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_TEAMS.access_token}}"
  input:
    - name: team_id
      value: "{{steps.list_teams.result.teams[0].id}}"
    - name: channel_id
      value: "{{steps.create_channel.result.channel_id}}"
    - name: message
      value: "Daily Report: Completed 15 tasks, 8 in progress"
    - name: message_type
      value: "text"
```

### Example: Create a 1-on-1 Chat and Send a DM

```yaml theme={null}
- id: create_chat
  name: create_chat
  tool: TEAMS_CREATE_CHAT
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_TEAMS.access_token}}"
  input:
    - name: chat_type
      value: "oneOnOne"
    - name: member_ids
      value: "bob@example.com"

- id: send_chat_message
  name: send_chat_message
  tool: TEAMS_SEND_CHAT_MESSAGE
  needs: ["create_chat"]
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_TEAMS.access_token}}"
  input:
    - name: chat_id
      value: "{{steps.create_chat.result.chat_id}}"
    - name: message
      value: "Hello! I wanted to reach out directly."
    - name: message_type
      value: "text"
```

### Example: Search Messages and Look Up an Online Meeting

```yaml theme={null}
- id: search_messages
  name: search_messages
  tool: TEAMS_SEARCH_MESSAGES
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_TEAMS.access_token}}"
  input:
    - name: query
      value: "project alpha status"
    - name: from
      value: "2026-07-01T00:00:00+09:00"
    - name: to
      value: "2026-07-14T00:00:00+09:00"
    - name: size
      value: 25

- id: list_online_meetings
  name: list_online_meetings
  tool: TEAMS_LIST_ONLINE_MEETINGS
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_TEAMS.access_token}}"
  input:
    # With start_datetime/end_datetime, scans the calendar window for Teams meetings
    - name: start_datetime
      value: "2026-07-14T00:00:00+09:00"
    - name: end_datetime
      value: "2026-07-21T00:00:00+09:00"
    - name: top
      value: 25

- id: get_online_meeting
  name: get_online_meeting
  tool: TEAMS_GET_ONLINE_MEETING
  config:
    - name: token
      value: "{{secrets.MICROSOFT_GRAPH_TEAMS.access_token}}"
  input:
    # Specify one of meeting_id, join_web_url, or video_teleconference_id
    - name: join_web_url
      value: "https://teams.microsoft.com/l/meetup-join/..."
```
