watch_webhook
Start an HTTP server to receive incoming webhooks from sources like GitHub or Vercel, enabling real-time visibility into CI results, deployments, and test outcomes for AI coding agents.
Instructions
Start an HTTP server to receive incoming webhooks
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source_type | Yes | Label for the webhook source (e.g. "github", "vercel") | |
| port | No | Port to listen on (default: 9876) | |
| filter | No | Optional filter criteria | |
| action_id | No | Link events to an agent action |
Implementation Reference
- src/server.ts:395-425 (handler)The handleWatchWebhook method implements the watch_webhook tool logic by parsing input arguments, creating a watch record, and registering a new WebhookWatcher.
private async handleWatchWebhook(args: Record<string, unknown>) { const schema = z.object({ source_type: z.string(), port: z.number().optional(), filter: z.record(z.unknown()).optional(), action_id: z.string().optional(), }); const parsed = schema.parse(args); const id = uuidv4(); const now = new Date().toISOString(); const config: WebhookConfig = { kind: 'webhook', ...parsed }; const watch: WatchRecord = { id, kind: 'webhook', config, action_id: parsed.action_id ?? null, created_at: now, active: true, last_poll_at: null, }; insertWatch(watch); const watcher = new WebhookWatcher(id, parsed.action_id ?? null, this.registry.getNotifyFn(), config); this.registry.register(watcher); return { content: [{ type: 'text' as const, text: JSON.stringify({ watch_id: id, status: 'listening', port: parsed.port ?? 9876 }), }], - src/server.ts:179-180 (registration)The tool call is routed to handleWatchWebhook within the main server request handler.
case 'watch_webhook': return this.handleWatchWebhook(args ?? {}); case 'check_consequences': return this.handleCheckConsequences(args ?? {});