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 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.
| Key | Env var | Type | Required | Label |
|---|---|---|---|---|
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.
kosmo integrations:call microsoft-teams.microsoft_teams_list_teams '{}' --json 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.
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 - Parameters
- none
kosmo integrations:call microsoft-teams.microsoft_teams_list_teams '{}' --json 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 - Parameters
- team_id
kosmo integrations:call microsoft-teams.microsoft_teams_get_team '{"team_id":"example_team_id"}' --json 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 - Parameters
- team_id
kosmo integrations:call microsoft-teams.microsoft_teams_list_channels '{"team_id":"example_team_id"}' --json 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 - Parameters
- team_id, channel_id
kosmo integrations:call microsoft-teams.microsoft_teams_get_channel '{"team_id":"example_team_id","channel_id":"example_channel_id"}' --json 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 - Parameters
- team_id, channel_id, limit
kosmo integrations:call microsoft-teams.microsoft_teams_list_messages '{"team_id":"example_team_id","channel_id":"example_channel_id","limit":1}' --json 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 - Parameters
- team_id, channel_id, content, content_type
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 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 - Parameters
- limit
kosmo integrations:call microsoft-teams.microsoft_teams_list_chats '{"limit":1}' --json 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 - Parameters
- none
kosmo integrations:call microsoft-teams.microsoft_teams_get_current_user '{}' --json 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
kosmo integrations:schema microsoft-teams.microsoft_teams_list_teams --json | Parameter | Type | Required | Description |
|---|---|---|---|
| No parameters. | |||
microsoft-teams.microsoft_teams_get_team 1 parameters
kosmo integrations:schema microsoft-teams.microsoft_teams_get_team --json | Parameter | Type | Required | Description |
|---|---|---|---|
team_id | string | yes | The unique identifier of the team. |
microsoft-teams.microsoft_teams_list_channels 1 parameters
kosmo integrations:schema microsoft-teams.microsoft_teams_list_channels --json | Parameter | Type | Required | Description |
|---|---|---|---|
team_id | string | yes | The unique identifier of the team. |
microsoft-teams.microsoft_teams_get_channel 2 parameters
kosmo integrations:schema microsoft-teams.microsoft_teams_get_channel --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema microsoft-teams.microsoft_teams_list_messages --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema microsoft-teams.microsoft_teams_send_message --json | Parameter | Type | Required | Description |
|---|---|---|---|
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
kosmo integrations:schema microsoft-teams.microsoft_teams_list_chats --json | Parameter | Type | Required | Description |
|---|---|---|---|
limit | integer | no | Maximum number of chats to return (default: 50, max: 50). |
microsoft-teams.microsoft_teams_get_current_user 0 parameters
kosmo integrations:schema microsoft-teams.microsoft_teams_get_current_user --json | Parameter | Type | Required | Description |
|---|---|---|---|
| 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.