salesforce_run_analytics
Execute Salesforce reports with optional filters and detail rows, or retrieve current dashboard component data without triggering a refresh.
Instructions
Execute a Salesforce report or retrieve current dashboard component data.
For reports: runs the report synchronously via the Analytics API. Supports optional runtime filter overrides, date filter overrides, and detail row inclusion. When includeDetails is true, defaults to returning 100 rows (override with topRows). The sync API has a hard maximum of 2,000 detail rows — a warning is included if results are truncated. Aggregates and grouping summaries are always returned in full.
For dashboards: retrieves each component's current data (aggregates, grouping summaries) without triggering a refresh. To refresh first, use salesforce_refresh_dashboard.
Examples:
Run a report with saved defaults:
type: "report"
resourceId: "00Oxx000000XXXXX"
Run a report with detail rows:
type: "report"
resourceId: "00Oxx000000XXXXX"
includeDetails: true
Run a report with filter overrides:
type: "report"
resourceId: "00Oxx000000XXXXX"
includeDetails: true
filters: [{ "column": "STAGE_NAME", "operator": "equals", "value": "Closed Won" }]
standardDateFilter: { "column": "CLOSE_DATE", "durationValue": "LAST_N_DAYS:90" }
Run a report with row limit:
type: "report"
resourceId: "00Oxx000000XXXXX"
includeDetails: true
topRows: { "rowLimit": 50, "direction": "Desc" }
Run a report with multiple filters and boolean logic:
type: "report"
resourceId: "00Oxx000000XXXXX"
filters: [ { "column": "STAGE_NAME", "operator": "equals", "value": "Closed Won" }, { "column": "AMOUNT", "operator": "greaterThan", "value": "10000" } ]
booleanFilter: "1 AND 2"
Get current dashboard component data:
type: "dashboard"
resourceId: "01Zxx000000XXXXX"
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| type | Yes | Type of analytics resource: "report" or "dashboard" | |
| resourceId | Yes | The 15 or 18-character Salesforce report or dashboard ID | |
| includeDetails | No | Reports only. Include detail rows in results (default false). Capped at 2,000 rows by the API. | |
| filters | No | Reports only. Runtime filter overrides applied for this execution only. | |
| booleanFilter | No | Reports only. Boolean filter logic string (e.g., "1 AND (2 OR 3)"). | |
| standardDateFilter | No | Reports only. Standard date filter override. | |
| topRows | No | Reports only. Row limit with sort direction. |