KosmoKrator

other

Microsoft Teams CLI for AI Agents

Use the Microsoft Teams CLI from KosmoKrator to call Microsoft Teams tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

8 functions 7 read 1 write Manual OAuth token auth

Microsoft Teams CLI Setup

Microsoft Teams can be configured headlessly with `kosmokrator integrations:configure microsoft-teams`.

# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure microsoft-teams --set access_token="$MICROSOFT_TEAMS_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor microsoft-teams --json
kosmokrator integrations:status --json

Credentials

Authentication type: Manual OAuth token oauth2_manual_token. Configure credentials once, then use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

KeyEnv varTypeRequiredLabel
access_token MICROSOFT_TEAMS_ACCESS_TOKEN Secret secret yes Access Token
base_url MICROSOFT_TEAMS_BASE_URL URL url no Graph API Base URL

Call Microsoft Teams Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

kosmo integrations:call microsoft-teams.microsoft_teams_list_teams '{}' --json

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:microsoft-teams microsoft_teams_list_teams '{}' --json

Agent Discovery Commands

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

kosmo integrations:docs microsoft-teams --json
kosmo integrations:docs microsoft-teams.microsoft_teams_list_teams --json
kosmo integrations:schema microsoft-teams.microsoft_teams_list_teams --json
kosmo integrations:search "Microsoft Teams" --json
kosmo integrations:list --json

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Microsoft Teams.

microsoft-teams.microsoft_teams_list_teams

Read read

List all Microsoft Teams teams the authenticated user has joined. Returns team IDs, names, and descriptions.

Parameters
none

Generic CLI call

kosmo integrations:call microsoft-teams.microsoft_teams_list_teams '{}' --json

Provider shortcut

kosmo integrations:microsoft-teams microsoft_teams_list_teams '{}' --json

microsoft-teams.microsoft_teams_get_team

Read read

Get details for a specific Microsoft Teams team by its ID. Returns the team name, description, and other properties.

Parameters
team_id

Generic CLI call

kosmo integrations:call microsoft-teams.microsoft_teams_get_team '{"team_id":"example_team_id"}' --json

Provider shortcut

kosmo integrations:microsoft-teams microsoft_teams_get_team '{"team_id":"example_team_id"}' --json

microsoft-teams.microsoft_teams_list_channels

Read read

List all channels in a Microsoft Teams team. Returns channel IDs, names, and descriptions.

Parameters
team_id

Generic CLI call

kosmo integrations:call microsoft-teams.microsoft_teams_list_channels '{"team_id":"example_team_id"}' --json

Provider shortcut

kosmo integrations:microsoft-teams microsoft_teams_list_channels '{"team_id":"example_team_id"}' --json

microsoft-teams.microsoft_teams_get_channel

Read read

Get details for a specific Microsoft Teams channel by its team and channel ID.

Parameters
team_id, channel_id

Generic CLI call

kosmo integrations:call microsoft-teams.microsoft_teams_get_channel '{"team_id":"example_team_id","channel_id":"example_channel_id"}' --json

Provider shortcut

kosmo integrations:microsoft-teams microsoft_teams_get_channel '{"team_id":"example_team_id","channel_id":"example_channel_id"}' --json

microsoft-teams.microsoft_teams_list_messages

Read read

List recent messages in a Microsoft Teams channel. Returns message content, sender info, and timestamps.

Parameters
team_id, channel_id, limit

Generic CLI call

kosmo integrations:call microsoft-teams.microsoft_teams_list_messages '{"team_id":"example_team_id","channel_id":"example_channel_id","limit":1}' --json

Provider shortcut

kosmo integrations:microsoft-teams microsoft_teams_list_messages '{"team_id":"example_team_id","channel_id":"example_channel_id","limit":1}' --json

microsoft-teams.microsoft_teams_send_message

Write write

Send a message to a Microsoft Teams channel. Supports plain text and HTML content.

Parameters
team_id, channel_id, content, content_type

Generic CLI call

kosmo integrations:call microsoft-teams.microsoft_teams_send_message '{"team_id":"example_team_id","channel_id":"example_channel_id","content":"example_content","content_type":"example_content_type"}' --json

Provider shortcut

kosmo integrations:microsoft-teams microsoft_teams_send_message '{"team_id":"example_team_id","channel_id":"example_channel_id","content":"example_content","content_type":"example_content_type"}' --json

microsoft-teams.microsoft_teams_list_chats

Read read

List chats for the authenticated Microsoft Teams user. Returns chat IDs, topics, and types (one-to-one, group, or meeting).

Parameters
limit

Generic CLI call

kosmo integrations:call microsoft-teams.microsoft_teams_list_chats '{"limit":1}' --json

Provider shortcut

kosmo integrations:microsoft-teams microsoft_teams_list_chats '{"limit":1}' --json

microsoft-teams.microsoft_teams_get_current_user

Read read

Get the profile of the currently authenticated Microsoft Teams user. Returns display name, email, and job title.

Parameters
none

Generic CLI call

kosmo integrations:call microsoft-teams.microsoft_teams_get_current_user '{}' --json

Provider shortcut

kosmo integrations:microsoft-teams microsoft_teams_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

microsoft-teams.microsoft_teams_list_teams

List all Microsoft Teams teams the authenticated user has joined. Returns team IDs, names, and descriptions.

Operation
Read read
Schema command
kosmo integrations:schema microsoft-teams.microsoft_teams_list_teams --json
ParameterTypeRequiredDescription
No parameters.

microsoft-teams.microsoft_teams_get_team

Get details for a specific Microsoft Teams team by its ID. Returns the team name, description, and other properties.

Operation
Read read
Schema command
kosmo integrations:schema microsoft-teams.microsoft_teams_get_team --json
ParameterTypeRequiredDescription
team_id string yes The unique identifier of the team.

microsoft-teams.microsoft_teams_list_channels

List all channels in a Microsoft Teams team. Returns channel IDs, names, and descriptions.

Operation
Read read
Schema command
kosmo integrations:schema microsoft-teams.microsoft_teams_list_channels --json
ParameterTypeRequiredDescription
team_id string yes The unique identifier of the team.

microsoft-teams.microsoft_teams_get_channel

Get details for a specific Microsoft Teams channel by its team and channel ID.

Operation
Read read
Schema command
kosmo integrations:schema microsoft-teams.microsoft_teams_get_channel --json
ParameterTypeRequiredDescription
team_id string yes The unique identifier of the team.
channel_id string yes The unique identifier of the channel.

microsoft-teams.microsoft_teams_list_messages

List recent messages in a Microsoft Teams channel. Returns message content, sender info, and timestamps.

Operation
Read read
Schema command
kosmo integrations:schema microsoft-teams.microsoft_teams_list_messages --json
ParameterTypeRequiredDescription
team_id string yes The unique identifier of the team.
channel_id string yes The unique identifier of the channel.
limit integer no Maximum number of messages to return (default: 50, max: 50).

microsoft-teams.microsoft_teams_send_message

Send a message to a Microsoft Teams channel. Supports plain text and HTML content.

Operation
Write write
Schema command
kosmo integrations:schema microsoft-teams.microsoft_teams_send_message --json
ParameterTypeRequiredDescription
team_id string yes The unique identifier of the team.
channel_id string yes The unique identifier of the channel.
content string yes The message content to send.
content_type string no The content type: "text" or "html". Defaults to "text".

microsoft-teams.microsoft_teams_list_chats

List chats for the authenticated Microsoft Teams user. Returns chat IDs, topics, and types (one-to-one, group, or meeting).

Operation
Read read
Schema command
kosmo integrations:schema microsoft-teams.microsoft_teams_list_chats --json
ParameterTypeRequiredDescription
limit integer no Maximum number of chats to return (default: 50, max: 50).

microsoft-teams.microsoft_teams_get_current_user

Get the profile of the currently authenticated Microsoft Teams user. Returns display name, email, and job title.

Operation
Read read
Schema command
kosmo integrations:schema microsoft-teams.microsoft_teams_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.