Documentation
¶
Overview ¶
Package slack provides the slack_send tool for sending messages to Slack.
Two delivery modes are supported by design:
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.
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 ¶
- Variables
- type SendTool
- func (t *SendTool) BackfillInput(_ context.Context, in map[string]any) map[string]any
- func (t *SendTool) Call(_ context.Context, _ tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
- func (t *SendTool) CheckPermissions(_ context.Context, in map[string]any, _ tool.ToolUseContext) types.PermissionResult
- func (t *SendTool) Definition() tool.Definition
- func (t *SendTool) Description(_ context.Context) (string, error)
- func (t *SendTool) FormatResult(data any) string
- func (t *SendTool) IsConcurrencySafe(_ map[string]any) bool
- func (t *SendTool) IsEnabled() bool
- func (t *SendTool) IsReadOnly(_ map[string]any) bool
- func (t *SendTool) ValidateInput(_ context.Context, in map[string]any) (map[string]any, error)
Constants ¶
This section is empty.
Variables ¶
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 (*SendTool) Call ¶
func (t *SendTool) Call(_ context.Context, _ tool.CallInput, _ types.CanUseToolFn) (tool.CallResult, error)
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