The following agent will use Slack to send a message to a channel, list all channels, and get the message history of a specific channel.
cookbook/tools/slack_tools.py
import osfrom agno.agent import Agentfrom agno.tools.slack import SlackToolsslack_tools = SlackTools()agent = Agent(tools=[slack_tools], show_tool_calls=True)# Example 1: Send a message to a Slack channelagent.print_response("Send a message 'Hello from Agno!' to the channel #general", markdown=True)# Example 2: List all channels in the Slack workspaceagent.print_response("List all channels in our Slack workspace", markdown=True)# Example 3: Get the message history of a specific channel by channel IDagent.print_response("Get the last 10 messages from the channel 1231241", markdown=True)