Webhook
Definition
An HTTP callback that delivers real-time event notifications from one system to another — when an event occurs, the source system sends an HTTP POST request to a pre-configured URL with event data. In agent systems, webhooks serve as triggers (starting an agent workflow when an event occurs), notification channels (alerting humans when an agent completes a task or needs approval), and integration points (connecting agents to external services that push updates). Webhooks complement MCP's pull-based model with push-based event delivery.
Builder Context
Use webhooks to make your agent event-driven rather than polling-based. Instead of checking for new emails every 5 minutes, register a webhook that triggers your agent when an email arrives. Key implementation details: (1) always verify webhook signatures to prevent spoofing; (2) respond quickly (< 5 seconds) and process asynchronously — don't block the webhook response on your agent's full execution; (3) implement idempotency — webhooks can be delivered multiple times; (4) handle webhook failures gracefully — the sender will retry, so your endpoint must be tolerant of duplicate and out-of-order deliveries.