improvement(apollo): align tools and block with Apollo API docs#4487
improvement(apollo): align tools and block with Apollo API docs#4487waleedlatif1 wants to merge 22 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
PR SummaryMedium Risk Overview Updates several tool endpoints and payload/response handling: people enrich/bulk enrich now pass reveal flags via querystring and return richer enrichment stats; org enrich now requires Improves robustness and backward compatibility by trimming IDs in URLs, normalizing outputs to arrays/nullables, adding dedupe/label options for bulk creates, revising account/contact bulk update inputs (IDs vs attributes + async), and adding Apollo-specific subblock param migrations/remapping plus safer JSON parsing in the block. Reviewed by Cursor Bugbot for commit 4521402. Configure here. |
Greptile SummaryThis PR aligns all 25 Apollo tools and the Apollo block with the official Apollo API, fixing endpoint paths, field names, body shapes, and adding documented optional fields across search, create, and update operations. Several correctness issues surfaced in prior review rounds have been resolved, including missing sub-block migrations, silent param drops, empty-body guard gaps, and a query-param POST with no body.
Confidence Score: 5/5Safe to merge — all identified correctness issues from prior rounds are resolved and the new validation guards are complete. The changes are well-scoped API alignment work: field renames, endpoint corrections, guard additions, and migration entries. All gaps flagged in previous review rounds (missing remaps, silent param drops, empty-body paths, migration collisions) have been addressed in subsequent commits. The bulk-update guard logic in both contact and account tools has been verified across every combination of inputs. Sub-block migrations are consistent with the renamed fields. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Apollo Block params fn] --> B{operation?}
B -->|contact_bulk_update| C[splitBulkUpdateInput contacts]
B -->|account_bulk_update| D[splitBulkUpdateInput accounts]
B -->|task_create| E[remap task_notes → note]
B -->|opportunity_create/update| F[remap opportunity_name → name]
B -->|sequence_add| G[remap sequence_add_label_names → label_names]
C --> C1{attributes present?}
C1 -->|yes| C2[merge ids into attributes array → contact_attributes]
C1 -->|no| C3[ids → contact_ids]
D --> D1{attributes present?}
D1 -->|yes| D2[merge ids into attributes array → account_attributes]
D1 -->|no| D3[ids → account_ids]
C2 --> T[Tool body fn]
C3 --> T
D2 --> T
D3 --> T
E --> T
F --> T
G --> T
T --> V{Validation guards}
V -->|contact: no contact_attributes| ERR1[throw - missing attributes]
V -->|contact: object attrs + no ids| ERR2[throw - need contact_ids]
V -->|account: no update fields| ERR3[throw - missing update fields]
V -->|account: object attrs + no ids| ERR4[throw - need account_ids]
V -->|sequence: no ids + no labels| ERR5[throw - need identifier]
V -->|pass| API[Apollo API call]
Reviews (14): Last reviewed commit: "fix(apollo): drop colliding account_ids ..." | Re-trigger Greptile |
e59ab46 to
7447852
Compare
|
@greptile |
|
@cursor review |
|
bugbot run |
|
@cursor review |
|
@greptile |
Final pass over the Apollo integration after a per-tool forensic audit
against Apollo.io docs. Notable fixes:
- organization_enrich: GET+querystring -> POST+JSON body (canonical, non
master-key)
- organization_bulk_enrich: ?domains[]= -> JSON body { organizations }
- people_search: declare/forward organization_num_employees_ranges; fix
contact_email_status placeholder ("likely to engage", with spaces)
- account_bulk_create: surface failed_accounts and failed count
- contact_bulk_create: expand documented per-contact fields (CRM IDs,
phone_numbers, contact_emails, typed_custom_fields, etc.)
- sequence_add_contacts: surface remaining documented filter params
- task_create: confirm wire field name (note) and remap from task_notes
- types: tighten params/responses for the above
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
|
@greptile |
|
@cursor review |
|
@cursor review |
|
@greptile |
…lk limit, expose async toggle for accounts
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4521402. Configure here.
| if (Array.isArray(params.account_attributes)) { | ||
| if (params.account_attributes.length > 0) { | ||
| body.account_attributes = params.account_attributes | ||
| } |
There was a problem hiding this comment.
Missing array size limit on account_attributes in bulk update
Medium Severity
The array-form account_attributes is sent to Apollo without any .slice() cap, while account_ids is capped at 1000 (line 70) and contact_attributes in the sibling contact_bulk_update tool is capped at 100 (line 62). The tool description states a 1000-account limit, so exceeding it could cause Apollo API errors or unexpected behavior.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 4521402. Configure here.


Summary
Type of Change
Testing
Tested manually. Lint and typecheck pass.
Checklist