Skip to content

feat(gong): align tools with official API spec + 4 new tools#5632

Merged
waleedlatif1 merged 3 commits into
stagingfrom
feat/gong-api-validation
Jul 13, 2026
Merged

feat(gong): align tools with official API spec + 4 new tools#5632
waleedlatif1 merged 3 commits into
stagingfrom
feat/gong-api-validation

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • Validated all 25 Gong tools, the block, and both webhook triggers against Gong's official OpenAPI v2 spec
  • Fixed gong_list_flows — it sent flowEmailOwner (a typo in Gong's own endpoint prose) instead of the required flowOwnerEmail query param, so the tool failed on every call
  • create_call: removed the phantom url output (the API returns only requestId/callId) and made downloadMediaUrl optional to match the spec
  • list_scorecards: refreshed to the current spec — numeric IDs, new question fields (questionType, answerGuide, minRange, maxRange, answerOptions), and reviewMethod
  • answered_scorecards: now maps selectedOptions on answers; corrected score range description (1–50)
  • Surfaced requestId uniformly across all read tools; totalRecords is no longer fabricated from page size when missing
  • Hardened inputs: strict boolean includeAvatars, uppercased aggregationPeriod, URL-encoded userId path param, and email/phone format checks before the irreversible GDPR purge endpoints
  • Added 4 new tools from the coverage audit: gong_ask_anything and gong_get_brief (Gong's AI entity Q&A/brief endpoints — flagged as credit-consuming), gong_unassign_flow_prospects (inverse of the existing assign tool), and gong_get_logs
  • No OAuth changes — Gong is API-key (Basic auth) only; no scopes exist or were added

Type of Change

  • Bug fix
  • New feature

Testing

Typecheck and lint clean; Gong webhook provider tests pass (9/9). Every endpoint, param name, and response field was cross-checked against the official Gong OpenAPI spec.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

…ef, unassign, and logs tools

- fix gong_list_flows: query param was flowEmailOwner (typo copied from Gong's endpoint prose); the API requires flowOwnerEmail, so every call failed
- create_call: drop phantom url output (API returns only requestId/callId) and make downloadMediaUrl optional per spec
- list_scorecards: refresh to current spec (numeric IDs, questionType/answerGuide/minRange/maxRange/answerOptions, reviewMethod)
- answered_scorecards: map selectedOptions on answers, correct score range description (1-50)
- surface requestId uniformly across all read tools; totalRecords no longer fabricated from page size
- normalize includeAvatars to a strict boolean param, uppercase aggregationPeriod, encode userId path param
- validate email/phone format before irreversible GDPR purge calls
- new tools: gong_ask_anything, gong_get_brief (AI entity Q&A/briefs), gong_unassign_flow_prospects, gong_get_logs
@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
docs Ready Ready Preview, Comment Jul 13, 2026 6:12pm

Request Review

@cursor

cursor Bot commented Jul 13, 2026

Copy link
Copy Markdown

PR Summary

Medium Risk
Touches many Gong API surfaces including irreversible purge validation and credit-consuming AI endpoints; the list_flows query-param fix changes runtime behavior for workflows that relied on the broken param.

Overview
Brings the Gong block, tools, docs, and integrations.json in line with Gong OpenAPI v2 and expands coverage from 25 to 29 operations.

New capabilities: gong_ask_anything and gong_get_brief (credit-consuming AI over CRM entities), gong_unassign_flow_prospects, and gong_get_logs, with matching UI sub-blocks and operation-scoped param mapping so values from other operations do not leak into requests.

Breaking / behavior fixes: gong_list_flows now sends flowOwnerEmail instead of the incorrect flowEmailOwner query param. gong_create_call drops the non-API url output and treats downloadMediaUrl as optional. Scorecard and answered-scorecard shapes are updated (numeric IDs, selectedOptions, score range 1–50, richer question metadata). requestId is returned consistently on read tools; totalRecords is no longer guessed from page size when absent.

Hardening: URL-encoded call/user IDs, strict includeAvatars=true, uppercased aggregationPeriod, optional folderId for folder content, pre-flight validation on GDPR purge email/phone, and tightened extensive-calls interactionStats documentation/shape.

Reviewed by Cursor Bugbot for commit f95748c. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR aligns the Gong integration with the current API shape and adds more Gong operations. The main changes are:

  • Updated Gong tool inputs, outputs, and response mappings.
  • Added Ask Anything, Get Brief, Get Logs, and Unassign Flow Prospects.
  • Added custom-range date validation for credit-consuming AI requests.
  • Refreshed the Gong block, docs, and integration metadata.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/blocks/blocks/gong.ts Adds new Gong operations, maps operation-specific fields, and requires custom-range dates for the AI tools.
apps/sim/tools/gong/ask_anything.ts Adds the Gong AI question tool with local validation before building custom-range requests.
apps/sim/tools/gong/get_brief.ts Adds the Gong AI brief tool with matching custom-range date validation.
apps/sim/tools/gong/create_call.ts Updates create-call output to match Gong's response fields.
apps/sim/tools/gong/get_logs.ts Adds a Gong logs retrieval tool with pagination metadata.

Reviews (3): Last reviewed commit: "fix(gong): final spec-alignment pass, re..." | Re-trigger Greptile

Comment thread apps/sim/blocks/blocks/gong.ts
Comment thread apps/sim/tools/gong/create_call.ts
Comment thread apps/sim/tools/gong/list_calls.ts
Comment thread apps/sim/blocks/blocks/gong.ts Outdated
…ration

- ask_anything/get_brief: entityFromDateTime/entityToDateTime now conditionally required (UI) and validated tool-side when timePeriod is CUSTOM_RANGE
- block params mapper: remaps are gated by the selected operation so stale values from previously configured operations can no longer overwrite fromDateTime/fromDate/workspaceId
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

Comment thread apps/sim/tools/gong/ask_anything.ts Outdated
Comment thread apps/sim/tools/gong/unassign_flow_prospects.ts
- ask_anything/get_brief: send fromDateTime/toDateTime only for CUSTOM_RANGE; declare mcpResult brief section field
- unassign: dedicated optional unassignFlowId subblock so a stale assign-flow ID can never silently narrow an unassign to one flow
- get_logs: logType is a closed enum (AccessLog, UserActivityLog, UserCallPlay, ExternallySharedCallAccess, ExternallySharedCallPlay) - dropdown in block, enumerated in tool description
- get_folder_content: folderId optional per spec; get_call: encode callId path param
- list_trackers: drop saidInCallParts (absent from the spec's KeywordTracker schema)
- get_extensive_calls: correct declared interactionStats item shape to {name, value}
- block inputs: list all remapped subblock params; optional flags on nullable outputs; absolute types re-export
- regenerate Gong integration docs and integrations.json entries (29 operations)
@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit f95748c. Configure here.

@waleedlatif1 waleedlatif1 merged commit b1bd2b5 into staging Jul 13, 2026
18 checks passed
@waleedlatif1 waleedlatif1 deleted the feat/gong-api-validation branch July 13, 2026 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant