create_trigger
Creates a project trigger by validating via dry run and confirming. Requires trigger type, chain, and optionally a price reference for token-holder triggers.
Instructions
Creates a draft trigger: POST /api/v1/projects/:projectId/triggers. Body matches CreateTriggerDto (fuul-webapp triggersService.create / encodeByTriggerType). REQUIRED: call list_trigger_types first; use trigger_types[].id as trigger.type and follow create_payload_layout for that id. Layouts: (1) flat_dto — types custom/classic: put context_json_schema fields at trigger ROOT (signature, event_type, expressions, payable, end_user_identifier_property, contract_ids), NOT nested only in context. (2) context_only — token-holder, liquidity-pool-v2: fields only under trigger.context. (3) context_and_root_fields — most presets: fields under trigger.context plus end_user_identifier_property at root when needed. Use create_payload_example from list_trigger_types when present. Call list_chains for chain_id. dry_run then confirmed. Token-holder price reference (CRITICAL): context.volume_currency_expression prices held balance. Before create_trigger for token-holder / liquidity-pool-v2 / balancer / solana-token-holder / fogo-token-holder: call list_price_references for the chain. If token_address is in that list → volume_currency_expression = token_address. If NOT listed → ask user stablecoin vs variable-price and decimals (6/18), then set volume_currency_expression to a listed reference with matching decimals (e.g. 18-decimal stablecoin on Ethereum → DAI 0x6b175474e89094c44da98b954eedeac495271d0f). Using an unlisted token address causes HTTP 201 but broken volume at runtime. Token-holder example (known asset): {"name":"Hold DAI","description":"...","type":"token-holder","context":{"token_address":"0x6b175474e89094c44da98b954eedeac495271d0f","chain_id":1,"volume_currency_expression":"0x6b175474e89094c44da98b954eedeac495271d0f"}}. Token-holder example (unknown 18d stablecoin): token 0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD → volume_currency_expression 0x6b175474e89094c44da98b954eedeac495271d0f (DAI). Custom off-chain: {"name":"...","description":"...","type":"custom","signature":"event_name","event_type":"off-chain-event","end_user_identifier_property":"address","payable":true,...expressions at root}. On successful execution (not dry_run), the response includes _publish_metadata_reminder: publish project metadata from the dashboard (Project → Incentives or Triggers → Publish now). The MCP cannot publish for you.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | If true, validate and return a preview only; no server mutation. | |
| confirmed | No | Must be true to perform the mutation after reviewing dry_run output. | |
| project_id | Yes | ||
| trigger | Yes | CreateTriggerDto body. Required: name, description, type (list_trigger_types[].id). Layout from list_trigger_types create_payload_layout: flat_dto (custom/classic) = schema fields at root; context_only (token-holder, liquidity-pool-v2) = fields in context; context_and_root_fields = fields in context + end_user_identifier_property at root. See create_payload_example on the matching trigger_types row. |