feat(mcp): attach existing webhooks to agents (PRO-1951) - #33
Merged
prat11m merged 1 commit intoJul 24, 2026
Merged
Conversation
Adds agent-scoped webhook subscription tools wrapping /agent/:id/webhook-subscriptions: - attach_agent_webhook: attach an existing webhook to an agent for chosen events (replaces the agent's existing subscriptions) - get_agent_webhooks: list an agent's subscriptions - detach_agent_webhooks: remove all of an agent's subscriptions Also makes create_webhook events optional (endpoint-only registration) and steers callers to attach_agent_webhook for existing endpoints. Event types are required and must not be assumed. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
prat11m
requested review from
abhishekmishragithub,
harshitajain165 and
maharshi-smallest
as code owners
July 24, 2026 11:00
abhishekmishragithub
approved these changes
Jul 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #32 (PRO-1950). That pass only exposed org-level
/webhookCRUD, which forced "create + attach" every time and let the model assume event types. The backend actually has an agent-scoped subscription API to attach an already-created webhook to an agent — this PR wraps it.New tools
attach_agent_webhookPOST /agent/:id/webhook-subscriptions{webhookId, eventTypes[]}get_agent_webhooksGET /agent/:id/webhook-subscriptionsdetach_agent_webhooksDELETE /agent/:id/webhook-subscriptionsBehavior fixes (the actual asks)
attach_agent_webhookpoints an agent at an existing webhook.create_webhook's description now steers callers to use it (and toget_webhooksfirst) instead of registering a duplicate.event_typesis required on attach, and every event field carries an explicit "do not guess — ask the user" instruction.create_webhook.eventsis now optional (backend accepts an empty array) so you can register an endpoint-only webhook, then attach separately.Important backend semantics (documented in the tool)
POST /agent/:id/webhook-subscriptionsreplaces the agent's subscriptions — it deletes all existing subs for the agent, then recreates them for the given webhook only. So an agent points at one webhook at a time via this endpoint. (agent.controller.ts:972-996)Flow
get_webhooks(pick from the list) →attach_agent_webhook(with the events the user chose).Test plan
get_webhookslists existing endpoints.attach_agent_webhookwith an existing webhook_id + explicit event_types → agent receives those events; verify viaget_agent_webhooks.detach_agent_webhooksclears them.create_webhookwithouteventsregisters an endpoint-only webhook.Linear
PRO-1951
🤖 Generated with Claude Code