Skip to content

[new tool] @agent-tools/notify — Multi-channel notification dispatch with provider fallback #218

@burner-agent

Description

@burner-agent

Tool Name

@agent-tools/notify

Description

Unified multi-channel notification dispatcher that sends messages across email, Slack, Discord, webhook, SMS, and push channels through a single API with automatic provider fallback and retry.

Why It's Useful for Agents

AI agents running autonomous workflows need to alert operators when tasks complete, errors occur, or approval is required — and operators may prefer different channels at different times. Currently agents must integrate each channel separately (SMTP for email, webhook for Slack/Discord, Twilio for SMS), duplicating retry logic and error handling per channel. A unified notification tool lets agents declare what to notify and where, with the dispatch layer handling provider-specific formatting and delivery guarantees.

Researched Novu (38.9k stars, TypeScript, 40+ provider integrations, workflow engine + embeddable inbox — full notification infrastructure platform, too heavy for SDK embedding), notifme-sdk (2k stars, MIT, multi-channel with provider strategies including fallback and round-robin, local testing catcher — best API model but JavaScript-only and lightly maintained), and node-notifier (5.8k stars, MIT, 9M weekly downloads — desktop notifications only, not applicable to server-side agent alerting). No existing library provides a TypeScript-first lightweight notification dispatcher with provider fallback and channel routing suitable for embedding in an SDK.

Proposed API

import { createNotifier, EmailProvider, SlackProvider, DiscordProvider, WebhookProvider } from '@agent-tools/notify';

// Configure channels with providers
const notifier = createNotifier({
  channels: {
    email: { provider: new EmailProvider({ smtp: { host: 'smtp.example.com', port: 587 } }) },
    slack: { provider: new SlackProvider({ webhookUrl: process.env.SLACK_WEBHOOK }) },
    discord: { provider: new DiscordProvider({ webhookUrl: process.env.DISCORD_WEBHOOK }) },
    webhook: { provider: new WebhookProvider({ url: 'https://hooks.example.com/notify' }) },
  },
  fallback: ['slack', 'email'],  // If primary channel fails, try these in order
  retry: { maxAttempts: 3, backoff: 'exponential' },
});

// Send to specific channel
await notifier.send('slack', {
  title: 'Deploy Complete',
  body: 'v2.3.1 deployed to production successfully.',
  level: 'info',
});

// Send to multiple channels
await notifier.broadcast(['slack', 'email'], {
  title: 'Pipeline Failed',
  body: 'Step 3/5 failed: test suite timeout after 300s.',
  level: 'error',
  metadata: { runId: 'abc-123', step: 3 },
});

// Channel-specific formatting handled automatically
// Slack → Block Kit, Discord → Embeds, Email → HTML template, Webhook → JSON payload

// Provider fallback on failure
const result = await notifier.send('slack', message, { fallback: true });
// result: { channel: 'email', provider: 'smtp', delivered: true, fallbackUsed: true }

// Custom provider registration
notifier.registerProvider('teams', new WebhookProvider({
  url: process.env.TEAMS_WEBHOOK,
  formatter: (msg) => ({ '@type': 'MessageCard', text: msg.body }),
}));

Scope

In scope:

  • Channel abstraction (email, Slack, Discord, generic webhook, SMS via Twilio/Vonage)
  • Provider fallback chains with configurable retry
  • Channel-specific message formatting (Block Kit, Embeds, HTML email)
  • Notification levels (info, warning, error, critical)
  • Broadcast to multiple channels simultaneously
  • Custom provider registration via webhook formatter
  • Delivery result tracking with channel/provider metadata
  • Template interpolation for message bodies

Out of scope:

  • Notification inbox UI (Novu territory)
  • Workflow orchestration / digest engine
  • User preference management / subscription management
  • Push notification certificate management (APNs/FCM)
  • Real-time WebSocket notification streaming

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedExtra attention is neededinfrastructureCI, workflows, build toolingintegrationCross-package or external integrationnew-toolProposal for a new tool packagetier:autonomyTier 3 — self-extension, shell, orchestrationtier:utilityTier 1 — standalone utility packages

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions