KosmoKrator

communication

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.

7 functions 6 read 1 write Bearer token auth

Microsoft Teams CLI Setup

Microsoft Teams can be configured headlessly with `kosmokrator integrations:configure 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 teams --set access_token="$TEAMS_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor teams --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_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 TEAMS_ACCESS_TOKEN Secret secret yes Access Token

Call Microsoft Teams Headlessly

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

kosmo integrations:call teams.teams_list_teams '{
  "top": 1,
  "skip": 1
}' --json

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

kosmo integrations:teams teams_list_teams '{
  "top": 1,
  "skip": 1
}' --json

Agent Discovery Commands

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

kosmo integrations:docs teams --json
kosmo integrations:docs teams.teams_list_teams --json
kosmo integrations:schema teams.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.

teams.teams_list_teams

Read read

List all Microsoft Teams the user is a member of.

Parameters
top, skip

Generic CLI call

kosmo integrations:call teams.teams_list_teams '{"top":1,"skip":1}' --json

Provider shortcut

kosmo integrations:teams teams_list_teams '{"top":1,"skip":1}' --json

teams.teams_get_team

Read read

Get detailed information about a Microsoft Team.

Parameters
team_id

Generic CLI call

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

Provider shortcut

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

teams.teams_list_channels

Read read

List all channels in a Microsoft Team.

Parameters
team_id, top, skip

Generic CLI call

kosmo integrations:call teams.teams_list_channels '{"team_id":"example_team_id","top":1,"skip":1}' --json

Provider shortcut

kosmo integrations:teams teams_list_channels '{"team_id":"example_team_id","top":1,"skip":1}' --json

teams.teams_get_channel

Read read

Get detailed information about a Microsoft Teams channel.

Parameters
team_id, channel_id

Generic CLI call

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

Provider shortcut

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

teams.teams_send_message

Write write

Send a message to a Microsoft Teams channel.

Parameters
team_id, channel_id, content, content_type

Generic CLI call

kosmo integrations:call teams.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:teams teams_send_message '{"team_id":"example_team_id","channel_id":"example_channel_id","content":"example_content","content_type":"example_content_type"}' --json

teams.teams_list_messages

Read read

List messages in a Microsoft Teams channel.

Parameters
team_id, channel_id, top, skip

Generic CLI call

kosmo integrations:call teams.teams_list_messages '{"team_id":"example_team_id","channel_id":"example_channel_id","top":1,"skip":1}' --json

Provider shortcut

kosmo integrations:teams teams_list_messages '{"team_id":"example_team_id","channel_id":"example_channel_id","top":1,"skip":1}' --json

teams.teams_get_current_user

Read read

Get information about the current authenticated Microsoft 365 user.

Parameters
none

Generic CLI call

kosmo integrations:call teams.teams_get_current_user '{}' --json

Provider shortcut

kosmo integrations:teams teams_get_current_user '{}' --json

Function Schemas

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

teams.teams_list_teams

List all Microsoft Teams the user is a member of.

Operation
Read read
Schema command
kosmo integrations:schema teams.teams_list_teams --json
ParameterTypeRequiredDescription
top integer no Number of teams to return (default 20, max 999).
skip integer no Number of teams to skip for pagination.

teams.teams_get_team

Get detailed information about a Microsoft Team.

Operation
Read read
Schema command
kosmo integrations:schema teams.teams_get_team --json
ParameterTypeRequiredDescription
team_id string yes The ID of the team.

teams.teams_list_channels

List all channels in a Microsoft Team.

Operation
Read read
Schema command
kosmo integrations:schema teams.teams_list_channels --json
ParameterTypeRequiredDescription
team_id string yes The ID of the team.
top integer no Number of channels to return (default 20, max 999).
skip integer no Number of channels to skip for pagination.

teams.teams_get_channel

Get detailed information about a Microsoft Teams channel.

Operation
Read read
Schema command
kosmo integrations:schema teams.teams_get_channel --json
ParameterTypeRequiredDescription
team_id string yes The ID of the team.
channel_id string yes The ID of the channel.

teams.teams_send_message

Send a message to a Microsoft Teams channel.

Operation
Write write
Schema command
kosmo integrations:schema teams.teams_send_message --json
ParameterTypeRequiredDescription
team_id string yes The ID of the team.
channel_id string yes The ID of the channel.
content string yes The message content to send.
content_type string no Content type: "text" (default) or "html".

teams.teams_list_messages

List messages in a Microsoft Teams channel.

Operation
Read read
Schema command
kosmo integrations:schema teams.teams_list_messages --json
ParameterTypeRequiredDescription
team_id string yes The ID of the team.
channel_id string yes The ID of the channel.
top integer no Number of messages to return (default 20, max 50).
skip integer no Number of messages to skip for pagination.

teams.teams_get_current_user

Get information about the current authenticated Microsoft 365 user.

Operation
Read read
Schema command
kosmo integrations:schema teams.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.