> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cotool.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Slack Integration

> Connect Cotool to Slack for team communication and agent triggers

The Slack integration enables your AI agents to communicate with your team directly in Slack. Agents can respond to messages, reply in threads, send rich formatted messages, and be triggered by @mentions in channels.

## Features

<CardGroup cols={2}>
  <Card title="Direct Messages" icon="message">
    Chat with Cotool directly via DM. The bot creates a personal chat for each conversation.
  </Card>

  <Card title="Channel Triggers" icon="at">
    @mention the bot in channels to trigger agents with specific capabilities.
  </Card>

  <Card title="Thread Conversations" icon="comments">
    Agents automatically reply in threads to keep channels organized.
  </Card>

  <Card title="Rich Messages" icon="palette">
    Send formatted messages with buttons, charts, and file attachments.
  </Card>
</CardGroup>

## Setup

<Steps>
  <Step title="Navigate to Integrations">
    Go to **Settings > Integrations** in Cotool and find the Slack integration.
  </Step>

  <Step title="Install the Slack App">
    Click **Connect** to begin the OAuth flow. You'll be redirected to Slack to authorize the Cotool app.
  </Step>

  <Step title="Grant Permissions">
    Review and approve the requested permissions. The app needs access to:

    * Read messages in channels where it's mentioned
    * Read and respond to direct messages
    * Post messages and reactions
    * Upload files
  </Step>

  <Step title="Select Workspace">
    Choose which Slack workspace to connect. You can connect multiple workspaces if needed.
  </Step>
</Steps>

## How It Works

### Direct Messages

You can start a conversation with Cotool by sending a direct message to the bot:

1. Find **Cotool** in your Slack workspace's Apps section
2. Send a message describing what you need help with
3. The bot reacts with 👀 to acknowledge receipt
4. A personal chat is created in Cotool and the agent processes your request
5. The agent replies directly in the Slack thread with its findings

<Note>
  DM conversations create personal chats in Cotool. You can continue the conversation by replying in the same thread, and the agent will have full context of previous messages.
</Note>

### Channel @Mentions (Agent Triggers)

For channel interactions, you need to set up a **Slack trigger** on an agent:

<Steps>
  <Step title="Create or Edit an Agent">
    Navigate to the agent you want to trigger from Slack.
  </Step>

  <Step title="Add a Slack Trigger">
    In the agent's **Triggers** tab, click **Add Trigger** and select **Slack**.
  </Step>

  <Step title="Configure Access (Optional)">
    Optionally restrict which users, user groups, or channels can trigger the agent.
  </Step>

  <Step title="@Mention in Slack">
    In any channel where the bot is present, @mention the bot with your request:

    ```
    @Cotool investigate the alert for IP 192.168.1.100
    ```
  </Step>
</Steps>

When you @mention the bot:

1. The bot reacts with 👀 to acknowledge it received your message
2. The configured agent processes your request
3. The agent replies in a thread under your message with its findings

<Warning>
  Unlike DMs, channel @mentions require a configured agent trigger. If no trigger is configured, the bot will let you know how to set one up.
</Warning>

### Thread Replies

All agent responses are sent as thread replies to keep channels organized. If you reply to an existing thread where Cotool has responded, the agent will:

1. Re-enter the existing conversation with full context
2. Process your follow-up message
3. Reply in the same thread

This enables natural back-and-forth conversations without cluttering the main channel.

## Available Tools

When an agent has the Slack integration enabled, it can use these tools:

| Tool                        | Description                                         |
| --------------------------- | --------------------------------------------------- |
| `slack_sendMessage`         | Send a message to a channel or user                 |
| `slack_replyToThread`       | Reply to a specific thread                          |
| `slack_listChannels`        | List channels in the workspace                      |
| `slack_searchMessages`      | Search for messages across channels                 |
| `slack_getChannelHistory`   | Get recent messages from a channel                  |
| `slack_getUserInfo`         | Get information about a Slack user                  |
| `slack_listUsers`           | List users in the workspace                         |
| `slack_uploadFile`          | Upload a file to a channel                          |
| `slack_waitForUserResponse` | Send a message with buttons and wait for user input |

## Example Use Cases

<AccordionGroup>
  <Accordion title="Security Alert Notifications">
    Create an agent that monitors your SIEM and sends formatted alerts to a `#security-alerts` channel with relevant context and recommended actions.
  </Accordion>

  <Accordion title="On-Call Assistant">
    Set up a trigger so on-call engineers can @mention the bot to quickly investigate incidents, gather context from multiple tools, and summarize findings.
  </Accordion>

  <Accordion title="Access Request Handling">
    Build an agent that processes access requests posted in a channel, checks user permissions, and either approves or escalates based on policy.
  </Accordion>

  <Accordion title="Daily Standup Summaries">
    Schedule an agent to post daily summaries of open tickets, pending alerts, or team metrics to keep everyone informed.
  </Accordion>
</AccordionGroup>

## Best Practices

<Tip>
  **Use descriptive agent names** - When multiple agents have Slack triggers, clear names help users know which agent to @mention.
</Tip>

<Tip>
  **Restrict channel access** - Use trigger configuration to limit which channels can trigger sensitive agents, preventing accidental exposure in public channels.
</Tip>

<Tip>
  **Leverage thread context** - Agents automatically read the full thread history, so users can have multi-turn conversations without repeating context.
</Tip>
