Skip to content

feat: add webhook tools for projects and groups#361

Open
DarkByteZero wants to merge 3 commits intozereight:mainfrom
DarkByteZero:feat/webhook-tools
Open

feat: add webhook tools for projects and groups#361
DarkByteZero wants to merge 3 commits intozereight:mainfrom
DarkByteZero:feat/webhook-tools

Conversation

@DarkByteZero
Copy link

@DarkByteZero DarkByteZero commented Mar 10, 2026

Summary

  • Adds 3 new unified webhook tools: list_webhooks, list_webhook_events, get_webhook_event
  • Works for both project and group scoped webhooks via project_id or group_id parameter
  • New webhooks toolset (opt-in, isDefault: false)

Tools

Tool Description
list_webhooks List configured webhooks for a project or group
list_webhook_events List recent events (7 days) with summary mode and status filter
get_webhook_event Get full payload of a specific event by ID with optional page hint

Key Features

  • Summary mode: list_webhook_events with summary: true returns only id, url, trigger, response_status, execution_duration to avoid huge payloads
  • Status filter: Filter events by status code (200, 500) or category (successful, client_failure, server_failure)
  • Event lookup: get_webhook_event supports an optional page parameter for direct single-call lookup, or auto-paginates up to 25 pages (500 events) when page is unknown
  • Pagination: GitLab enforces max per_page=20 for webhook events, all tools respect this limit

GitLab API endpoints used

  • GET /projects/:id/hooks / GET /groups/:id/hooks
  • GET /projects/:id/hooks/:hook_id/events / GET /groups/:id/hooks/:hook_id/events

Test plan

  • Verify list_webhooks returns webhooks for a project
  • Verify list_webhooks returns webhooks for a group
  • Verify list_webhook_events with summary: true returns compact results
  • Verify list_webhook_events with status filter works
  • Verify get_webhook_event finds a specific event by ID
  • Verify get_webhook_event with page hint does single API call
  • Verify error when neither project_id nor group_id is provided
  • Verify toolset filtering works (GITLAB_TOOLSETS=webhooks)

- Add 3 unified tools: list_webhooks, list_webhook_events, get_webhook_event
- Support both project and group scoped webhooks via project_id/group_id
- Summary mode strips heavy payloads for overview queries
- Filter events by status code or category (successful, client_failure, server_failure)
- get_webhook_event auto-paginates up to 500 events to find specific event
- New "webhooks" toolset (opt-in, isDefault: false)
- Fix per_page to 20 (GitLab enforces max 20 for webhook events)
- Add optional page parameter to get_webhook_event for direct lookup
- Increase auto-pagination to 25 pages (500 events) when page not provided
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant