slack

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 14, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package slack provides the slack_send tool for sending messages to Slack.

Two delivery modes are supported by design:

  1. Incoming Webhooks (simplest — no OAuth required): Create a webhook in your Slack app settings and set SLACK_WEBHOOK_URL. Supports text, blocks, and attachments. One channel per webhook.

  2. Bot API (richer — requires a Slack app with OAuth scopes): Set SLACK_BOT_TOKEN (xoxb-...) and call chat.postMessage. Supports any channel the bot is invited to, threads, reactions, files.

Implementation notes for contributors:

  • Prefer Incoming Webhooks for the first implementation: simpler auth, no scope approval needed, supports Block Kit payloads.
  • For Bot API: scope needed is chat:write. Token comes from the app's OAuth & Permissions page.
  • Block Kit reference: https://api.slack.com/block-kit

Env vars:

SLACK_WEBHOOK_URL   — Incoming Webhook URL (preferred for simple sends)
SLACK_BOT_TOKEN     — Bot token for the Bot API mode
SLACK_DEFAULT_CHAN  — Default channel for Bot API mode (e.g. #general)

See GitHub issue for full implementation spec.

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("slack_send: not implemented — see GitHub issue")

ErrNotImplemented is returned until the HTTP client and Block Kit builder are wired up.

Functions

This section is empty.

Types

type SendTool

type SendTool struct{}

func NewSendTool

func NewSendTool() *SendTool

func (*SendTool) BackfillInput

func (t *SendTool) BackfillInput(_ context.Context, in map[string]any) map[string]any

func (*SendTool) Call

func (*SendTool) CheckPermissions

func (t *SendTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult

func (*SendTool) Definition

func (t *SendTool) Definition() tool.Definition

func (*SendTool) Description

func (t *SendTool) Description(_ context.Context) (string, error)

func (*SendTool) FormatResult

func (t *SendTool) FormatResult(data any) string

func (*SendTool) IsConcurrencySafe

func (t *SendTool) IsConcurrencySafe(_ map[string]any) bool

func (*SendTool) IsEnabled

func (t *SendTool) IsEnabled() bool

func (*SendTool) IsReadOnly

func (t *SendTool) IsReadOnly(_ map[string]any) bool

func (*SendTool) ValidateInput

func (t *SendTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL