qobrix_deals
Fetch and rank property deals from Qobrix CRM—sales, rentals, listings, and reserved—with filters for price, date, commission, and agent.
Instructions
Flexible 'deals' tool over the Contracts table — covers sales, rentals, listing agreements, and pipeline reservations in a single call. Defaults: kind='sale', contract_statuses=['agreed'] (so a no-arg call still means 'closed sale contracts'). Every default is overridable via kind / contract_types / contract_statuses / include_reserved / date_field / min_price / max_price / party filters / raw search. Sorts in-process across the matching set (for a single page of highest prices you can also use list/search with sort='-final_selling_price_amount') and resolves property_id, agent, commission_to, lawyers, bank, etc. to readable names. Example uses: Best 2026 closed sales: { year: 2026, top: 5 }. Best 2026 rentals: { kind: 'rental', year: 2026, top: 5 }. Under-contract pipeline value: { contract_statuses: ['reserved'], year: 2026 }. My deals: { assigned_to: 'CURRENT_USER', year: 2026 }. All revenue deals >€1M last 90 days: { kind: 'any_revenue', since_days: 90, min_price: 1000000 }. Agent leaderboard (by commission): { year: 2026, by: 'commission', top: 10 }.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| by | No | Sort axis (default 'price'). 'price' uses final_selling_price_amount (sale), final_rental_price_amount (rental), or per-row coalesce for mixed kinds. 'commission' uses commission_value_amount. 'date' uses the resolved date_field. | |
| to | No | ISO date (YYYY-MM-DD) exclusive upper bound. | |
| top | No | Number of deals to return (default 10, max 50). The summary block always covers the full filtered set. | |
| desc | No | Sort descending (default true). | |
| from | No | ISO date (YYYY-MM-DD) inclusive lower bound. | |
| kind | No | Semantic shortcut (default 'sale'). Sets default contract_types when contract_types is omitted: 'sale'=['cos'], 'rental'=['tenancy_agreement'], 'listing'=['listing_for_sale','listing_for_rent'], 'any_revenue'=['cos','tenancy_agreement'], 'any'=no contract_type filter. | |
| year | No | Calendar year window (e.g. 2026). | |
| agent | No | Convenience alias for commission_to_2 (the deal's broker/external agent). | |
| search | No | Extra raw Qobrix search expression ANDed with everything else (escape hatch for niche filters). | |
| max_price | No | Upper bound on the kind's natural price field. | |
| min_price | No | Lower bound on the kind's natural price field (selling for sale, rental for rental). | |
| date_field | No | Which date column to filter by (default depends on kind: sale=date_of_contract, rental=start_date, listing=created, otherwise date_of_contract). | |
| since_days | No | Rolling window: only deals dated within the last N days. Mutually exclusive with year/from/to. | |
| assigned_to | No | User UUID assigned to the contract, or the special token 'CURRENT_USER'. | |
| commission_to | No | User UUID receiving commission (commission_to), or 'CURRENT_USER'. | |
| contract_types | No | Explicit contract types (overrides kind defaults). Subset of: cos, tenancy_agreement, listing_for_sale, listing_for_rent, property_management, viewing_agreement. | |
| commission_to_2 | No | Agent UUID receiving commission (commission_to_2). | |
| include_reserved | No | Convenience flag: when true, adds 'reserved' to contract_statuses. | |
| contract_statuses | No | Contract statuses (default ['agreed']). Use ['reserved','agreed'] for under-contract + closed, ['reserved'] for pipeline only, ['cancelled'] for fall-throughs. |