Create event handler
create-event-handlerDefine a rule that fires GL transactions when a matching event block is created with apply_handlers=True. Match criteria (event_type, event_category, match_source, match_agent_type, etc.) act as AND-joined filters — null fields match anything. The highest-priority matching handler wins. A handler created through an AI client is the AI's suggestion (suggested_by='ai'): it takes no part in matching until a person approves it in the app or the API.
Example tool call
This call uses example arguments supplied in the tool’s input schema.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"name": "QB Vendor Bill — Default Expense Posting",
"priority": 0,
"event_type": "vendor_bill_received",
"match_source": "quickbooks",
"transaction_template": {
"transactions": [
{
"entry_template": {
"debit": {
"amount": "{{ event.amount }}",
"element_id": "elem_coa_office_supplies"
},
"credit": {
"amount": "{{ event.amount }}",
"element_id": "elem_coa_accounts_payable"
}
}
}
]
}
},
"name": "create-event-handler"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Human-readable handler name (unique per graph). | |
| origin | No | Provenance of the handler. `tenant` = authored on this graph, the only value a caller may set; `hub` = platform-shipped template. | tenant |
| metadata | No | Free-form metadata stored alongside the handler. | |
| priority | No | Tiebreaker when multiple equally-specific handlers match. Higher = wins. | |
| is_active | No | Inactive handlers are ignored at match time. | |
| event_type | Yes | Event type to match. Matches the `event_type` field on incoming events from `create-event-block`. | |
| description | No | Free-form description shown in admin UIs. | |
| match_source | No | Match the event's `source` field (e.g. 'quickbooks', 'plaid'). Useful when the same event_type comes from multiple integrations. | |
| event_category | No | Optional category filter (e.g. 'expense', 'revenue'). | |
| match_agent_type | No | Match agent-emitted events by agent_type. | |
| match_resource_type | No | Match resource-bound events by resource_type. | |
| transaction_template | Yes | The DSL spec for the GL rows this handler produces. See `TransactionTemplate` for the shape. | |
| match_metadata_expression | No | JSONPath-style equality map against event.metadata, e.g. {"category": "payroll"} or {"metadata.category": "payroll"} |