filter_opportunities
Filter opportunities by milestone, value, close date, or tags to locate specific deals. Use a date filter (e.g., within last 90 days) and choose the highest ID for the newest record.
Instructions
Filter opportunities by structured conditions (milestone, value, close date, tags). Use this — not search_opportunities — for questions like 'last won deal', 'opportunities closed this month', 'pipeline X at milestone Y'. Capsule's API does not support ad-hoc sort, but for 'most recent X' you can filter by a date field (e.g. {field: 'closedOn', operator: 'is within last', value: 90}) and pick the highest-id row — Capsule IDs are monotonic, so newest id = newest record.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | ||
| embed | No | Comma-separated embeds. Valid tokens: tags, fields, party, milestone, missingImportantFields. | |
| perPage | No | ||
| conditions | Yes | Array of filter conditions. All conditions are ANDed together. To get newest records, use a date condition like {field: 'addedOn', operator: 'is within last', value: 7} and pick the highest-id row from the result (Capsule IDs are monotonic). |