Skip to content

rust(feat): add list_webhooks and webhook_ids on create_rule and update_rule - #837

Open
bill-sift wants to merge 3 commits into
mainfrom
mcp-rule-webhooks
Open

bill-sift wants to merge 3 commits into
mainfrom
mcp-rule-webhooks

Conversation

@bill-sift

Copy link
Copy Markdown
Contributor

Agents could not see or attach webhooks, so a request to alert someone when a rule fires lost its notification step.

  • New list_webhooks tool over ListWebhooks. The backend returns credentials in plaintext, so the tool keeps only the target URL's scheme and the last two labels of its host, header names, and no body template.
  • create_rule and update_rule take webhook_ids. On update_rule it replaces the rule's set, like asset_ids; omitted, the current webhooks are kept, even through a conditions_json rewrite, and next_step names any webhook detached.
  • Both tools confirm each webhook exists and is not archived before writing, since Sift accepts an archived webhook on a rule and never calls it. Webhook actions written into the conditions are refused so none skips that check.
  • create_rule documents the annotation action shape, and both tools check for exactly one condition. Sift answers a rule with none with an internal error.

…te_rule

Agents could not see or attach webhooks, so a request to alert someone when a
rule fires lost its notification step.

- New list_webhooks tool over ListWebhooks. The backend returns credentials in
  plaintext, so the tool keeps only the target URL's scheme and the last two
  labels of its host, header names, and no body template.
- create_rule and update_rule take webhook_ids. On update_rule it replaces the
  rule's set, like asset_ids; omitted, the current webhooks are kept, even
  through a conditions_json rewrite, and next_step names any webhook detached.
- Both tools confirm each webhook exists and is not archived before writing,
  since Sift accepts an archived webhook on a rule and never calls it. Webhook
  actions written into the conditions are refused so none skips that check.
- create_rule documents the annotation action shape, and both tools check for
  exactly one condition. Sift answers a rule with none with an internal error.
Comment thread rust/crates/sift_mcp/src/service/rules/mod.rs
Comment thread rust/crates/sift_mcp/src/tool/rules/mod.rs
Comment thread rust/crates/sift_mcp/src/tool/webhooks/mod.rs
…d-only webhook actions

- An action typed WEBHOOK now counts as a webhook action with or without a
  configuration. It is refused in rule_json and conditions_json, and replacing
  the set with webhook_ids drops one that names no webhook.
- update_rule checks only newly attached webhooks for archived status, so
  passing a rule's current set back is always safe. The rule is fetched and
  merged before the check, which adds no call.
- The ListWebhooksRequest and ListWebhookLogsRequest order_by comments now
  say an empty order_by sorts newest first, matching the API.
@github-actions

github-actions Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

Python docs preview: https://sift-stack.github.io/sift/python/pr-837/

Deployed from 5dafc97. The link may take up to a minute to become live as GitHub Pages propagates.

@bill-sift
bill-sift requested a review from bijan-sift October 15, 2026 18:01
bijan-sift
bijan-sift previously approved these changes Oct 15, 2026

This branch has not been deployed

No deployments
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.

2 participants