Skip to content

Commit 32b380f

Browse files
authored
improvement(salesforce): align tools + block with Salesforce API and harden CRUD/analytics (#5040)
* improvement(salesforce): align tools + block with Salesforce API and harden CRUD/analytics - Migrate all 4 Account tools to shared getInstanceUrl + extractErrorMessage helpers (drop ~40 lines of inlined idToken decode per file) - Use extractErrorMessage consistently across every CRUD tool; add loggers to the opportunity tools - Trim ID path params on all update/delete/single-get tools; URL-encode single-record field lists - Fix dashboard tools: read name/metadata from dashboardMetadata.attributes (was always null); refresh now returns status/statusUrl defensively; drop no-op list_dashboards folderName filter - Expose update_case origin/contact/account and update_task who/what fields end-to-end - Block: mark create-required (Name, LastName, Company, StageName, Subject) and update/delete IDs conditionally required; add account billing*/revenue/employees and contact mailing*/department subBlocks; convert includeDetails to a Yes/No dropdown; move optional fields to advanced mode - Trim over-declared dashboard output types; make Task.Status optional - Regenerate integration docs * fix(salesforce): correct list/refresh response shapes per live API docs - list_dashboards: GET /analytics/dashboards returns a bare top-level array, not a {dashboards} wrapper (fixes always-empty result) - refresh_dashboard: statusUrl is returned at the top level of the PUT response, read it there first - list_reports: the list resource only returns report name/id/url/describeUrl/instancesUrl, so drop the no-op folderName filter and match searchTerm on name only Validated tool-by-tool against the live Salesforce REST/Analytics/Object-Reference docs (API v67.0). * fix(salesforce): address Greptile/Cursor review - Add shared requireId() guard so whitespace-only IDs fail fast instead of producing malformed /sobjects/Object/ empty-path requests (all update/delete/single-get tools) - URL-encode the fields query value in get_opportunities and get_tasks single-record GETs (matching the other get_* tools) - Reflect the Salesforce API success flag consistently across all create tools (success/created use data.success === true) * fix(salesforce): trim echoed output IDs and relation reference IDs - update/delete tools now return output.id from the trimmed ID so chained workflows never receive whitespace-padded IDs - trim relation reference IDs (AccountId, ContactId, WhoId, WhatId) in create/update bodies to avoid Salesforce reference errors from copy-pasted whitespace * fix(salesforce): trim accountId in update_contact body Last remaining untrimmed relation reference ID — update_contact now trims AccountId like the other create/update tools.
1 parent 1fdb43f commit 32b380f

38 files changed

Lines changed: 454 additions & 370 deletions

apps/docs/content/docs/en/integrations/salesforce.mdx

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Delete a contact from Salesforce CRM
276276

277277
### `salesforce_get_leads`
278278

279-
Get lead(s) from Salesforce
279+
Retrieve lead(s) from Salesforce CRM
280280

281281
#### Input
282282

@@ -571,6 +571,9 @@ Update an existing case
571571
| `subject` | string | No | Case subject |
572572
| `status` | string | No | Status \(e.g., New, Working, Escalated, Closed\) |
573573
| `priority` | string | No | Priority \(e.g., Low, Medium, High\) |
574+
| `origin` | string | No | Origin \(e.g., Phone, Email, Web\) |
575+
| `contactId` | string | No | Salesforce Contact ID \(18-character string starting with 003\) |
576+
| `accountId` | string | No | Salesforce Account ID \(18-character string starting with 001\) |
574577
| `description` | string | No | Case description |
575578

576579
#### Output
@@ -678,6 +681,8 @@ Update an existing task
678681
| `status` | string | No | Status \(e.g., Not Started, In Progress, Completed\) |
679682
| `priority` | string | No | Priority \(e.g., Low, Normal, High\) |
680683
| `activityDate` | string | No | Due date in YYYY-MM-DD format |
684+
| `whoId` | string | No | Related Contact ID \(003...\) or Lead ID \(00Q...\) |
685+
| `whatId` | string | No | Related Account ID \(001...\) or Opportunity ID \(006...\) |
681686
| `description` | string | No | Task description |
682687

683688
#### Output
@@ -720,8 +725,7 @@ Get a list of reports accessible by the current user
720725
| --------- | ---- | -------- | ----------- |
721726
| `idToken` | string | No | No description |
722727
| `instanceUrl` | string | No | No description |
723-
| `folderName` | string | No | Filter reports by folder name \(case-insensitive partial match\) |
724-
| `searchTerm` | string | No | Search term to filter reports by name or description |
728+
| `searchTerm` | string | No | Filter reports by name \(case-insensitive partial match\) |
725729

726730
#### Output
727731

@@ -735,7 +739,7 @@ Get a list of reports accessible by the current user
735739

736740
### `salesforce_get_report`
737741

738-
Get metadata and describe information for a specific report
742+
Get the describe (definition and metadata) for a specific report
739743

740744
#### Input
741745

@@ -818,7 +822,6 @@ Get a list of dashboards accessible by the current user
818822
| --------- | ---- | -------- | ----------- |
819823
| `idToken` | string | No | No description |
820824
| `instanceUrl` | string | No | No description |
821-
| `folderName` | string | No | Filter dashboards by folder name \(case-insensitive partial match\) |
822825

823826
#### Output
824827

@@ -852,7 +855,7 @@ Get details and results for a specific dashboard
852855
|`dashboardId` | string | Dashboard ID |
853856
|`components` | array | Array of dashboard component data with visualizations and filters |
854857
|`dashboardName` | string | Display name of the dashboard |
855-
|`folderId` | string | ID of the folder containing the dashboard |
858+
|`dashboardMetadata` | object | Structured dashboard metadata \(attributes, component definitions, layout\) |
856859
|`runningUser` | object | User context under which the dashboard data was retrieved |
857860
|`success` | boolean | Salesforce operation success |
858861

@@ -877,9 +880,10 @@ Refresh a dashboard to get the latest data
877880
|`dashboard` | object | Full dashboard details object |
878881
|`dashboardId` | string | Dashboard ID |
879882
|`components` | array | Array of dashboard component data with fresh visualizations |
880-
|`status` | object | Dashboard refresh status information |
883+
|`status` | object | Dashboard refresh status \(dashboardStatus\), when returned by the refresh |
884+
|`statusUrl` | string | URL of the status resource to poll for refresh completion |
881885
|`dashboardName` | string | Display name of the dashboard |
882-
|`refreshDate` | string | ISO 8601 timestamp when the dashboard was last refreshed |
886+
|`dashboardMetadata` | object | Structured dashboard metadata \(attributes, component definitions, layout\) |
883887
|`success` | boolean | Salesforce operation success |
884888

885889
### `salesforce_query`

0 commit comments

Comments
 (0)