Communication
Post messages to Slack via an incoming webhook.
slack_webhookPosts a message into a Slack channel. The fastest way for an agent to tell your team something important — an alert, a completed deployment, or a summary of what it just did.
Posts the supplied message text (Slack-flavored markdown accepted) to a Slack Incoming Webhook URL. Optional 'channel' and 'username' overrides let you redirect without changing the webhook. Validates that the URL starts with https://hooks.slack.com/ and caps message length at 40,000 characters.
When a user asks:
Post today's deployment summary to the #ops channel.
the agent calls the tool:
slack_webhook(text="Deploy complete: v2.3.1 live in prod")and gets back: confirmation that Slack accepted the message.
Set these before calling the tool. Values marked required must be present or the tool call will fail.
slack.webhook.url required Incoming webhook URL. Can also be passed per-call as 'webhook_url'. Must start with https://hooks.slack.com/.
Wire this tool into a SwarmAI crew. Use the YAML DSL for declarative workflows, or the Java builder API when you want full programmatic control.
YAML DSL
# team-alert.yaml
name: team-alert-crew
process: SEQUENTIAL
agents:
- id: notifier
role: Team Notifier
goal: Broadcast updates to team Slack channels
tools:
- slack_webhook
tasks:
- id: team-alert-task
agent: notifier
description: Post today's deployment summary to the #ops channel.Java
import ai.intelliswarm.swarmai.agent.Agent;
import ai.intelliswarm.swarmai.task.Task;
import ai.intelliswarm.swarmai.swarm.Swarm;
import ai.intelliswarm.swarmai.swarm.SwarmOutput;
import ai.intelliswarm.swarmai.process.ProcessType;
import ai.intelliswarm.swarmai.tool.common.SlackWebhookTool;
import org.springframework.ai.chat.client.ChatClient;
import org.springframework.beans.factory.annotation.Autowired;
@Autowired ChatClient chatClient;
@Autowired SlackWebhookTool slackWebhookTool;
Agent notifier = Agent.builder()
.role("Team Notifier")
.goal("Broadcast updates to team Slack channels")
.chatClient(chatClient)
.tool(slackWebhookTool)
.build();
Task notifierTask = Task.builder()
.description("Post today's deployment summary to the #ops channel.")
.agent(notifier)
.build();
SwarmOutput result = Swarm.builder()
.agent(notifier)
.task(notifierTask)
.process(ProcessType.SEQUENTIAL)
.build()
.kickoff();Real scenarios where agents put this tool to work.
Implementation lives at swarmai-tools/src/main/java/ai/intelliswarm/swarmai/tool/common/SlackWebhookTool.java in the swarm-ai repository.