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

# Slack Tools

> Read Slack history and threads, send DMs, post to channels, edit or delete your own messages, add reactions, and look up users.

## **Overview**

### **Tool Name**

```json theme={null}
slack_tools
```

### **Purpose**

The **slack\_tools** suite connects Genesis workflows to your Slack workspace so you can notify teams, acknowledge messages with emoji reactions, share links to generated artifacts, and target messages to the right people or channels.

### **Key Features & Functions**

**1. Direct Messages**

Send private, targeted updates to specific users with rich context links.

**2. Channel Posts**

Broadcast milestone updates, alerts, and summaries to team channels. When asked to post in `#general`, use the special channel name `general-genesis-override`; it posts to `#general` itself, not a separate channel.

**3. Edit or Delete Messages**

Correct or remove messages the agent posted earlier.

**4. Emoji Reactions**

Leave one or more emoji acknowledgments on an existing Slack message without posting a full reply.

**5. User Lookup**

Resolve display names to Slack user IDs for accurate delivery.

**6. Read Channel History and Threads**

Catch up on channel messages and read the replies in a Slack thread. Messages that contain a Slack table include its rows and cells in the text the agent receives, preserving empty cells and row order.

**7. Share Links**

Include URLs to files, artifacts, dashboards, and docs produced by workflows.

> [!TIP]
>
> Prefer short, actionable messages with a clear link or next step. Add the most important info in the first sentence.

> [!TIP]
>
> In live Slack conversations, these tools are already available in the current thread. Provide only the documented business fields for the tool call. Genesis injects runtime context such as `bot_id`, `session_id`, `run_id`, and current-thread metadata automatically.

## **Quiet Channel Monitoring**

The separate **`slack_channel_monitors`** tool group lets an agent take
responsibility for a Slack channel without being tagged on every message. Its
`manage_slack_channel_monitors` function supports `LIST`, `GET`, `ADD`,
`UPDATE`, `REMOVE`, `ENABLE`, `DISABLE`, and `REORDER`. For when edits reach a
running Slack connection, see
[Slack settings](https://docs.genesiscomputing.com/docs/Setup/Advanced-Settings.md#slack-settings).
The agent must already be deployed to Slack and invited to the channel. See
[Slack setup](https://docs.genesiscomputing.com/docs/Workspaces/Slack/Activate-Genbots-On-Slack.md) for the
channel-monitor permissions.

| Parameter | Type | Default | Description |
| - | - | - | - |
| `action` | `string` | Required | `LIST`, `GET`, `ADD`, `UPDATE`, `REMOVE`, `ENABLE`, `DISABLE`, or `REORDER`. `LIST` can optionally be filtered by `agent_id`. |
| `agent_id` | `string` | Current agent | Agent responsible for the channel. Changing another agent's monitor requires an agents manager. |
| `channel` | `string` | Required for `ADD`; otherwise optional | Slack channel as `#name` or channel ID. For `GET`, `UPDATE`, `REMOVE`, `ENABLE`, and `DISABLE`, use it to identify a monitor only when the agent has one monitor on that channel; otherwise use `monitor_id`. |
| `monitor_id` | `string` | None | Monitor ID returned by `LIST`. Use it to select one monitor when an agent has several on the same channel. |
| `name` | `string` | None | Optional label for people to distinguish monitors, such as `Datadog alerts` (up to 80 characters). |
| `monitor_ids` | `string[]` | None | Required for `REORDER`: list each of the agent's monitor IDs exactly once, in the order to try them. The first matching monitor wins. |
| `trigger` | `string` | `tagged` | Starts work for a new top-level message: `tagged`, `every_message`, `pattern`, or `watch`. A tag still starts work for a pattern or watch monitor. A `watch` monitor also triages replies in threads the agent has not joined; replies that address the agent by name can qualify even without an @mention. |
| `patterns` | `string[]` | `[]` | For `pattern`, keywords matched as whole words, case-insensitively, or regular expressions written between `/` characters. Message text, blocks, and attachments are searched. |
| `exclude_patterns` | `string[]` | `[]` | Optional patterns using the same syntax; a match skips the message. |
| `watch_focus` | `string` | `null` | For `watch`, a short description of what the agent should join conversations to help with (up to 500 characters). |
| `working_reaction` | `boolean` | `true` | Whether the working (gear) reaction appears while work is running. Defaults to on for every trigger, including `watch`; for `watch`, it appears on the message the agent joins and on later replies in threads where it has spoken. |
| `work` | `string` | `thread` | `thread` works in and replies to the message's Slack thread, or `mission` starts a Mission. |
| `blueprint` | `string` | `null` | Blueprint to start when `work` is `mission`; required for that mode. Custom blueprints are supported. Genesis passes matching Slack context fields only when the blueprint declares them as inputs. |
| `allowed_posters` | `string[]` | `[]` | Slack user, bot, or app IDs allowed to start work. An empty list allows anyone in the channel; display names do not match. |
| `run_as` | `string` | `service` | Applies only when `allowed_posters` is non-empty: `service` runs work as the non-admin Slack monitor service user; `system` runs it as the system identity, with administrator rights. Use `system` only when the work needs them. With an empty `allowed_posters` list, work runs as the person who posted. |
| `ack_emoji` | `string` | `null` | Optional reaction added when the agent picks up a message, such as `eyes`. |

For example, ask the agent to monitor `#occ-alerts` for `SEV1` and `P1` messages:

```json theme={null}
{
  "action": "ADD",
  "channel": "#occ-alerts",
  "trigger": "pattern",
  "patterns": ["SEV1", "P1"],
  "work": "thread"
}
```

An agent can have multiple named monitors on the same channel. Use `LIST` to
get their IDs, then pass the chosen `monitor_id` to update or remove just that
monitor. Use `REORDER` with all monitor IDs to change precedence when more than
one monitor matches a message.

For `work="mission"`, Genesis starts the named blueprint with the Slack message,
poster, channel, timestamp, and permalink only when those names are declared in
the blueprint's required or optional inputs. When `slack_message` is not declared,
the full issue text is included in the Mission kickoff notes instead. A manifest
that cannot be read is retried; a non-retryable start refusal is reported in the
Slack thread and is not retried.

Use `watch` when the agent should consider every new top-level message and
eligible replies in threads it has not joined, but join only when it can help.
By default, Genesis asks the Fast model to triage untagged messages before
starting work; a tag always starts work without triage. Administrators can
configure the optional decision model for Slack watch triage in **AI Providers
→ Decisions**; when it settles a message, that decision avoids a Fast-model call
and does not spend the per-agent triage budget. In compare-only mode, the Fast
model still decides and Genesis records whether the decision model agreed. For
the setting, its default, and compare-only scheduling, see [Decision models](https://docs.genesiscomputing.com/docs/Setup/Setup-AI-Model.md#decision-models).
For replies, triage considers the thread
so far when Slack returns its history, and whether the message addresses the
agent by name. At most 10 replies per thread are triaged while the agent stays
out; replies over that cap are ignored. Set `watch_focus` to guide the decision.
If triage fails or reaches the per-agent budget, the agent stays out and the
monitor's health reports the skip. Replies from bots and apps are considered
only when `allowed_posters` allows them. Configure the shared top-level-message
and reply triage budget with
[`slack.watch_triage_max_per_minute`](https://docs.genesiscomputing.com/docs/Setup/Advanced-Settings#slack-settings).
Triage uses the agent's role, tool groups, and skills when available, along with
general Genesis agent capabilities, to decide whether it can answer an open
question to the channel. It stays out when a message is addressed to someone
else; set `watch_focus` to further narrow what the agent joins.
For example, to keep an agent focused on warehouse questions:

```json theme={null}
{
  "action": "ADD",
  "channel": "#data-help",
  "trigger": "watch",
  "watch_focus": "warehouse questions and data pipeline failures",
  "work": "thread"
}
```

Monitor work runs quietly in Genesis: its turn output is not posted to Slack.
The agent can choose what to share with `_slack_reply` or acknowledge the
original message with `_slack_react`. Replies are routed by who the work runs
as: the work owner's replies reach it as instructions; for service-identity
monitors, replies from allowed posters and integrations may also reach it as
context. A separate request from another participant runs as that sender, not
with the monitor work's access, and waits for the current turn to finish when
the thread is busy. Eligible replies can wake idle work. For the sample
Mission that investigates issues this way, see
[the Blueprint Library and Missions guide](https://docs.genesiscomputing.com/docs/Blueprint/Blueprint-Library-And-Missions.md).
For requests that will take a while, acknowledge the person's message with a
reaction such as `eyes` instead of posting that work is underway, then reply
when there is something useful to share. On a monitored thread reply, the
working reaction stays until the agent replies in the thread or explicitly
stands down; it expires after 10 minutes if neither happens. If the agent adds
its own reaction to that reply, it replaces the working reaction and stays.
When thanks, a quick acknowledgement, or agreement can be said with a reaction,
use `_slack_react` with an emoji instead of replying.

## **Input Parameters for Each Function**

### **`_send_slack_direct_message`**

**Parameters**

| **Name** | **Definition** | **Format** |
| - | - | :-: |
| **slack\_user\_id** | Recipient’s Slack user ID (for example `U0123ABCD` or `W0123ABCD`). | String |
| **message** | Message text. URLs will auto-link in Slack clients. | String |
| **files** | Optional files to attach: up to 10, each no larger than 100 MB. Name files as for `_slack_reply`, including the file tool's `download_link` (such as `[GIT_DOWNLOAD_LINK:repo:path:name]`) or `git_url`. If a file cannot be attached, nothing is sent and the result says why. | `string[]` (default `null`) |
| **include\_link** | When `true`, append a link to the active Mission, or to this Genesis conversation if there is no Mission. The default `false` adds no link. | `boolean` (default `false`) |

On success, the result includes `channel` and `message_ts`. Pass both to
`_slack_edit_message` or `_slack_delete_message` to target this post later.

### **`_send_slack_channel_message`**

**Parameters**

| **Name** | **Definition** | **Format** |
| - | - | :-: |
| **channel** | Channel name or ID (e.g., `#data-ops` or `C07FBCHFZ26`). `#general` is blocked by default; only when asked to post there, use `general-genesis-override`, which routes to `#general` itself. | String |
| **message** | Message text to post to the channel. | String |
| **files** | Optional files to attach: up to 10, each no larger than 100 MB. Name files as for `_slack_reply`, including the file tool's `download_link` (such as `[GIT_DOWNLOAD_LINK:repo:path:name]`) or `git_url`. If a file cannot be attached, nothing is sent and the result says why. | `string[]` (default `null`) |
| **include\_link** | When `true`, append a link to the active Mission, or to this Genesis conversation if there is no Mission. The default `false` adds no link. | `boolean` (default `false`) |
| **start\_thread** | Start a Slack thread on this post that the agent follows up in (see [Threads an agent starts](#threads-an-agent-starts)). The channel must be this conversation's own, or one the person who asked is a member of. | `boolean` (default `false`) |
| **topic** | With `start_thread`: a few words on what the thread is for. It titles the new Genesis conversation. | `string` (default `null`) |

On success, the result includes `channel` and `message_ts`. Pass both to
`_slack_edit_message` or `_slack_delete_message` to target this post later.
An `@Name` written as ordinary text does not notify anyone. When a posted message
contains an untagged name, the result includes `untagged` and `untagged_note`;
use a Slack mention such as `<@U0123ABC>` to notify a person.
A name written by itself inside double quotes, such as `"@Jane Smith"`, is treated as quoted
text and is not included in the `untagged` warning.

For example, post a report to the requested channel and include a link back to its Genesis Mission when available:

```json theme={null}
{
  "tool": "_send_slack_channel_message",
  "arguments": {
    "channel": "#data-ops",
    "message": "The report is ready.",
    "files": ["BOT_REPOS_PATH/reports/report.pdf"],
    "include_link": true
  }
}
```

### **`_lookup_slack_user_id`**

**Parameters**

| **Name** | **Definition** | **Format** |
| - | - | :-: |
| **user\_name** | Name or email address to resolve to a Slack user ID. An email lookup requires the Slack app's `users:read.email` scope. | String |
| **channel** | Optional ID of the Slack channel the agent is about to post in. On an Enterprise Grid organization install, this identifies the workspace to search when the conversation's own channel is not the destination. | String |

> [!NOTE]
>
> Name matching ignores case and accents (for example, `Jose` matches `José`); returned names retain Slack's spelling. A unique exact name or email returns `User_id:`. If a name is shared, only partly matches, or is close to a typo, the result returns `matches` without an ID; confirm the person before tagging. Use `_lookup_slack_user_id` and store the returned ID for future sends. On an Enterprise Grid install, pass `channel` when the destination is not this conversation's channel; an email lookup does not need a workspace. For plain-text `@Name` in posted messages, see the posting-tool note above.
>
> Workspace-wide lookup retries Slack rate limits and resumes a directory read that stopped partway on a later lookup; a partial result can include an `unread` reason.

### **`_add_slack_reaction`**

**Parameters**

| **Name** | **Type** | **Required** | **Default** | **Description** |
| - | - | :-: | - | - |
| **reaction\_name** | `string` | No | none | Emoji reaction name to add, with or without colons (for example `rocket` or `:rocket:`). Pass this for one reaction, or pass `reaction_names` for several. |
| **reaction\_names** | `string[]` | No | `null` | List of emoji reaction names to add in one tool call. When provided, `reaction_name` is ignored. |
| **channel** | `string` | No | current Slack conversation context when available | Optional Slack channel name or ID for the target message. |
| **message\_ts** | `string` | No | most recent inbound message in the current Slack thread when available | Optional Slack timestamp for the target message. |

> [!NOTE]
>
> The schema does not require either reaction field individually, but pass at least one. For multiple reactions, use `reaction_names`; when provided, Genesis ignores `reaction_name`.

### **`_slack_reply`**

Post a message in the current Slack thread, or as a new top-level message in the same channel. Use `files` to attach files by the path reported by a tool. A `GIT_DOWNLOAD_LINK` in the message is posted as a Genesis file link by default; set `attach_linked_files` to also attach its file. Linked files over 100 MB or beyond the 10-file limit remain links. Duplicate files are attached only once. When Slack accepts a combined upload, the text and files appear in one message. Replies with query-result tables, or replies Slack refuses as a combined upload, post the text first and upload the files separately afterward; thread replies keep the uploads in that thread.

Use replies for the answer, finding, or useful links. Avoid routine progress
messages; post an update while work is underway only when it will take a long
time and people need to know its status. Keep the final reply short by default,
matching the thread's style; attach longer material as a file or link.

Files discovered in message text (including `FILE_ID`, download, sandbox, or
local upload links) are attached only when they resolve inside the current
conversation's own `uploads` folder. Links to another conversation's uploads,
relative paths, traversal paths, and paths that resolve outside that folder are
not attached. Explicit `files` arguments and Git links continue to use their
own repository and access checks. A Git link is attached only when the person
the agent is acting for may view that repository and the file is repository
content; otherwise Slack keeps the Genesis file link in the message.

Files in the shared GenesisApps repository also follow the per-app read check;
see [GenesisApps access control](https://docs.genesiscomputing.com/docs/Genbot-Toolkit/GenesisApps-Tools#access-control).

| **Name** | **Type** | **Required** | **Default** | **Description** |
| - | - | :-: | - | - |
| `message` | `string` | Yes | — | Message text to post. |
| `include_link` | `boolean` | No | `false` | When `true`, add a link to the Mission in Genesis, or to the conversation when there is no Mission. The default adds no link. |
| `as_new_post` | `boolean` | No | `false` | Post as a new top-level message in the same Slack channel instead of replying in the thread. |
| `start_thread` | `boolean` | No | `false` | Post as a new top-level message and start a Slack thread on it that the agent follows up in (see [Threads an agent starts](#threads-an-agent-starts)). |
| `topic` | `string` | No | `null` | With `start_thread`: a few words on what the thread is for. |
| `started_thread` | `string` | No | `null` | The `started_thread` an earlier `start_thread` post from this conversation returned: post the reply in that Slack thread instead. Works from a Genesis chat conversation too. |
| `replace_previous` | `boolean` | No | `false` | Replace the agent's last message in the thread by deleting it and posting this one in its place, while it is still the newest and nobody has reacted to or replied after it. If someone has acted on it, nothing is posted and the result says what changed. A thread starter, card, or message with files is left in place and this reply is posted normally. |
| `files` | `string[]` or `string` | No | `null` | Up to 10 distinct files to attach, each no larger than 100 MB. Duplicates within this list are attached once; when `attach_linked_files=true`, a linked file already listed here is not attached twice. Pass a list, or one file name as a string; a string containing a JSON list of names is also read as that list. Use paths reported by tools: `BOT_SCRATCH_PATH/...`, `BOT_REPOS_PATH/...`, `BOT_GIT_PATH/...`, `sandbox:/mnt/data/...`, or a tool's `download_link` (such as `[GIT_DOWNLOAD_LINK:repo:path:name]`) or `git_url`. Python executor files must be in the default scratch folder for the current agent and thread. The `.genesis_runtime` folder is not attachable through `BOT_GIT_PATH`; use `BOT_SCRATCH_PATH` for your own scratch files. Files in another conversation's `uploads` folder attach only when the person the agent is acting for may access that conversation. For Python-created files, see [Genesis SDK artifact download links](https://docs.genesiscomputing.com/docs/Genbot-Toolkit/Code-Executor-Tools.md#genesis-sdk-in-local-execution). |
| `attach_linked_files` | `boolean` | No | `false` | Also attach files named by `GIT_DOWNLOAD_LINK` markup in `message`, subject to the same folder and access checks as `files`. A linked file over 100 MB or beyond the 10-file limit stays a link. Files already named by `files` are not attached twice. |

When `replace_previous=true`, the result reports whether the prior message was replaced. Without it, a successful reply may include `replace_previous_hint` when replacing the prior message would have been safe. Use `_slack_edit_message` to correct a typo in place; replacement is for a follow-up update that should notify the thread again.

For example, attach a chart saved by the Python tool:

```json theme={null}
{
  "tool": "_slack_reply",
  "arguments": {
    "message": "Here is the chart.",
    "files": ["BOT_SCRATCH_PATH/penguin/moon.png"]
  }
}
```

If a file cannot be found, read, or copied, nothing is posted and the reply identifies the problem. If Slack refuses an upload, the message is posted with a warning.

When a successful post attaches files from the current conversation's `BOT_SCRATCH_PATH`, Genesis also saves those files under that thread's `uploads` folder so they can be reused from conversations that may access the thread. The result reports the saved paths in `kept_files`; `kept_files_warnings` identifies files that could not be retained or are available on this server only. The same access and retention rules apply to `files` on `_send_slack_direct_message` and `_send_slack_channel_message`.

#### Threads an agent starts

With `start_thread`, a new top-level post becomes a conversation the agent keeps
working in. Genesis creates a Genesis thread for the post, linked to the conversation
it came from (same owner and visibility), and the result's `started_thread` names it.
Replies in the Slack thread reach the agent without an @-mention, also after a Genesis
restart. The first one arrives with a short briefing: the post, its topic and the
conversation it came from.

The person who asked in the posting turn owns the thread's direction, but can steer a
running turn only when that turn runs as them. If another participant's own turn is
running in the conversation, or the running identity is unknown, the requester's
acknowledgement may be passed as context; any other reply, including one with a
question, request, or file, waits for its own turn and runs as its sender. It is never
handled with the other participant's access. In that turn, the agent decides whether
the message is for it. Nobody can name a different requester through the tool. A turn
may start at most three threads. If Slack refuses
the post, no thread is started. If
Genesis's thread store fails partway through setting a thread up, the thread is removed
again; one that can be neither listed on its conversation nor removed is still returned
and usable, but does not count toward the limit.

In a thread the agent started, a turn woken by a reply or by the end of work started
there (a Prover run, a background job) posts its final answer in the thread, as a
tagged turn does: not when its last `_slack_reply` already gave it, and not when it
answers `!NO_RESPONSE_REQUIRED`. Result cards from such a turn are posted there too.

Markdown strikethrough (`~~text~~`) is converted to Slack's `~text~` format.
An approximate tilde before a number or price, such as `~123` or `~$100`, is
preserved without triggering Slack strikethrough; code and Slack-formatted links
are unchanged.

Slack posts, including final answers posted for the agent, should read like chat
messages rather than reports: lead with the answer, keep the message to the few
sentences the request calls for, and use headings or lists only when they help.
For substantial detail, attach a file or link and briefly say what it contains.

### **`_slack_edit_message` and `_slack_delete_message`**

Use these tools to correct or remove a message the agent posted. They are
available in live Slack conversations. Only the agent's own Slack messages can
be changed; messages from people or other apps are refused. Editing an
interactive card with buttons or inputs is not supported.

When `message_ts` is omitted, the tool targets the agent's latest non-card
message in the current Slack thread. To target a particular post, pass the
`message_ts` and `channel` returned by `_slack_reply`,
`_send_slack_channel_message`, or `_send_slack_direct_message`. A post outside
the current Slack conversation's thread requires both values.

| **Tool** | **Name** | **Type** | **Required** | **Default** | **Description** |
| - | - | - | :-: | - | - |
| `_slack_edit_message` | `text` | `string` | Yes | — | The whole replacement message, in Markdown, as for `_slack_reply`. |
| `_slack_edit_message` | `message_ts` | `string` | No | Latest eligible message in the current Slack thread | Slack timestamp returned by a posting tool. |
| `_slack_edit_message` | `channel` | `string` | No | Current Slack thread's channel when available | Slack channel ID or `#name`; pass with `message_ts` to target a post outside the current thread. |
| `_slack_delete_message` | `message_ts` | `string` | No | Latest eligible message in the current Slack thread | Slack timestamp returned by a posting tool. |
| `_slack_delete_message` | `channel` | `string` | No | Current Slack thread's channel when available | Slack channel ID or `#name`; pass with `message_ts` to target a post outside the current thread. |

Successful edits include `previous_text` and the replacement `text`; successful
deletes include `deleted_text`. Both results include the resolved `channel` and
`message_ts`.

For example, correct a post using the identifiers returned by the posting tool:

```json theme={null}
{
  "tool": "_slack_edit_message",
  "arguments": {
    "channel": "C07FBCHFZ26",
    "message_ts": "1712345678.000100",
    "text": "The corrected total is **$125**."
  }
}
```

**Example**

Use the current Slack thread context and react to the most recent inbound message:

```json theme={null}
{
  "tool": "_add_slack_reaction",
  "arguments": {
    "reaction_name": "eyes"
  }
}
```

### **`_slack_read_channel` and `_slack_read_thread`**

Use these tools when you need earlier Slack messages or thread replies. They return
messages oldest first with the author's name, Slack timestamp (`ts`), Markdown text,
attached file names, and (when present) a `reactions` list with each emoji name, its
total count, and up to 10 reactor names (`you` identifies the agent); at most 12
reaction types are listed per message. When a file from a message is already saved in that thread's
`uploads` folder, its entry also includes `saved_files` with the Slack name and
`uploads_path`, a path the file and image tools can read. Long message text is truncated at 3,000 characters and marked
`truncated`; read one thread message with a 60,000-character limit using
`_slack_read_thread` with its `message_ts` and `full_message=true`. For channel and thread access rules, see
[Reading earlier Slack messages](https://docs.genesiscomputing.com/docs/Workspaces/Slack/Activate-Genbots-On-Slack.md#reading-earlier-slack-messages).

| **Tool** | **Parameter** | **Type** | **Default** | **Description** |
| - | - | - | - | - |
| `_slack_read_channel` | `channel` | `string` | Conversation's Slack channel | Channel as `#name` or ID. |
| `_slack_read_channel` | `limit` | `integer` | `30` | Number of recent top-level messages; maximum `100`. |
| `_slack_read_channel` | `before_ts` | `string` | None | Return messages before this Slack timestamp. Use `next_before_ts` from a result to page back. |
| `_slack_read_channel` | `after_ts` | `string` | None | Return messages after this Slack timestamp to catch up from a known message. |
| `_slack_read_thread` | `message_ts` | `string` | Conversation's Slack thread | Timestamp of the thread's first message or any reply. Omit to read the current conversation's thread. |
| `_slack_read_thread` | `channel` | `string` | Conversation's Slack channel | Channel as `#name` or ID when reading a thread outside the current channel. |
| `_slack_read_thread` | `limit` | `integer` | `50` | Number of thread messages; maximum `200`. |
| `_slack_read_thread` | `after_ts` | `string` | None | Return replies after this Slack timestamp. |
| `_slack_read_thread` | `cursor` | `string` | None | Continue pagination with `next_cursor` from a previous result. |
| `_slack_read_thread` | `full_message` | `boolean` | `false` | Read only the message named by `message_ts`, with a 60,000-character limit instead of the usual 3,000-character cut. Requires `message_ts`; Slack may require up to two thread-replies calls to locate it. |

Both tools return `has_more` when additional messages are available. A channel-history
result provides `next_before_ts` for older messages; a thread result provides
`next_cursor` for the next page. For example, read the latest channel messages and then
open a thread using a message timestamp from the result:

```json theme={null}
{
  "tool": "_slack_read_channel",
  "arguments": {
    "channel": "#ops",
    "limit": 20
  }
}
```

```json theme={null}
{
  "tool": "_slack_read_thread",
  "arguments": {
    "message_ts": "1712345678.000100",
    "channel": "#ops"
  }
}
```

### **`_slack_read_canvas` and `_slack_edit_canvas`**

Use these tools for a channel's canvas: the canvas tab where a team keeps an agenda, meeting
notes or a runbook. When a channel shows only a Slackbot line such as "made updates to a
canvas tab", the agent reads the canvas itself instead of guessing what changed.

`_slack_read_canvas` returns the canvas as Markdown (headings, lists, checklists, tables and
links), with its `title`, `canvas_id`, who created and last edited it, and `other_canvases`
listing the channel's further canvas tabs. Without arguments it reads the canvas of the
conversation's own channel. People write canvases, so the content comes between two fence lines
carrying a value minted for that read, with a notice that it is data, not instructions to the
agent. Content over 60,000 characters is cut and marked `truncated`.

When a canvas reads incorrectly, an agent administrator can set `include_raw_export=true` to
save a sanitized export of Slack's HTML and non-secret file fields as JSON in the conversation's
`uploads` folder. The result's `raw_export.uploads_relative_path` gives the path; read it with
`file(action="read", repo_id="uploads", file_path=<uploads_relative_path>)`. Slack credentials,
private-file URLs and Slack URL query strings are redacted. The HTML is not returned inline
because it is untrusted canvas content. Exports are limited to 512 KB of HTML and report the
full byte count, whether the HTML was truncated, and how many redactions were made. A caller who
cannot administer the agent receives the normal canvas read and `raw_export_refused`; if there
is no conversation or the file cannot be saved, `raw_export` reports metadata and sizes without
the HTML.

`_slack_edit_canvas` adds Markdown at the end of the canvas (`mode` `append`), after one section
(`append` with `section`), or in place of one section (`mode` `replace_section`). A section is
named by text it holds, such as its heading, and must match exactly one of the canvas's
sections, or nothing is changed. A Slack section is one block: a heading, a paragraph or a list
item. Replacing a heading's section replaces only the heading line, not the items under it.
When Slack finds the text only as a whole list rather than as one item of it, nothing is
changed: Slack would put an addition after the list's last item, and a replacement would
replace every item. The agent then adds after a heading or a paragraph, or at the end. The
Markdown is sent as written, so a plain bullet stays a bullet and plain text a paragraph.

Both tools follow the [channel access rules of the read tools](https://docs.genesiscomputing.com/docs/Workspaces/Slack/Activate-Genbots-On-Slack.md#reading-earlier-slack-messages):
the conversation's own channel, or a channel the person who asked is a member of. A canvas named
by ID or link is opened only when it is shared in such a channel. On a turn woken by mail,
`_slack_edit_canvas` works only on the canvas of the conversation's own channel, as
`_slack_edit_message` works only there. A thread in plan mode does not run it.

Reading a canvas never needs an approval. The agent changes a canvas with its own Slack app, and
Slack does not tell an app who may edit a canvas. So a canvas edit needs a person who asked in
that turn (a channel monitor's work or another bot's message changes nothing), and:

* **An addition** (`append`) is made at once for the person who asked, in the conversation's own
  channel or a channel they are a member of.
  When `section` points to a list item, write `markdown` as unindented items of that list's kind:
  `- text` for bullets, `- [ ] text` for checklists, or numbered items such as `4. text` after
  item 3. Numbered additions continue from the selected item; a different list form is refused.
  If Slack puts the addition outside the list, Genesis removes it when it can do so safely;
  otherwise it reports that the addition may remain outside the list. Read the canvas before
  retrying.
* **A replacement** (`replace_section`) works only on a section the agent wrote in the same
  conversation for the same person. A section anyone else wrote, or one the agent wrote for
  someone else, is never replaced; the agent says so and suggests
  that someone who can edit the canvas change it in Slack, or that it add to the canvas instead.
  When the request is the person's own message in that turn, the replacement is made at once.
  Otherwise (a turn woken by mail, whose words were relayed) it goes on an
  [Action Review](https://docs.genesiscomputing.com/docs/User-Guide/Chat-And-Threads.md#action-review) card showing the exact text and the
  canvas, and is made when a person who may approve agent actions approves it. One approval covers
  further changes to that canvas for the rest of that conversation, not in another conversation or
  on another canvas. This hold (`default-slack-canvas-change-review-v2`) applies on every install;
  a tenant policy can change it. If the canvas, or the section the text finds, changes while the
  request waits, the approved edit is refused rather than redirected. If Slack does not answer
  after an edit is sent, the result is uncertain because the change may have landed; check the
  canvas before retrying.

Slack exposes no per-person canvas edit right, so a member of the channel who may only view its
canvas can still have the agent add to it, or replace lines the agent wrote for them. Slack shows
the agent as the editor of those changes.

| **Tool** | **Parameter** | **Type** | **Default** | **Description** |
| - | - | - | - | - |
| `_slack_read_canvas` | `channel` | `string` | Conversation's Slack channel | Channel as `#name` or ID whose canvas to read. |
| `_slack_read_canvas` | `canvas` | `string` | The channel's canvas | A canvas ID (`F…`) or Slack canvas link, to read that canvas instead. |
| `_slack_read_canvas` | `include_raw_export` | `boolean` | `false` | For an agent administrator diagnosing a canvas read, save sanitized HTML and file fields as a JSON file in this conversation's `uploads` folder; see `raw_export` above. Others get the normal read and `raw_export_refused`. |
| `_slack_edit_canvas` | `markdown` | `string` | Required | The Markdown to add, or the new content of the one block being replaced. |
| `_slack_edit_canvas` | `mode` | `string` | `append` | `append` or `replace_section`. |
| `_slack_edit_canvas` | `section` | `string` | None | Text from the section to replace, or to add after. Required for `replace_section`. |
| `_slack_edit_canvas` | `channel` | `string` | Conversation's Slack channel | Channel as `#name` or ID whose canvas to change. |
| `_slack_edit_canvas` | `canvas` | `string` | The channel's canvas | A canvas ID or link, instead of the channel's canvas. |

Reading a canvas needs only `files:read` (to download it), so a read succeeds on an app without
the canvas scopes. Changing one needs both `canvases:read` (to find a section) and
`canvases:write`. The agent asks Slack for the app's granted scopes until both canvas scopes are seen, so a reinstall takes effect at the next canvas call: a read says in
`scope_notice` which canvas scopes are missing and that edits will fail, and an edit is refused
before any canvas call, naming both scopes. A Slack workspace admin adds `canvases:read` and
`canvases:write` to the app (OAuth & Permissions, Bot Token Scopes) and reinstalls it.

```json theme={null}
{
  "tool": "_slack_edit_canvas",
  "arguments": {
    "mode": "append",
    "section": "Agenda",
    "markdown": "- Review Databricks DBU spend"
  }
}
```

## **Use Cases**

1. **Milestone Notifications**
   Announce mission or task completion with links to assets or dashboards.
2. **Analysis Hand-offs**
   DM stakeholders a summary plus links to reports, notebooks, or Sheets.
3. **Alerting**
   Post pipeline failures or data quality alerts to an on-call channel.
4. **Project Coordination**
   Share daily status updates or review requests in team channels.
5. **Lightweight Acknowledgments**
   Add one or more emoji reactions when a full Slack reply is unnecessary.
6. **Artifact Sharing**
   Send links to generated PDFs, CSVs, or artifacts for quick access.
7. **Automated Workflow Updates**
   Notify owners when approvals are needed or when jobs finish.

## **Workflow/How It Works**

1. **Identify recipients or targets** by channel, by resolved `slack_user_id`, or by the current Slack thread context for reactions.
2. **Compose** a concise message or choose the emoji reaction you want to add.
3. **Send** via direct message, channel post, or reaction.
4. **Record** message ids or timestamps in your workflow logs if needed.

## **Integration Relevance**

* **project\_manager\_tools** to trigger task or mission updates.
* **file\_manager\_tools** to include links to stored files.
* **artifact\_manager\_tools** to reference generated report artifacts.
* **data\_connector\_tools** to share query outcomes and KPIs.
* **make\_baby\_bot** to announce data agents deployment or configuration changes.

> [!WARNING]
>
> Respect rate limits and workspace policies. Data agents need permission to post to a channel or DM a user, and some workspaces restrict unsolicited DMs.

## **Configuration Details**

* Use exact channel IDs when possible to avoid name collisions.
* Store and reuse `slack_user_id` values once resolved.
* Keep messages within Slack length limits and avoid giant payloads.
* Ensure links point to resources recipients can access.

## **Limitations or Notes**

1. Delivery depends on Slack availability and recipient permissions.
2. User lookup may be ambiguous if multiple users share similar names.
3. Channel posting requires the data agent to be a member of that channel.
4. Message formatting can vary by Slack client.
5. Cross-workspace messaging is not supported.

## **Output**

* **Message Delivery**
  Confirmation with timestamp and message id.
* **Channel Info**
  Posting confirmation and channel metadata.
* **User Lookup**
  Resolved `slack_user_id` and basic profile fields.
* **Reaction Results**
  Confirmation with `success`, optional `partial_success`, the resolved `reaction_name` or `reaction_names`, plus any already-present or failed reactions.
* **Errors**
  Clear messages for invalid users, channels, permissions, or delivery failures.
