KosmoKrator

productivity

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.

Microsoft Teams CLI Setup

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

Install, configure, and verify
# 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 reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

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

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call microsoft-teams.microsoft_teams_list_teams '{}' --json
Provider shortcut
kosmo integrations:microsoft-teams microsoft_teams_list_teams '{}' --json

Discovery

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

Discovery commands
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

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

microsoft-teams.microsoft_teams_list_teams

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

Read read
Parameters
none
Generic call
kosmo integrations:call microsoft-teams.microsoft_teams_list_teams '{}' --json
Shortcut
kosmo integrations:microsoft-teams microsoft_teams_list_teams '{}' --json

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.

Read read
Parameters
team_id
Generic call
kosmo integrations:call microsoft-teams.microsoft_teams_get_team '{"team_id":"example_team_id"}' --json
Shortcut
kosmo integrations:microsoft-teams microsoft_teams_get_team '{"team_id":"example_team_id"}' --json

microsoft-teams.microsoft_teams_list_channels

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

Read read
Parameters
team_id
Generic call
kosmo integrations:call microsoft-teams.microsoft_teams_list_channels '{"team_id":"example_team_id"}' --json
Shortcut
kosmo integrations:microsoft-teams microsoft_teams_list_channels '{"team_id":"example_team_id"}' --json

microsoft-teams.microsoft_teams_get_channel

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

Read read
Parameters
team_id, channel_id
Generic call
kosmo integrations:call microsoft-teams.microsoft_teams_get_channel '{"team_id":"example_team_id","channel_id":"example_channel_id"}' --json
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

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

Read read
Parameters
team_id, channel_id, limit
Generic call
kosmo integrations:call microsoft-teams.microsoft_teams_list_messages '{"team_id":"example_team_id","channel_id":"example_channel_id","limit":1}' --json
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

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

Write write
Parameters
team_id, channel_id, content, content_type
Generic 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
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

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

Read read
Parameters
limit
Generic call
kosmo integrations:call microsoft-teams.microsoft_teams_list_chats '{"limit":1}' --json
Shortcut
kosmo integrations:microsoft-teams microsoft_teams_list_chats '{"limit":1}' --json

microsoft-teams.microsoft_teams_get_current_user

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

Read read
Parameters
none
Generic call
kosmo integrations:call microsoft-teams.microsoft_teams_get_current_user '{}' --json
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 0 parameters
Schema command
kosmo integrations:schema microsoft-teams.microsoft_teams_list_teams --json
ParameterTypeRequiredDescription
No parameters.
microsoft-teams.microsoft_teams_get_team 1 parameters
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 1 parameters
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 2 parameters
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 3 parameters
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 4 parameters
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 1 parameters
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 0 parameters
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.