KosmoKrator

communication

Discord CLI for AI Agents

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

7 functions 6 read 1 write Bearer token auth

Discord CLI Setup

Discord can be configured headlessly with `kosmokrator integrations:configure discord`.

# 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 discord --set access_token="$DISCORD_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor discord --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 DISCORD_ACCESS_TOKEN Secret secret yes Access Token
base_url DISCORD_BASE_URL URL url no API Base URL

Call Discord Headlessly

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

kosmo integrations:call discord.discord_list_channels '{
  "guild_id": "example_guild_id"
}' --json

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

kosmo integrations:discord discord_list_channels '{
  "guild_id": "example_guild_id"
}' --json

Agent Discovery Commands

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

kosmo integrations:docs discord --json
kosmo integrations:docs discord.discord_list_channels --json
kosmo integrations:schema discord.discord_list_channels --json
kosmo integrations:search "Discord" --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 Discord.

discord.discord_list_channels

Read read

List all channels in a Discord guild. Returns channel IDs, names, types, and topics.

Parameters
guild_id

Generic CLI call

kosmo integrations:call discord.discord_list_channels '{"guild_id":"example_guild_id"}' --json

Provider shortcut

kosmo integrations:discord discord_list_channels '{"guild_id":"example_guild_id"}' --json

discord.discord_get_channel

Read read

Get information about a Discord channel by its ID. Returns the channel's ID, name, type, topic, and other properties.

Parameters
channel_id

Generic CLI call

kosmo integrations:call discord.discord_get_channel '{"channel_id":"example_channel_id"}' --json

Provider shortcut

kosmo integrations:discord discord_get_channel '{"channel_id":"example_channel_id"}' --json

discord.discord_send_message

Write write

Send a message to a Discord channel. Supports text content and rich embeds. Returns the sent message ID and channel ID.

Parameters
channel_id, content, embeds, tts

Generic CLI call

kosmo integrations:call discord.discord_send_message '{"channel_id":"example_channel_id","content":"example_content","embeds":"example_embeds","tts":true}' --json

Provider shortcut

kosmo integrations:discord discord_send_message '{"channel_id":"example_channel_id","content":"example_content","embeds":"example_embeds","tts":true}' --json

discord.discord_list_messages

Read read

Get messages from a Discord channel. Supports pagination with before/after and limit. Returns message IDs, content, author info, and timestamps.

Parameters
channel_id, limit, before, after

Generic CLI call

kosmo integrations:call discord.discord_list_messages '{"channel_id":"example_channel_id","limit":1,"before":"example_before","after":"example_after"}' --json

Provider shortcut

kosmo integrations:discord discord_list_messages '{"channel_id":"example_channel_id","limit":1,"before":"example_before","after":"example_after"}' --json

discord.discord_list_guilds

Read read

List guilds the current Discord user is a member of. Returns guild IDs, names, icons, and owner status. Use limit, before, and after for pagination.

Parameters
limit, before, after

Generic CLI call

kosmo integrations:call discord.discord_list_guilds '{"limit":1,"before":"example_before","after":"example_after"}' --json

Provider shortcut

kosmo integrations:discord discord_list_guilds '{"limit":1,"before":"example_before","after":"example_after"}' --json

discord.discord_get_guild

Read read

Get information about a Discord guild by its ID. Returns the guild's ID, name, icon, description, member count, and other properties.

Parameters
guild_id

Generic CLI call

kosmo integrations:call discord.discord_get_guild '{"guild_id":"example_guild_id"}' --json

Provider shortcut

kosmo integrations:discord discord_get_guild '{"guild_id":"example_guild_id"}' --json

discord.discord_get_current_user

Read read

Retrieve the currently authenticated Discord user. Returns the user's ID, username, discriminator, and avatar. Useful for identifying which account or token is in use.

Parameters
none

Generic CLI call

kosmo integrations:call discord.discord_get_current_user '{}' --json

Provider shortcut

kosmo integrations:discord discord_get_current_user '{}' --json

Function Schemas

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

discord.discord_list_channels

List all channels in a Discord guild. Returns channel IDs, names, types, and topics.

Operation
Read read
Schema command
kosmo integrations:schema discord.discord_list_channels --json
ParameterTypeRequiredDescription
guild_id string yes The ID of the guild to list channels for.

discord.discord_get_channel

Get information about a Discord channel by its ID. Returns the channel's ID, name, type, topic, and other properties.

Operation
Read read
Schema command
kosmo integrations:schema discord.discord_get_channel --json
ParameterTypeRequiredDescription
channel_id string yes The ID of the channel to retrieve.

discord.discord_send_message

Send a message to a Discord channel. Supports text content and rich embeds. Returns the sent message ID and channel ID.

Operation
Write write
Schema command
kosmo integrations:schema discord.discord_send_message --json
ParameterTypeRequiredDescription
channel_id string yes The ID of the channel to send the message to.
content string no The text content of the message.
embeds string no JSON array of embed objects for rich formatting.
tts boolean no If true, the message will be read aloud via text-to-speech.

discord.discord_list_messages

Get messages from a Discord channel. Supports pagination with before/after and limit. Returns message IDs, content, author info, and timestamps.

Operation
Read read
Schema command
kosmo integrations:schema discord.discord_list_messages --json
ParameterTypeRequiredDescription
channel_id string yes The ID of the channel to get messages from.
limit integer no Number of messages to retrieve (1–100, default 50).
before string no Message ID to get messages before (for pagination).
after string no Message ID to get messages after (for pagination).

discord.discord_list_guilds

List guilds the current Discord user is a member of. Returns guild IDs, names, icons, and owner status. Use limit, before, and after for pagination.

Operation
Read read
Schema command
kosmo integrations:schema discord.discord_list_guilds --json
ParameterTypeRequiredDescription
limit integer no Number of guilds to retrieve (1–200, default 200).
before string no Guild ID to get guilds before (for pagination).
after string no Guild ID to get guilds after (for pagination).

discord.discord_get_guild

Get information about a Discord guild by its ID. Returns the guild's ID, name, icon, description, member count, and other properties.

Operation
Read read
Schema command
kosmo integrations:schema discord.discord_get_guild --json
ParameterTypeRequiredDescription
guild_id string yes The ID of the guild to retrieve.

discord.discord_get_current_user

Retrieve the currently authenticated Discord user. Returns the user's ID, username, discriminator, and avatar. Useful for identifying which account or token is in use.

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