Skip to main content
Glama

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
NameRequiredDescriptionDefault
source_typeYesLabel for the webhook source (e.g. "github", "vercel")
portNoPort to listen on (default: 9876)
filterNoOptional filter criteria
action_idNoLink events to an agent action

Implementation Reference

  • 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 ?? {});

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jarvisassistantux/loopsense'

If you have feedback or need assistance with the MCP directory API, please join our Discord server