Create a feature rule
create_feature_ruleSave a feature rule: events matching its conditions count as feature_name, in past and future feature counts alike (they are worked out from the events). Check it with preview_feature_rule first. Every event it matches counts toward feature_name, including events other features already count: an event counts toward every feature that names it, and no rule takes events from another. Group pages with starts_with or matches on page_path (e.g. matches /products/*), or list pages in one any group (rather than several same-name rules), to give a funnel step a single feature to match. Funnels and flows only pick a rule up from today on. Uses a feature_rules slot (get_project slots_left). Pass run_id from start_setup_run so this undoes together with the rest of the setup; leave it out (never "") to start a new chat run, whose run_id is returned and should go on every later change.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"feature_name": "<feature_name>",
"conditions": "<conditions>"
},
"name": "create_feature_rule"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| run_id | No | The setup run this change belongs to, from start_setup_run. Omit to start a new chat run (its id is returned). | |
| project | No | Project ID, from list_projects. Required when this connection covers more than one project; may be left out when it covers one (and with an API key, which belongs to one project). | |
| conditions | Yes | Conditions. Every item must match (AND); an item is one condition (property, operator, value) or an any group of 1 to 20 conditions of which at least one must match (OR). E.g. [{property: event_type, operator: equals, value: pageview}, {any: [{property: page_path, operator: equals, value: /pricing}, {property: page_path, operator: equals, value: /plans}]}] is a page view of either page. Numbers: [{property: event_type, operator: equals, value: pageview}, {property: page_path, operator: equals, value: /pricing}, {property: scroll_depth, operator: greater_than, value: '74'}] is a page view of /pricing read to at least 75 %. A page view gets its numbers when the visitor leaves or hides the page: feature counts catch up on later ones, a funnel or flow day counted shortly after midnight (project timezone) does not. | |
| feature_name | Yes | The feature name events matching the rule count as. |