search_deals
Search deals/opportunities in the CRM. USE FOR: pipeline queries, deal lookups by name or account or contact, deals closing soon, deals over a certain amount. PAGINATION: results are one page, not the complete match set. Use limit up to 50 and start with offset: 0; while the number of records read is less than total_count, call this tool again with offset increased by the number of results returned. Ordering is stable across pages. PARAMETER CHOICE: use the top-level semantic params (pipeline_name, stage_name, account_name, contact_name, min_amount, max_amount, close_date_from, close_date_to) for common filters. Use additional_filters only for custom attributes, owner, last activity, or anything beyond the semantic params. ADDITIONAL_FILTERS PREREQUISITES: (1) set pipeline_name or stage_name first to resolve a pipeline (additional_filters and sort_by both require this); (2) for custom attributes, call get_deal_fields first to get the correct property_name. Do NOT guess property names. OWNER LOOKUP: call list_workspace_members to resolve the person's user_id; a CRM contact email is not a workspace owner ID. Filter with additional_filters [{property_name: 'opportunity_owner', condition: 'is', value: user_id}]. For all pipelines, repeat the scoped search for each pipeline and paginate each result. Do not filter ownership by owner_email. MULTIPLE DEAL NAMES IN ONE QUERY: use keywords, not search_query. See the keywords parameter docs for the batching rule. ZERO RESULTS RETRY: if the search returns total_count=0, retry ONCE with a broader keyword before telling the user nothing was found. Drop trailing segments ("Acme Q4 Expansion Deal" → "Acme Q4 Expansion" → "Acme"), or swap to a different name field (account_name only or contact_name only). Stop after one retry - do not loop.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "search_deals"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum results per page (1-50, default 10). | |
| offset | No | 0-indexed row offset for paging. Start at 0, then increase by the number of results returned until `offset + results.length >= total_count`. Ordering is stable across pages, so tied sort values do not repeat or skip records. | |
| sort_by | No | Sort order. Defaults to `updated_at desc` when omitted. Requires a resolved pipeline. Set `pipeline_name` or `stage_name` first. | |
| keywords | No | Multi-keyword OR search. Pass up to 10 deal name terms; any deal matching at least one term is returned. **Always prefer this over multiple search_deals calls when the user references more than one deal.** Example: "How are the Acme renewal, Globex POC, and Initech expansion looking?" becomes one call with `keywords: ["Acme renewal", "Globex POC", "Initech expansion"]`, not three calls. Use `search_query` instead for a single deal with fuzzy/partial matching. | |
| max_amount | No | Maximum deal value. | |
| min_amount | No | Minimum deal value. | |
| session_id | No | The ID of the task this call belongs to. Leave it out on your first call. On every later call for the same task, send the ID an earlier result gave you, and pass it to any subagent working on that task. | |
| stage_name | No | Filter by stage name (e.g. 'Negotiation', 'Won'). | |
| account_name | No | Filter by associated company/account name. Use when the user explicitly asks to filter by company, or to check whether a company already has a deal. Do NOT use for deal name lookups (use `search_query` or `keywords` instead). | |
| contact_name | No | Filter by associated contact name. | |
| search_query | No | Search by deal/opportunity name with fuzzy matching. Use when the user mentions a single deal by name (e.g. 'the Linear deal', 'Acme contract'). For multiple deals in one query, use `keywords` instead. | |
| close_date_to | No | Last day of the close date range, INCLUSIVE, as a calendar date `YYYY-MM-DD` in the user's calendar (e.g. '2026-05-19'). If you pass an instant, its written date is used, whatever the offset. | |
| pipeline_name | No | Filter by pipeline name (e.g. 'Customer Success', 'Sales'). | |
| close_date_from | No | First day of the close date range, INCLUSIVE, as a calendar date `YYYY-MM-DD` in the user's calendar (e.g. '2026-05-18'). If you pass an instant, its written date is used, whatever the offset. | |
| additional_filters | No | Escape hatch for filters not covered by the top-level semantic params (custom attributes, owner, last activity, etc.). Requires a resolved pipeline. Set `pipeline_name` or `stage_name` first; cross-pipeline rich filtering is not yet supported. `before`, `on_or_after`, `is` and `is_not` compare dates by CALENDAR DAY, and `after` compares against the START of the given day, so on a timestamp field it still includes most of that day; use `on_or_after` the next day to exclude it, so pass calendar dates as `YYYY-MM-DD` from the user's own calendar, not instants: an instant with a timezone offset is cut to its UTC day, which east of UTC is the day before. For a date range, pass TWO filters on the same property, `before` being exclusive. Example for one day: `{property_name:opportunity_close_date, condition:on_or_after, value:'2026-05-18'}` AND `{property_name:opportunity_close_date, condition:before, value:'2026-05-19'}`. There is no `between` operator. Use those conditions for dates, not `greater_than` / `less_than`, which compare exact timestamps (a bare date there means 00:00 UTC). Records with no date never match a date bound. Whether `is_not` includes them depends on the search path, so never report undated records as included or excluded by it; list them with `empty` in a separate search when they matter. RELATIVE DATES: for 'today', 'this week', 'in the next 30 days' and the like, prefer one filter with a relative condition (`today`, `yesterday`, `tomorrow`, `before_today`, `after_today`, `this_week`, `next_week`, `this_month`, or `next_x_days` / `past_x_days` with the day count as `value`). These are resolved from the user's own calendar date, weeks starting Monday, so you do not compute dates or offsets yourself. On timestamp fields (`updated_at`, `opportunity_creation_date` and the interaction fields) each day is compared as the UTC day of that date, so it is offset from the user's local day by their UTC offset; say so when a result depends on the hours near midnight. |