Query data
Count, group or total many records with a MongoDB aggregation pipeline. Use it for how-many questions and breakdowns. For the deal pipeline, use list_deals.
This tool reads data and changes nothing.
Authorizations
Body
Entity type to aggregate. Any of: artifacts, shares, workflows, workflow_runs, workflow_outputs, member, lists, list_memberships, assets, asset_templates, account, contact, product, opportunity, accountProduct, risk, ticket, activity, file, agent_steps, deals, deal_readings, email_messages, calendar_events, or a custom object slug, as search_records's typeLabels name them. Mail and calendar are reachable here as email_messages and calendar_events, but to FIND a specific message use search_records instead; this tool answers aggregate questions.
MongoDB aggregation pipeline as a JSON array string, for example '[{"$match":{"data.event-type":"foo"}},{"$count":"value"}]'. Workspace+definition match is auto-prepended; do not include it. (Encoded as a string because some providers strip "$"-prefixed keys from typed-object tool parameters.)

