MCP tools for lead alerts
List, create, update, and delete lead alert rules, and read the visits they checked, from an AI assistant.
These tools manage lead alerts and read their results. Rule changes take effect immediately: there's no draft and nothing to publish. The lead alerts reference explains how visits are checked and what each action does.
MCP lead alert access
Every tool accepts an optional string project_id and follows the shared MCP authorization and project-selection rules. Lead alerts require Pro. On a project without them, every tool returns Lead alerts are part of the Pro plan (People pages), which this project does not have. Upgrade the project to use them.
Rules and checked visits are addressed by string IDs (rule_id and visit_id). Results can include email addresses, contact tags and fields, and browsing history. Examples are illustrative and were not executed. They show tools/call parameters and decoded response payloads.
list-lead-alert-rules
Read-only. Takes only project_id. Returns:
live_checking: whether visits are being checked and actions run in this environment.how_it_works: a sentence-level summary of when visits are checked and when a rule takes effect.alert_confidence: the confidence a match needs, such as0.8.max_rules:10.rules: each rule'srule_id,name,description,enabled, andactions.
Actions use the shapes below. Email platform actions include the platform they were set up for.
type | Fields |
|---|---|
email | to: comma-separated addresses, 1 to 20. One email action per rule. |
tag | tag_ids, up to 20, and platform. |
list | list_ids, up to 20, and platform. |
field | field_id, value (up to 500 characters), and platform. |
Tag, list, and field IDs come from get-integration-data in the integration tools. These actions only change a person who is already a contact in the connected email platform; they never create one. An action the platform can't run, or one set up for a different platform, is refused with the reason.
create-lead-alert-rule
| Argument | Type | Required | Behavior |
|---|---|---|---|
project_id | string | No | Active or eligible project. |
name | string | Yes | Shown in alerts and email subjects. Up to 120 characters. |
description | string | Yes | Who to alert on, in plain language. Up to 1,000 characters. |
enabled | boolean | No | Defaults to true. |
actions | array | No | Up to 10 actions in the shapes above. Without actions, matches are only listed. |
A project can have up to 10 rules. The rule applies to visits checked after it's created. Returns {rule}.
update-lead-alert-rule
Requires rule_id and at least one of name, description, enabled, or actions, with the same limits as create. enabled: false pauses the rule without deleting it. actions replaces every action the rule has, so start from the rule's current actions; keep each existing email platform action's platform, and leave it out for a new one. An empty list leaves matches only listed. New wording applies to visits checked from then on. Returns {rule}.
delete-lead-alert-rule
Requires rule_id. Deletes the rule immediately; there's no undo. Visits it already checked keep its verdicts. Returns {"deleted":true,"rule_id":"..."}.
list-lead-alerts
Read-only. Lists checked visits, newest first.
| Argument | Type | Required | Behavior |
|---|---|---|---|
project_id | string | No | Active or eligible project. |
include_non_matches | boolean | No | Defaults to false, which lists alerts only. true adds checked visits that didn't alert. |
email | string | No | Only this person's visits. |
limit | integer | No | 20; clamped to 1–50. |
offset | integer | No | 0. Visits to skip, for paging. |
The response has live_checking, total, limit, offset, has_more, and visits. Each visit has visit_id, email, visit_ended_at, alert, summary, pageviews, arrived_from, test_run, nullable emailed_at, verdicts, and actions. A verdict has rule_id, rule_name, verdict (match, no_match, or null), confidence, alerted, and repeat_not_resent. An action result has rule_id, type, status (done, skipped, or failed), and detail. test_run: true marks a visit found by replaying past traffic; no actions ran for it.
get-lead-alert
Read-only. Requires visit_id from list-lead-alerts. Returns everything in the list entry plus visit_started_at, facts (the pages with titles and time on each, arrival, network, earlier activity, segments, and email platform contact the rules were judged on), insights, and insights_error.
An unknown ID returns Checked visit '<id>' not found. Use list-lead-alerts to see visit IDs.