The Discord tool empowers your AI agent to interact directly with your Discord server. It can send messages, read channel history, and retrieve information about channels and members, turning your Discord server into an interactive workspace for your agent.

Key Use Cases:

  • Automated Notifications: Post updates from other tools (e.g., a new Jira ticket or a successful Stripe payment) directly into a specific channel.
  • Information Retrieval: Ask the agent to "find the last 5 messages from the #announcements channel" to get a quick summary.
  • User & Channel Lookups: Get details about a specific user or channel ID to use in other workflow steps.
  • Interactive Commands: Build simple slash commands or keyword-triggered bots that use Toolstream agents to perform complex tasks in the background.

discord_tool.send_channel_message

Sends a message to a specific channel.

Parameters

NameTypeDescription
channel_id string The ID of the channel to send the message to.
content string The text content of the message.
curl -X POST https://toolstream.dev/v1/tools/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "connection_name": "YOUR_CONNECTION_NAME",
  "tool_call": {
    "name": "discord_tool.send_channel_message",
    "arguments": {
      "channel_id": {
        "type": "string",
        "description": "The ID of the channel to send the message to."
      },
      "content": {
        "type": "string",
        "description": "The text content of the message."
      }
    }
  }
}'
import requests
import json

API_KEY = "YOUR_API_KEY"
TOOLSTREAM_URL = "https://toolstream.dev/v1/tools/execute"

payload = {
  "connection_name": "YOUR_CONNECTION_NAME",
  "tool_call": {
    "name": "discord_tool.send_channel_message",
    "arguments": {
      "channel_id": {
        "type": "string",
        "description": "The ID of the channel to send the message to."
      },
      "content": {
        "type": "string",
        "description": "The text content of the message."
      }
    }
  }
}

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

response = requests.post(TOOLSTREAM_URL, headers=headers, data=json.dumps(payload))

if response.status_code == 200:
    result = response.json()
    print(json.dumps(result, indent=2))
else:
    print(f"Error: {response.status_code}")
    print(response.text)

discord_tool.get_channel_messages

Retrieves a list of recent messages from a specific channel.

Parameters

NameTypeDescription
channel_id string The ID of the channel to get messages from.
limit integer Max number of messages to return (1-100). Default: 50.
curl -X POST https://toolstream.dev/v1/tools/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "connection_name": "YOUR_CONNECTION_NAME",
  "tool_call": {
    "name": "discord_tool.get_channel_messages",
    "arguments": {
      "channel_id": {
        "type": "string",
        "description": "The ID of the channel to get messages from."
      },
      "limit": {
        "type": "integer",
        "description": "Max number of messages to return (1-100). Default: 50."
      }
    }
  }
}'
import requests
import json

API_KEY = "YOUR_API_KEY"
TOOLSTREAM_URL = "https://toolstream.dev/v1/tools/execute"

payload = {
  "connection_name": "YOUR_CONNECTION_NAME",
  "tool_call": {
    "name": "discord_tool.get_channel_messages",
    "arguments": {
      "channel_id": {
        "type": "string",
        "description": "The ID of the channel to get messages from."
      },
      "limit": {
        "type": "integer",
        "description": "Max number of messages to return (1-100). Default: 50."
      }
    }
  }
}

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

response = requests.post(TOOLSTREAM_URL, headers=headers, data=json.dumps(payload))

if response.status_code == 200:
    result = response.json()
    print(json.dumps(result, indent=2))
else:
    print(f"Error: {response.status_code}")
    print(response.text)

discord_tool.get_channel

Retrieves the details of a specific channel by its ID.

Parameters

NameTypeDescription
channel_id string The ID of the channel to retrieve.
curl -X POST https://toolstream.dev/v1/tools/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "connection_name": "YOUR_CONNECTION_NAME",
  "tool_call": {
    "name": "discord_tool.get_channel",
    "arguments": {
      "channel_id": {
        "type": "string",
        "description": "The ID of the channel to retrieve."
      }
    }
  }
}'
import requests
import json

API_KEY = "YOUR_API_KEY"
TOOLSTREAM_URL = "https://toolstream.dev/v1/tools/execute"

payload = {
  "connection_name": "YOUR_CONNECTION_NAME",
  "tool_call": {
    "name": "discord_tool.get_channel",
    "arguments": {
      "channel_id": {
        "type": "string",
        "description": "The ID of the channel to retrieve."
      }
    }
  }
}

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

response = requests.post(TOOLSTREAM_URL, headers=headers, data=json.dumps(payload))

if response.status_code == 200:
    result = response.json()
    print(json.dumps(result, indent=2))
else:
    print(f"Error: {response.status_code}")
    print(response.text)

discord_tool.list_guild_channels

Retrieves a list of all channels in a specific server (guild).

Parameters

NameTypeDescription
guild_id string The ID of the server to get channels from. If omitted, uses the default Guild ID for the connection.
curl -X POST https://toolstream.dev/v1/tools/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "connection_name": "YOUR_CONNECTION_NAME",
  "tool_call": {
    "name": "discord_tool.list_guild_channels",
    "arguments": {
      "guild_id": {
        "type": "string",
        "description": "The ID of the server to get channels from. If omitted, uses the default Guild ID for the connection."
      }
    }
  }
}'
import requests
import json

API_KEY = "YOUR_API_KEY"
TOOLSTREAM_URL = "https://toolstream.dev/v1/tools/execute"

payload = {
  "connection_name": "YOUR_CONNECTION_NAME",
  "tool_call": {
    "name": "discord_tool.list_guild_channels",
    "arguments": {
      "guild_id": {
        "type": "string",
        "description": "The ID of the server to get channels from. If omitted, uses the default Guild ID for the connection."
      }
    }
  }
}

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

response = requests.post(TOOLSTREAM_URL, headers=headers, data=json.dumps(payload))

if response.status_code == 200:
    result = response.json()
    print(json.dumps(result, indent=2))
else:
    print(f"Error: {response.status_code}")
    print(response.text)

discord_tool.get_current_user

Retrieves the user object for the currently authenticated bot.

This tool takes no parameters.

curl -X POST https://toolstream.dev/v1/tools/execute \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "connection_name": "YOUR_CONNECTION_NAME",
  "tool_call": {
    "name": "discord_tool.get_current_user",
    "arguments": {
    "arg": "value"
  }
  }
}'
import requests
import json

API_KEY = "YOUR_API_KEY"
TOOLSTREAM_URL = "https://toolstream.dev/v1/tools/execute"

payload = {
  "connection_name": "YOUR_CONNECTION_NAME",
  "tool_call": {
    "name": "discord_tool.get_current_user",
    "arguments": {
    "arg": "value"
  }
  }
}

headers = {
    "Authorization": f"Bearer {API_KEY}",
    "Content-Type": "application/json"
}

response = requests.post(TOOLSTREAM_URL, headers=headers, data=json.dumps(payload))

if response.status_code == 200:
    result = response.json()
    print(json.dumps(result, indent=2))
else:
    print(f"Error: {response.status_code}")
    print(response.text)