mirror of
https://github.com/simstudioai/sim.git
synced 2026-09-24 15:45:35 +08:00
feat(gong): align tools with official API spec + 4 new tools (#5632)
* feat(gong): align tools with official API spec, add ask-anything, brief, 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
* fix(gong): require custom-range dates and gate param remapping by operation
- 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
* fix(gong): final spec-alignment pass, review fixes, and regenerated docs
- 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)
This commit is contained in:
@@ -98,7 +98,7 @@ Upload call metadata to Gong and let Gong pull the media from a URL.
|
||||
| `primaryUser` | string | Yes | Gong user ID for the call's host or owner |
|
||||
| `parties` | json | Yes | Array of call parties, with at least the primary user included |
|
||||
| `direction` | string | Yes | Call direction: Inbound, Outbound, Conference, or Unknown |
|
||||
| `downloadMediaUrl` | string | Yes | URL where Gong can download the call media file |
|
||||
| `downloadMediaUrl` | string | No | URL where Gong can download the call media file. If omitted, the call is created without media and Gong waits for a separate media upload. |
|
||||
| `title` | string | No | Human-readable call title |
|
||||
| `workspaceId` | string | No | Optional Gong workspace ID |
|
||||
| `disposition` | string | No | Optional call disposition |
|
||||
@@ -112,7 +112,6 @@ Upload call metadata to Gong and let Gong pull the media from a URL.
|
||||
| --------- | ---- | ----------- |
|
||||
| `callId` | string | Gong's unique numeric identifier for the created call |
|
||||
| `requestId` | string | Gong request reference ID for troubleshooting |
|
||||
| `url` | string | URL to the created call in the Gong web app |
|
||||
|
||||
### `gong_get_call`
|
||||
|
||||
@@ -130,6 +129,7 @@ Retrieve detailed data for a specific call from Gong.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `id` | string | Gong's unique numeric identifier for the call |
|
||||
| `title` | string | Call title |
|
||||
| `url` | string | URL to the call in the Gong web app |
|
||||
@@ -171,6 +171,7 @@ Retrieve transcripts of calls from Gong by call IDs or date range.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `callTranscripts` | array | List of call transcripts with speaker turns and sentences |
|
||||
| ↳ `callId` | string | Gong's unique numeric identifier for the call |
|
||||
| ↳ `transcript` | array | List of monologues in the call |
|
||||
@@ -203,6 +204,7 @@ Retrieve detailed call data including trackers, topics, highlights, and AI spotl
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `calls` | array | List of detailed call objects with metadata, content, interaction stats, and collaboration data |
|
||||
| ↳ `metaData` | object | Call metadata \(same fields as CallBasicData\) |
|
||||
| ↳ `id` | string | Call ID |
|
||||
@@ -272,12 +274,9 @@ Retrieve detailed call data including trackers, topics, highlights, and AI spotl
|
||||
| ↳ `highlights` | array | AI-generated highlights including next steps, action items, and key moments |
|
||||
| ↳ `title` | string | Title of the highlight |
|
||||
| ↳ `interaction` | object | Interaction statistics |
|
||||
| ↳ `interactionStats` | array | Interaction stats per user |
|
||||
| ↳ `userId` | string | Gong user ID |
|
||||
| ↳ `userEmailAddress` | string | User email |
|
||||
| ↳ `personInteractionStats` | array | Stats list \(Longest Monologue, Interactivity, Patience, etc.\) |
|
||||
| ↳ `name` | string | Stat name |
|
||||
| ↳ `value` | number | Stat value |
|
||||
| ↳ `interactionStats` | array | Interaction stat measurements \(Longest Monologue, Interactivity, Patience, etc.\) |
|
||||
| ↳ `name` | string | Stat name |
|
||||
| ↳ `value` | number | Stat value |
|
||||
| ↳ `speakers` | array | Talk duration per speaker |
|
||||
| ↳ `id` | string | Participant ID |
|
||||
| ↳ `userId` | string | Gong user ID |
|
||||
@@ -368,6 +367,7 @@ Retrieve details for a specific user from Gong.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `id` | string | Unique numeric user ID \(up to 20 digits\) |
|
||||
| `emailAddress` | string | User email address |
|
||||
| `created` | string | User creation timestamp \(ISO-8601\) |
|
||||
@@ -413,6 +413,7 @@ Retrieve aggregated activity statistics for users by date range from Gong.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `usersActivity` | array | Aggregated activity statistics per user |
|
||||
| ↳ `userId` | string | Gong's unique numeric identifier for the user |
|
||||
| ↳ `userEmailAddress` | string | Email address of the Gong user |
|
||||
@@ -542,6 +543,7 @@ Retrieve interaction statistics for users by date range from Gong. Only includes
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `peopleInteractionStats` | array | Interaction statistics per user. Applicable stat names: 'Longest Monologue', 'Longest Customer Story', 'Interactivity', 'Patience', 'Question Rate'. |
|
||||
| ↳ `userId` | string | Gong's unique numeric identifier for the user |
|
||||
| ↳ `userEmailAddress` | string | Email address of the Gong user |
|
||||
@@ -575,6 +577,7 @@ Retrieve answered scorecards for reviewed users or by date range from Gong.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `answeredScorecards` | array | List of answered scorecards with scores and answers |
|
||||
| ↳ `answeredScorecardId` | number | Identifier of the answered scorecard |
|
||||
| ↳ `scorecardId` | number | Identifier of the scorecard |
|
||||
@@ -589,9 +592,10 @@ Retrieve answered scorecards for reviewed users or by date range from Gong.
|
||||
| ↳ `questionId` | number | Identifier of the question |
|
||||
| ↳ `questionRevisionId` | number | Identifier of the revision version of the question |
|
||||
| ↳ `isOverall` | boolean | Whether this is the overall question |
|
||||
| ↳ `score` | number | Score between 1 to 5 if answered, null otherwise |
|
||||
| ↳ `score` | number | Score between 1 to 50 if answered, null otherwise |
|
||||
| ↳ `answerText` | string | The answer's text if answered, null otherwise |
|
||||
| ↳ `notApplicable` | boolean | Whether the question is not applicable to this call |
|
||||
| ↳ `selectedOptions` | array | Identifiers of the options selected for select-type questions, null otherwise |
|
||||
| `cursor` | string | Pagination cursor for the next page |
|
||||
|
||||
### `gong_list_library_folders`
|
||||
@@ -610,6 +614,7 @@ Retrieve library folders from Gong.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `folders` | array | List of library folders with id, name, and parent relationships |
|
||||
| ↳ `id` | string | Gong unique numeric identifier for the folder |
|
||||
| ↳ `name` | string | Display name of the folder |
|
||||
@@ -627,12 +632,13 @@ Retrieve the list of calls in a specific library folder from Gong.
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `accessKey` | string | Yes | Gong API Access Key |
|
||||
| `accessKeySecret` | string | Yes | Gong API Access Key Secret |
|
||||
| `folderId` | string | Yes | The library folder ID to retrieve content for |
|
||||
| `folderId` | string | No | The library folder ID to retrieve content for \(up to 20 digits\) |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `folderId` | string | Gong's unique numeric identifier for the folder |
|
||||
| `folderName` | string | Display name of the folder |
|
||||
| `createdBy` | string | Gong's unique numeric identifier for the user who added the folder |
|
||||
@@ -663,22 +669,28 @@ Retrieve scorecard definitions from Gong settings.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `scorecards` | array | List of scorecard definitions with questions |
|
||||
| ↳ `scorecardId` | string | Unique identifier for the scorecard |
|
||||
| ↳ `scorecardId` | number | Unique identifier for the scorecard |
|
||||
| ↳ `scorecardName` | string | Display name of the scorecard |
|
||||
| ↳ `workspaceId` | string | Workspace identifier associated with this scorecard |
|
||||
| ↳ `workspaceId` | number | Workspace identifier associated with this scorecard |
|
||||
| ↳ `enabled` | boolean | Whether the scorecard is active |
|
||||
| ↳ `updaterUserId` | string | ID of the user who last modified the scorecard |
|
||||
| ↳ `updaterUserId` | number | ID of the user who last modified the scorecard |
|
||||
| ↳ `created` | string | Creation timestamp in ISO-8601 format |
|
||||
| ↳ `updated` | string | Last update timestamp in ISO-8601 format |
|
||||
| ↳ `reviewMethod` | string | Review method configured for the scorecard |
|
||||
| ↳ `questions` | array | List of questions in the scorecard |
|
||||
| ↳ `questionId` | string | Unique identifier for the question |
|
||||
| ↳ `questionId` | number | Unique identifier for the question |
|
||||
| ↳ `questionRevisionId` | number | Identifier for the specific revision of the question |
|
||||
| ↳ `questionText` | string | The text content of the question |
|
||||
| ↳ `questionRevisionId` | string | Identifier for the specific revision of the question |
|
||||
| ↳ `isOverall` | boolean | Whether this is the primary overall question |
|
||||
| ↳ `created` | string | Question creation timestamp in ISO-8601 format |
|
||||
| ↳ `updated` | string | Question last update timestamp in ISO-8601 format |
|
||||
| ↳ `updaterUserId` | string | ID of the user who last modified the question |
|
||||
| ↳ `questionType` | string | The type of the question \(e.g. range or select\) |
|
||||
| ↳ `answerGuide` | string | Guidance text describing how to answer the question |
|
||||
| ↳ `minRange` | number | Minimum score for range-type questions |
|
||||
| ↳ `maxRange` | number | Maximum score for range-type questions |
|
||||
| ↳ `answerOptions` | array | Selectable options for select-type questions |
|
||||
| ↳ `id` | number | Identifier of the option |
|
||||
| ↳ `text` | string | Display text of the option |
|
||||
|
||||
### `gong_list_trackers`
|
||||
|
||||
@@ -696,6 +708,7 @@ Retrieve smart tracker and keyword tracker definitions from Gong settings.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `trackers` | array | List of keyword tracker definitions |
|
||||
| ↳ `trackerId` | string | Unique identifier for the tracker |
|
||||
| ↳ `trackerName` | string | Display name of the tracker |
|
||||
@@ -710,7 +723,6 @@ Retrieve smart tracker and keyword tracker definitions from Gong settings.
|
||||
| ↳ `saidAtInterval` | number | Duration to search \(in minutes or percentage\) |
|
||||
| ↳ `saidAtUnit` | string | Unit for saidAtInterval |
|
||||
| ↳ `saidInTopics` | array | Topics where keywords should be detected |
|
||||
| ↳ `saidInCallParts` | array | Specific call segments to monitor |
|
||||
| ↳ `filterQuery` | string | JSON-formatted call filtering criteria |
|
||||
| ↳ `created` | string | Creation timestamp in ISO-8601 format |
|
||||
| ↳ `creatorUserId` | string | ID of the user who created the tracker \(null for built-in trackers\) |
|
||||
@@ -732,6 +744,7 @@ List all company workspaces in Gong.
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `workspaces` | array | List of Gong workspaces |
|
||||
| ↳ `id` | string | Gong unique numeric identifier for the workspace |
|
||||
| ↳ `name` | string | Display name of the workspace |
|
||||
@@ -805,6 +818,27 @@ Assign up to 200 CRM prospects (contacts or leads) to a Gong Engage flow.
|
||||
| ↳ `errorCode` | string | Failure reason: InvalidArgument, InvalidState, or UnexpectedError |
|
||||
| ↳ `errorMessage` | string | Human-readable failure message |
|
||||
|
||||
### `gong_unassign_flow_prospects`
|
||||
|
||||
Remove a prospect from Gong Engage flows. Omit the flow ID to remove the prospect from all flows they are assigned to.
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `accessKey` | string | Yes | Gong API Access Key |
|
||||
| `accessKeySecret` | string | Yes | Gong API Access Key Secret |
|
||||
| `crmProspectId` | string | Yes | The CRM ID of the prospect to unassign |
|
||||
| `flowId` | string | No | The ID of the flow to unassign the prospect from. If omitted, the prospect is removed from all flows they are assigned to. |
|
||||
| `unassignedByUserEmail` | string | No | Email address of the Gong user requesting to remove the prospect from the flow |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `unassignedFlowInstanceIds` | array | IDs of the flow instances the prospect was successfully removed from |
|
||||
|
||||
### `gong_get_prospect_flows`
|
||||
|
||||
Get the Gong Engage flows currently assigned to the given CRM prospects.
|
||||
@@ -870,6 +904,104 @@ Retrieve coaching metrics for a manager from Gong.
|
||||
| ↳ `title` | string | Job title of the Gong user |
|
||||
| ↳ `metrics` | json | A map of metric names to arrays of string values representing coaching metrics |
|
||||
|
||||
### `gong_ask_anything`
|
||||
|
||||
Ask a natural-language question about a CRM account, deal, contact, or lead. Gong answers from up to 60 calls and 500 emails associated with the entity. Consumes Gong credits.
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `accessKey` | string | Yes | Gong API Access Key |
|
||||
| `accessKeySecret` | string | Yes | Gong API Access Key Secret |
|
||||
| `workspaceId` | string | Yes | Gong workspace ID the entity belongs to |
|
||||
| `crmEntityType` | string | Yes | Type of the CRM entity: ACCOUNT, CONTACT, DEAL, or LEAD |
|
||||
| `crmEntityId` | string | Yes | The CRM ID of the entity the question is asked about |
|
||||
| `question` | string | Yes | The natural-language question to ask about the entity |
|
||||
| `timePeriod` | string | Yes | Time period of conversations to consider: LAST_7DAYS, LAST_30DAYS, LAST_90DAYS, LAST_90_DAYS_SINCE_LAST_ACTIVITY, LAST_YEAR_SINCE_LAST_ACTIVITY, LAST_YEAR, THIS_WEEK, THIS_MONTH, THIS_YEAR, THIS_QUARTER, CUSTOM_RANGE, or ALL_CONVERSATIONS |
|
||||
| `fromDateTime` | string | No | Start date/time \(UTC, ISO-8601\) for calls and emails to include. Required when timePeriod is CUSTOM_RANGE. |
|
||||
| `toDateTime` | string | No | End date/time \(UTC, ISO-8601\) for calls and emails to include. Required when timePeriod is CUSTOM_RANGE. |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `numOfCallsSearched` | number | Number of calls used to generate the answer |
|
||||
| `numOfEmailsSearched` | number | Number of emails used to generate the answer |
|
||||
| `answer` | array | Sections of the generated answer with supporting evidence |
|
||||
| ↳ `answerItems` | array | Text items that make up this part of the answer |
|
||||
| ↳ `callFindings` | array | Evidence from calls used to generate this answer item |
|
||||
| ↳ `emailFindings` | array | Evidence from emails used to generate this answer item |
|
||||
|
||||
### `gong_get_brief`
|
||||
|
||||
Generate an AI brief (configured in Gong Agent Studio) for a CRM account, deal, contact, or lead. Consumes Gong credits.
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `accessKey` | string | Yes | Gong API Access Key |
|
||||
| `accessKeySecret` | string | Yes | Gong API Access Key Secret |
|
||||
| `workspaceId` | string | Yes | Gong workspace ID the entity belongs to |
|
||||
| `briefName` | string | Yes | Name of the brief to generate, as configured in Gong Agent Studio > AI Briefer |
|
||||
| `crmEntityType` | string | Yes | Type of the CRM entity: ACCOUNT, CONTACT, DEAL, or LEAD |
|
||||
| `crmEntityId` | string | Yes | The CRM ID of the entity to generate the brief for |
|
||||
| `timePeriod` | string | Yes | Time period of conversations to consider: LAST_7DAYS, LAST_30DAYS, LAST_90DAYS, LAST_90_DAYS_SINCE_LAST_ACTIVITY, LAST_YEAR_SINCE_LAST_ACTIVITY, LAST_YEAR, THIS_WEEK, THIS_MONTH, THIS_YEAR, THIS_QUARTER, CUSTOM_RANGE, or ALL_CONVERSATIONS |
|
||||
| `fromDateTime` | string | No | Start date/time \(UTC, ISO-8601\) for calls and emails to include. Required when timePeriod is CUSTOM_RANGE. |
|
||||
| `toDateTime` | string | No | End date/time \(UTC, ISO-8601\) for calls and emails to include. Required when timePeriod is CUSTOM_RANGE. |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `numOfCallsSearched` | number | Number of calls used to generate the brief |
|
||||
| `numOfEmailsSearched` | number | Number of emails used to generate the brief |
|
||||
| `briefSections` | array | Sections of the generated brief |
|
||||
| ↳ `title` | string | Section title |
|
||||
| ↳ `sectionSummary` | array | The content displayed for this section |
|
||||
| ↳ `briefSectionType` | string | The section type, which determines the source of the data |
|
||||
| ↳ `conversationFindings` | object | Evidence from calls and emails used to generate this section |
|
||||
| ↳ `webFindings` | array | Evidence from web search results used to generate this section |
|
||||
| ↳ `mcpResult` | object | Result from an MCP data source used to generate this section |
|
||||
|
||||
### `gong_get_logs`
|
||||
|
||||
Retrieve Gong log entries of a specific type within a time range.
|
||||
|
||||
#### Input
|
||||
|
||||
| Parameter | Type | Required | Description |
|
||||
| --------- | ---- | -------- | ----------- |
|
||||
| `accessKey` | string | Yes | Gong API Access Key |
|
||||
| `accessKeySecret` | string | Yes | Gong API Access Key Secret |
|
||||
| `logType` | string | Yes | Type of logs requested: AccessLog, UserActivityLog, UserCallPlay, ExternallySharedCallAccess, or ExternallySharedCallPlay |
|
||||
| `fromDateTime` | string | Yes | Time from which to retrieve log records, in ISO-8601 format \(e.g., '2024-01-01T00:00:00Z'\) |
|
||||
| `toDateTime` | string | No | Time until which to retrieve log records, in ISO-8601 format. Defaults to the latest available logs when omitted. |
|
||||
| `cursor` | string | No | Pagination cursor from a previous response |
|
||||
|
||||
#### Output
|
||||
|
||||
| Parameter | Type | Description |
|
||||
| --------- | ---- | ----------- |
|
||||
| `requestId` | string | A Gong request reference ID for troubleshooting purposes |
|
||||
| `logEntries` | array | Log entries matching the requested type and time range |
|
||||
| ↳ `userId` | string | Gong's unique numeric identifier for the user, if available |
|
||||
| ↳ `userEmailAddress` | string | Email address of the user, if available |
|
||||
| ↳ `userFullName` | string | Full name of the user, if available |
|
||||
| ↳ `impersonatorUserId` | string | Gong's unique numeric identifier for the impersonating user, if any |
|
||||
| ↳ `impersonatorEmailAddress` | string | Email address of the impersonating user, if any |
|
||||
| ↳ `impersonatorFullName` | string | Full name of the impersonating user, if any |
|
||||
| ↳ `impersonatorCompanyId` | string | Gong's unique numeric identifier for the impersonating user's company |
|
||||
| ↳ `eventTime` | string | Time of the event in ISO-8601 format |
|
||||
| ↳ `logRecord` | object | Log fields and associated values, populated dynamically per log type |
|
||||
| `cursor` | string | Pagination cursor for the next page |
|
||||
| `totalRecords` | number | Total number of records matching the filter |
|
||||
| `currentPageSize` | number | Number of records in the current page |
|
||||
| `currentPageNumber` | number | Current page number |
|
||||
|
||||
### `gong_lookup_email`
|
||||
|
||||
Find all references to an email address in Gong (calls, email messages, meetings, CRM data, engagement).
|
||||
|
||||
+327
-16
@@ -44,8 +44,12 @@ export const GongBlock: BlockConfig<GongResponse> = {
|
||||
{ label: 'List Workspaces', id: 'list_workspaces' },
|
||||
{ label: 'List Flows', id: 'list_flows' },
|
||||
{ label: 'Assign Flow Prospects', id: 'assign_flow_prospects' },
|
||||
{ label: 'Unassign Flow Prospects', id: 'unassign_flow_prospects' },
|
||||
{ label: 'Get Prospect Flows', id: 'get_prospect_flows' },
|
||||
{ label: 'Get Coaching', id: 'get_coaching' },
|
||||
{ label: 'Ask Anything', id: 'ask_anything' },
|
||||
{ label: 'Get Brief', id: 'get_brief' },
|
||||
{ label: 'Get Logs', id: 'get_logs' },
|
||||
{ label: 'Lookup Email', id: 'lookup_email' },
|
||||
{ label: 'Lookup Phone', id: 'lookup_phone' },
|
||||
{ label: 'Purge Email Address', id: 'purge_email_address' },
|
||||
@@ -124,7 +128,6 @@ Return ONLY the JSON array - no explanations, no quotes, no extra text.`,
|
||||
type: 'short-input',
|
||||
placeholder: 'https://example.com/call-recording.mp3',
|
||||
condition: { field: 'operation', value: 'create_call' },
|
||||
required: { field: 'operation', value: 'create_call' },
|
||||
},
|
||||
{
|
||||
id: 'title',
|
||||
@@ -548,9 +551,8 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`,
|
||||
id: 'folderId',
|
||||
title: 'Folder ID',
|
||||
type: 'short-input',
|
||||
placeholder: 'Enter the library folder ID',
|
||||
placeholder: 'Library folder ID (optional)',
|
||||
condition: { field: 'operation', value: 'get_folder_content' },
|
||||
required: { field: 'operation', value: 'get_folder_content' },
|
||||
},
|
||||
|
||||
// Workspace ID (shared by multiple operations)
|
||||
@@ -593,6 +595,29 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`,
|
||||
condition: { field: 'operation', value: 'assign_flow_prospects' },
|
||||
required: { field: 'operation', value: 'assign_flow_prospects' },
|
||||
},
|
||||
{
|
||||
id: 'crmProspectId',
|
||||
title: 'CRM Prospect ID',
|
||||
type: 'short-input',
|
||||
placeholder: 'CRM contact or lead ID to unassign',
|
||||
condition: { field: 'operation', value: 'unassign_flow_prospects' },
|
||||
required: { field: 'operation', value: 'unassign_flow_prospects' },
|
||||
},
|
||||
{
|
||||
id: 'unassignFlowId',
|
||||
title: 'Flow ID',
|
||||
type: 'short-input',
|
||||
placeholder: 'Specific flow to unassign from (omit for all flows)',
|
||||
condition: { field: 'operation', value: 'unassign_flow_prospects' },
|
||||
},
|
||||
{
|
||||
id: 'unassignedByUserEmail',
|
||||
title: 'Unassigned By User Email',
|
||||
type: 'short-input',
|
||||
placeholder: 'user@example.com (optional)',
|
||||
condition: { field: 'operation', value: 'unassign_flow_prospects' },
|
||||
mode: 'advanced',
|
||||
},
|
||||
{
|
||||
id: 'crmProspectsIds',
|
||||
title: 'CRM Prospect IDs',
|
||||
@@ -676,6 +701,177 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes
|
||||
},
|
||||
},
|
||||
|
||||
// Ask Anything / Get Brief inputs
|
||||
{
|
||||
id: 'entityWorkspaceId',
|
||||
title: 'Workspace ID',
|
||||
type: 'short-input',
|
||||
placeholder: 'Gong workspace ID',
|
||||
condition: { field: 'operation', value: ['ask_anything', 'get_brief'] },
|
||||
required: { field: 'operation', value: ['ask_anything', 'get_brief'] },
|
||||
},
|
||||
{
|
||||
id: 'crmEntityType',
|
||||
title: 'CRM Entity Type',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Account', id: 'ACCOUNT' },
|
||||
{ label: 'Contact', id: 'CONTACT' },
|
||||
{ label: 'Deal', id: 'DEAL' },
|
||||
{ label: 'Lead', id: 'LEAD' },
|
||||
],
|
||||
value: () => 'ACCOUNT',
|
||||
condition: { field: 'operation', value: ['ask_anything', 'get_brief'] },
|
||||
required: { field: 'operation', value: ['ask_anything', 'get_brief'] },
|
||||
},
|
||||
{
|
||||
id: 'crmEntityId',
|
||||
title: 'CRM Entity ID',
|
||||
type: 'short-input',
|
||||
placeholder: 'CRM ID of the account, contact, deal, or lead',
|
||||
condition: { field: 'operation', value: ['ask_anything', 'get_brief'] },
|
||||
required: { field: 'operation', value: ['ask_anything', 'get_brief'] },
|
||||
},
|
||||
{
|
||||
id: 'question',
|
||||
title: 'Question',
|
||||
type: 'long-input',
|
||||
placeholder: 'What are the main objections raised by this account?',
|
||||
condition: { field: 'operation', value: 'ask_anything' },
|
||||
required: { field: 'operation', value: 'ask_anything' },
|
||||
},
|
||||
{
|
||||
id: 'briefName',
|
||||
title: 'Brief Name',
|
||||
type: 'short-input',
|
||||
placeholder: 'Brief name configured in Gong Agent Studio',
|
||||
condition: { field: 'operation', value: 'get_brief' },
|
||||
required: { field: 'operation', value: 'get_brief' },
|
||||
},
|
||||
{
|
||||
id: 'timePeriod',
|
||||
title: 'Time Period',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Last 7 days', id: 'LAST_7DAYS' },
|
||||
{ label: 'Last 30 days', id: 'LAST_30DAYS' },
|
||||
{ label: 'Last 90 days', id: 'LAST_90DAYS' },
|
||||
{ label: 'Last 90 days since last activity', id: 'LAST_90_DAYS_SINCE_LAST_ACTIVITY' },
|
||||
{ label: 'Last year since last activity', id: 'LAST_YEAR_SINCE_LAST_ACTIVITY' },
|
||||
{ label: 'Last year', id: 'LAST_YEAR' },
|
||||
{ label: 'This week', id: 'THIS_WEEK' },
|
||||
{ label: 'This month', id: 'THIS_MONTH' },
|
||||
{ label: 'This quarter', id: 'THIS_QUARTER' },
|
||||
{ label: 'This year', id: 'THIS_YEAR' },
|
||||
{ label: 'Custom range', id: 'CUSTOM_RANGE' },
|
||||
{ label: 'All conversations', id: 'ALL_CONVERSATIONS' },
|
||||
],
|
||||
value: () => 'LAST_30DAYS',
|
||||
condition: { field: 'operation', value: ['ask_anything', 'get_brief'] },
|
||||
required: { field: 'operation', value: ['ask_anything', 'get_brief'] },
|
||||
},
|
||||
{
|
||||
id: 'entityFromDateTime',
|
||||
title: 'From Date/Time',
|
||||
type: 'short-input',
|
||||
placeholder: '2024-01-01T00:00:00Z',
|
||||
condition: {
|
||||
field: 'operation',
|
||||
value: ['ask_anything', 'get_brief'],
|
||||
and: { field: 'timePeriod', value: 'CUSTOM_RANGE' },
|
||||
},
|
||||
required: {
|
||||
field: 'operation',
|
||||
value: ['ask_anything', 'get_brief'],
|
||||
and: { field: 'timePeriod', value: 'CUSTOM_RANGE' },
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
prompt: `Generate an ISO 8601 timestamp based on the user's description.
|
||||
The timestamp should be in the format: YYYY-MM-DDTHH:MM:SSZ (UTC timezone).
|
||||
|
||||
Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes, no extra text.`,
|
||||
placeholder: 'Describe the start time (e.g., "beginning of last quarter")...',
|
||||
generationType: 'timestamp',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'entityToDateTime',
|
||||
title: 'To Date/Time',
|
||||
type: 'short-input',
|
||||
placeholder: '2024-01-31T23:59:59Z',
|
||||
condition: {
|
||||
field: 'operation',
|
||||
value: ['ask_anything', 'get_brief'],
|
||||
and: { field: 'timePeriod', value: 'CUSTOM_RANGE' },
|
||||
},
|
||||
required: {
|
||||
field: 'operation',
|
||||
value: ['ask_anything', 'get_brief'],
|
||||
and: { field: 'timePeriod', value: 'CUSTOM_RANGE' },
|
||||
},
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
prompt: `Generate an ISO 8601 timestamp based on the user's description.
|
||||
The timestamp should be in the format: YYYY-MM-DDTHH:MM:SSZ (UTC timezone).
|
||||
|
||||
Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes, no extra text.`,
|
||||
placeholder: 'Describe the end time (e.g., "end of last quarter")...',
|
||||
generationType: 'timestamp',
|
||||
},
|
||||
},
|
||||
|
||||
// Get Logs inputs
|
||||
{
|
||||
id: 'logType',
|
||||
title: 'Log Type',
|
||||
type: 'dropdown',
|
||||
options: [
|
||||
{ label: 'Access Log', id: 'AccessLog' },
|
||||
{ label: 'User Activity Log', id: 'UserActivityLog' },
|
||||
{ label: 'User Call Play', id: 'UserCallPlay' },
|
||||
{ label: 'Externally Shared Call Access', id: 'ExternallySharedCallAccess' },
|
||||
{ label: 'Externally Shared Call Play', id: 'ExternallySharedCallPlay' },
|
||||
],
|
||||
value: () => 'UserActivityLog',
|
||||
condition: { field: 'operation', value: 'get_logs' },
|
||||
required: { field: 'operation', value: 'get_logs' },
|
||||
},
|
||||
{
|
||||
id: 'logsFromDateTime',
|
||||
title: 'From Date/Time',
|
||||
type: 'short-input',
|
||||
placeholder: '2024-01-01T00:00:00Z',
|
||||
condition: { field: 'operation', value: 'get_logs' },
|
||||
required: { field: 'operation', value: 'get_logs' },
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
prompt: `Generate an ISO 8601 timestamp based on the user's description.
|
||||
The timestamp should be in the format: YYYY-MM-DDTHH:MM:SSZ (UTC timezone).
|
||||
|
||||
Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes, no extra text.`,
|
||||
placeholder: 'Describe the start time (e.g., "beginning of this week")...',
|
||||
generationType: 'timestamp',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'logsToDateTime',
|
||||
title: 'To Date/Time',
|
||||
type: 'short-input',
|
||||
placeholder: '2024-01-31T23:59:59Z (optional)',
|
||||
condition: { field: 'operation', value: 'get_logs' },
|
||||
mode: 'advanced',
|
||||
wandConfig: {
|
||||
enabled: true,
|
||||
prompt: `Generate an ISO 8601 timestamp based on the user's description.
|
||||
The timestamp should be in the format: YYYY-MM-DDTHH:MM:SSZ (UTC timezone).
|
||||
|
||||
Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes, no extra text.`,
|
||||
placeholder: 'Describe the end time (e.g., "now")...',
|
||||
generationType: 'timestamp',
|
||||
},
|
||||
},
|
||||
|
||||
// Lookup Email / Purge Email Address inputs
|
||||
{
|
||||
id: 'emailAddress',
|
||||
@@ -715,6 +911,7 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes
|
||||
'interaction_stats',
|
||||
'answered_scorecards',
|
||||
'list_flows',
|
||||
'get_logs',
|
||||
],
|
||||
},
|
||||
mode: 'advanced',
|
||||
@@ -759,8 +956,12 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes
|
||||
'gong_list_workspaces',
|
||||
'gong_list_flows',
|
||||
'gong_assign_flow_prospects',
|
||||
'gong_unassign_flow_prospects',
|
||||
'gong_get_prospect_flows',
|
||||
'gong_get_coaching',
|
||||
'gong_ask_anything',
|
||||
'gong_get_brief',
|
||||
'gong_get_logs',
|
||||
'gong_lookup_email',
|
||||
'gong_lookup_phone',
|
||||
'gong_purge_email_address',
|
||||
@@ -770,18 +971,41 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes
|
||||
tool: (params) => `gong_${params.operation}`,
|
||||
params: (params) => {
|
||||
const result: Record<string, unknown> = {}
|
||||
// Map operation-specific subBlock IDs to tool param names
|
||||
if (params.transcriptFromDateTime) result.fromDateTime = params.transcriptFromDateTime
|
||||
if (params.transcriptToDateTime) result.toDateTime = params.transcriptToDateTime
|
||||
if (params.statsFromDate) result.fromDate = params.statsFromDate
|
||||
if (params.statsToDate) result.toDate = params.statsToDate
|
||||
if (params.callFromDate) result.callFromDate = params.callFromDate
|
||||
if (params.callToDate) result.callToDate = params.callToDate
|
||||
if (params.reviewFromDate) result.reviewFromDate = params.reviewFromDate
|
||||
if (params.reviewToDate) result.reviewToDate = params.reviewToDate
|
||||
if (params.coachingWorkspaceId) result.workspaceId = params.coachingWorkspaceId
|
||||
if (params.coachingFromDate) result.fromDate = params.coachingFromDate
|
||||
if (params.coachingToDate) result.toDate = params.coachingToDate
|
||||
// Map operation-specific subBlock IDs to tool param names, gated by the
|
||||
// selected operation so stale values from other operations never leak in
|
||||
const operation = params.operation as string
|
||||
if (operation === 'get_call_transcript' || operation === 'get_extensive_calls') {
|
||||
if (params.transcriptFromDateTime) result.fromDateTime = params.transcriptFromDateTime
|
||||
if (params.transcriptToDateTime) result.toDateTime = params.transcriptToDateTime
|
||||
}
|
||||
if (
|
||||
[
|
||||
'aggregate_activity',
|
||||
'day_by_day_activity',
|
||||
'aggregate_by_period',
|
||||
'interaction_stats',
|
||||
].includes(operation)
|
||||
) {
|
||||
if (params.statsFromDate) result.fromDate = params.statsFromDate
|
||||
if (params.statsToDate) result.toDate = params.statsToDate
|
||||
}
|
||||
if (operation === 'get_coaching') {
|
||||
if (params.coachingWorkspaceId) result.workspaceId = params.coachingWorkspaceId
|
||||
if (params.coachingFromDate) result.fromDate = params.coachingFromDate
|
||||
if (params.coachingToDate) result.toDate = params.coachingToDate
|
||||
}
|
||||
if (operation === 'ask_anything' || operation === 'get_brief') {
|
||||
if (params.entityWorkspaceId) result.workspaceId = params.entityWorkspaceId
|
||||
if (params.entityFromDateTime) result.fromDateTime = params.entityFromDateTime
|
||||
if (params.entityToDateTime) result.toDateTime = params.entityToDateTime
|
||||
}
|
||||
if (operation === 'get_logs') {
|
||||
if (params.logsFromDateTime) result.fromDateTime = params.logsFromDateTime
|
||||
if (params.logsToDateTime) result.toDateTime = params.logsToDateTime
|
||||
}
|
||||
if (operation === 'unassign_flow_prospects') {
|
||||
result.flowId = params.unassignFlowId || undefined
|
||||
}
|
||||
return result
|
||||
},
|
||||
},
|
||||
@@ -808,6 +1032,18 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes
|
||||
toDateTime: { type: 'string', description: 'End date/time in ISO-8601 format (list calls)' },
|
||||
callId: { type: 'string', description: 'Gong call ID' },
|
||||
callIds: { type: 'string', description: 'Comma-separated call IDs' },
|
||||
transcriptFromDateTime: {
|
||||
type: 'string',
|
||||
description: 'Start date/time in ISO-8601 format (transcripts and extensive calls)',
|
||||
},
|
||||
transcriptToDateTime: {
|
||||
type: 'string',
|
||||
description: 'End date/time in ISO-8601 format (transcripts and extensive calls)',
|
||||
},
|
||||
includeAvatars: {
|
||||
type: 'string',
|
||||
description: 'Whether to include user avatar URLs (true/false)',
|
||||
},
|
||||
userId: { type: 'string', description: 'Gong user ID' },
|
||||
userIds: { type: 'string', description: 'Comma-separated user IDs' },
|
||||
aggregationPeriod: {
|
||||
@@ -829,12 +1065,56 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes
|
||||
folderId: { type: 'string', description: 'Library folder ID' },
|
||||
workspaceId: { type: 'string', description: 'Gong workspace ID' },
|
||||
managerId: { type: 'string', description: 'Manager user ID for coaching' },
|
||||
coachingWorkspaceId: { type: 'string', description: 'Gong workspace ID (coaching)' },
|
||||
coachingFromDate: {
|
||||
type: 'string',
|
||||
description: 'Start date/time in ISO-8601 format (coaching)',
|
||||
},
|
||||
coachingToDate: { type: 'string', description: 'End date/time in ISO-8601 format (coaching)' },
|
||||
entityWorkspaceId: {
|
||||
type: 'string',
|
||||
description: 'Gong workspace ID (ask anything and briefs)',
|
||||
},
|
||||
entityFromDateTime: {
|
||||
type: 'string',
|
||||
description: 'Start date/time in ISO-8601 format for custom-range questions and briefs',
|
||||
},
|
||||
entityToDateTime: {
|
||||
type: 'string',
|
||||
description: 'End date/time in ISO-8601 format for custom-range questions and briefs',
|
||||
},
|
||||
logsFromDateTime: {
|
||||
type: 'string',
|
||||
description: 'Start date/time in ISO-8601 format (logs)',
|
||||
},
|
||||
logsToDateTime: { type: 'string', description: 'End date/time in ISO-8601 format (logs)' },
|
||||
flowOwnerEmail: {
|
||||
type: 'string',
|
||||
description: 'Email of a Gong user to retrieve personal and company flows',
|
||||
},
|
||||
flowId: { type: 'string', description: 'Gong Engage flow ID' },
|
||||
crmProspectsIds: { type: 'string', description: 'Comma-separated CRM prospect IDs' },
|
||||
crmProspectId: { type: 'string', description: 'Single CRM prospect ID to unassign' },
|
||||
unassignFlowId: {
|
||||
type: 'string',
|
||||
description: 'Specific flow ID to unassign from (omit to unassign from all flows)',
|
||||
},
|
||||
unassignedByUserEmail: {
|
||||
type: 'string',
|
||||
description: 'Email of the Gong user requesting the unassignment',
|
||||
},
|
||||
crmEntityType: {
|
||||
type: 'string',
|
||||
description: 'CRM entity type (ACCOUNT, CONTACT, DEAL, or LEAD)',
|
||||
},
|
||||
crmEntityId: { type: 'string', description: 'CRM ID of the entity' },
|
||||
question: { type: 'string', description: 'Natural-language question to ask about the entity' },
|
||||
briefName: { type: 'string', description: 'Name of the brief configured in Gong Agent Studio' },
|
||||
timePeriod: {
|
||||
type: 'string',
|
||||
description: 'Time period of conversations to consider (e.g. LAST_30DAYS, CUSTOM_RANGE)',
|
||||
},
|
||||
logType: { type: 'string', description: 'Type of Gong logs to retrieve' },
|
||||
flowInstanceOwnerEmail: {
|
||||
type: 'string',
|
||||
description: 'Email of the Gong user who owns the flow instance and its to-dos',
|
||||
@@ -868,7 +1148,7 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes
|
||||
callId: { type: 'string', description: 'Gong call ID of the created call' },
|
||||
url: { type: 'string', description: 'URL to the call in the Gong web app' },
|
||||
id: { type: 'string', description: 'Gong ID of the returned call or user' },
|
||||
title: { type: 'string', description: 'Call title' },
|
||||
title: { type: 'string', description: 'Call title or user job title' },
|
||||
scheduled: { type: 'string', description: 'Scheduled call time (ISO-8601)' },
|
||||
started: { type: 'string', description: 'Recording start time (ISO-8601)' },
|
||||
duration: { type: 'number', description: 'Call duration in seconds' },
|
||||
@@ -983,6 +1263,37 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes
|
||||
description: "Coaching data per manager's team with direct-report metrics",
|
||||
},
|
||||
|
||||
// unassign_flow_prospects
|
||||
unassignedFlowInstanceIds: {
|
||||
type: 'json',
|
||||
description: 'IDs of the flow instances the prospect was removed from',
|
||||
},
|
||||
|
||||
// ask_anything / get_brief
|
||||
numOfCallsSearched: {
|
||||
type: 'number',
|
||||
description: 'Number of calls used to generate the answer or brief',
|
||||
},
|
||||
numOfEmailsSearched: {
|
||||
type: 'number',
|
||||
description: 'Number of emails used to generate the answer or brief',
|
||||
},
|
||||
answer: {
|
||||
type: 'json',
|
||||
description: 'Generated answer sections: [{answerItems, callFindings, emailFindings}]',
|
||||
},
|
||||
briefSections: {
|
||||
type: 'json',
|
||||
description:
|
||||
'Generated brief sections: [{title, sectionSummary, briefSectionType, conversationFindings, webFindings}]',
|
||||
},
|
||||
|
||||
// get_logs
|
||||
logEntries: {
|
||||
type: 'json',
|
||||
description: 'Log entries: [{userId, userEmailAddress, userFullName, eventTime, logRecord}]',
|
||||
},
|
||||
|
||||
// lookup_email / lookup_phone
|
||||
emails: {
|
||||
type: 'json',
|
||||
|
||||
@@ -6545,6 +6545,10 @@
|
||||
"name": "Assign Flow Prospects",
|
||||
"description": "Assign up to 200 CRM prospects (contacts or leads) to a Gong Engage flow."
|
||||
},
|
||||
{
|
||||
"name": "Unassign Flow Prospects",
|
||||
"description": "Remove a prospect from Gong Engage flows. Omit the flow ID to remove the prospect from all flows they are assigned to."
|
||||
},
|
||||
{
|
||||
"name": "Get Prospect Flows",
|
||||
"description": "Get the Gong Engage flows currently assigned to the given CRM prospects."
|
||||
@@ -6553,6 +6557,18 @@
|
||||
"name": "Get Coaching",
|
||||
"description": "Retrieve coaching metrics for a manager from Gong."
|
||||
},
|
||||
{
|
||||
"name": "Ask Anything",
|
||||
"description": "Ask a natural-language question about a CRM account, deal, contact, or lead. Gong answers from up to 60 calls and 500 emails associated with the entity. Consumes Gong credits."
|
||||
},
|
||||
{
|
||||
"name": "Get Brief",
|
||||
"description": "Generate an AI brief (configured in Gong Agent Studio) for a CRM account, deal, contact, or lead. Consumes Gong credits."
|
||||
},
|
||||
{
|
||||
"name": "Get Logs",
|
||||
"description": "Retrieve Gong log entries of a specific type within a time range."
|
||||
},
|
||||
{
|
||||
"name": "Lookup Email",
|
||||
"description": "Find all references to an email address in Gong (calls, email messages, meetings, CRM data, engagement)."
|
||||
@@ -6570,7 +6586,7 @@
|
||||
"description": "Erase all Gong data (calls, leads, contacts) referencing a phone number. Asynchronous and irreversible."
|
||||
}
|
||||
],
|
||||
"operationCount": 25,
|
||||
"operationCount": 29,
|
||||
"triggers": [
|
||||
{
|
||||
"id": "gong_webhook",
|
||||
|
||||
@@ -103,6 +103,7 @@ export const aggregateActivityTool: ToolConfig<
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
usersActivity,
|
||||
timeZone: data.timeZone ?? null,
|
||||
fromDateTime: data.fromDateTime ?? null,
|
||||
@@ -113,6 +114,11 @@ export const aggregateActivityTool: ToolConfig<
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
usersActivity: {
|
||||
type: 'array',
|
||||
description: 'Aggregated activity statistics per user',
|
||||
|
||||
@@ -74,7 +74,7 @@ export const aggregateByPeriodTool: ToolConfig<
|
||||
const userIds = parseGongIdList(params.userIds)
|
||||
if (userIds) filter.userIds = userIds
|
||||
const body: Record<string, unknown> = {
|
||||
aggregationPeriod: params.aggregationPeriod.trim(),
|
||||
aggregationPeriod: params.aggregationPeriod.trim().toUpperCase(),
|
||||
filter,
|
||||
}
|
||||
if (params.cursor?.trim()) body.cursor = params.cursor.trim()
|
||||
|
||||
@@ -122,6 +122,7 @@ export const answeredScorecardsTool: ToolConfig<
|
||||
score: answer.score ?? null,
|
||||
answerText: answer.answerText ?? null,
|
||||
notApplicable: answer.notApplicable ?? null,
|
||||
selectedOptions: answer.selectedOptions ?? null,
|
||||
})
|
||||
),
|
||||
})
|
||||
@@ -129,6 +130,7 @@ export const answeredScorecardsTool: ToolConfig<
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
answeredScorecards,
|
||||
cursor: data.records?.cursor ?? null,
|
||||
},
|
||||
@@ -136,6 +138,11 @@ export const answeredScorecardsTool: ToolConfig<
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
answeredScorecards: {
|
||||
type: 'array',
|
||||
description: 'List of answered scorecards with scores and answers',
|
||||
@@ -183,7 +190,7 @@ export const answeredScorecardsTool: ToolConfig<
|
||||
isOverall: { type: 'boolean', description: 'Whether this is the overall question' },
|
||||
score: {
|
||||
type: 'number',
|
||||
description: 'Score between 1 to 5 if answered, null otherwise',
|
||||
description: 'Score between 1 to 50 if answered, null otherwise',
|
||||
},
|
||||
answerText: {
|
||||
type: 'string',
|
||||
@@ -193,6 +200,12 @@ export const answeredScorecardsTool: ToolConfig<
|
||||
type: 'boolean',
|
||||
description: 'Whether the question is not applicable to this call',
|
||||
},
|
||||
selectedOptions: {
|
||||
type: 'array',
|
||||
description:
|
||||
'Identifiers of the options selected for select-type questions, null otherwise',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -202,6 +215,7 @@ export const answeredScorecardsTool: ToolConfig<
|
||||
cursor: {
|
||||
type: 'string',
|
||||
description: 'Pagination cursor for the next page',
|
||||
optional: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,161 @@
|
||||
import type { GongAskAnythingParams, GongAskAnythingResponse } from '@/tools/gong/types'
|
||||
import { getGongErrorMessage } from '@/tools/gong/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const askAnythingTool: ToolConfig<GongAskAnythingParams, GongAskAnythingResponse> = {
|
||||
id: 'gong_ask_anything',
|
||||
name: 'Gong Ask Anything',
|
||||
description:
|
||||
'Ask a natural-language question about a CRM account, deal, contact, or lead. Gong answers from up to 60 calls and 500 emails associated with the entity. Consumes Gong credits.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
accessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'Gong API Access Key',
|
||||
},
|
||||
accessKeySecret: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'Gong API Access Key Secret',
|
||||
},
|
||||
workspaceId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Gong workspace ID the entity belongs to',
|
||||
},
|
||||
crmEntityType: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Type of the CRM entity: ACCOUNT, CONTACT, DEAL, or LEAD',
|
||||
},
|
||||
crmEntityId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The CRM ID of the entity the question is asked about',
|
||||
},
|
||||
question: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The natural-language question to ask about the entity',
|
||||
},
|
||||
timePeriod: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Time period of conversations to consider: LAST_7DAYS, LAST_30DAYS, LAST_90DAYS, LAST_90_DAYS_SINCE_LAST_ACTIVITY, LAST_YEAR_SINCE_LAST_ACTIVITY, LAST_YEAR, THIS_WEEK, THIS_MONTH, THIS_YEAR, THIS_QUARTER, CUSTOM_RANGE, or ALL_CONVERSATIONS',
|
||||
},
|
||||
fromDateTime: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Start date/time (UTC, ISO-8601) for calls and emails to include. Required when timePeriod is CUSTOM_RANGE.',
|
||||
},
|
||||
toDateTime: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'End date/time (UTC, ISO-8601) for calls and emails to include. Required when timePeriod is CUSTOM_RANGE.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const timePeriod = params.timePeriod.trim().toUpperCase()
|
||||
if (
|
||||
timePeriod === 'CUSTOM_RANGE' &&
|
||||
(!params.fromDateTime?.trim() || !params.toDateTime?.trim())
|
||||
) {
|
||||
throw new Error('fromDateTime and toDateTime are required when timePeriod is CUSTOM_RANGE')
|
||||
}
|
||||
const url = new URL('https://api.gong.io/v2/entities/ask-entity')
|
||||
url.searchParams.set('workspaceId', params.workspaceId.trim())
|
||||
url.searchParams.set('crmEntityType', params.crmEntityType.trim().toUpperCase())
|
||||
url.searchParams.set('crmEntityId', params.crmEntityId.trim())
|
||||
url.searchParams.set('timePeriod', timePeriod)
|
||||
url.searchParams.set('question', params.question.trim())
|
||||
if (timePeriod === 'CUSTOM_RANGE') {
|
||||
url.searchParams.set('fromDateTime', params.fromDateTime?.trim() ?? '')
|
||||
url.searchParams.set('toDateTime', params.toDateTime?.trim() ?? '')
|
||||
}
|
||||
return url.toString()
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => ({
|
||||
Authorization: `Basic ${btoa(`${params.accessKey}:${params.accessKeySecret}`)}`,
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(getGongErrorMessage(data, 'Failed to ask about the entity'))
|
||||
}
|
||||
const answer = (data.answer ?? []).map((section: Record<string, unknown>) => ({
|
||||
answerItems: section.answerItems ?? [],
|
||||
callFindings: section.callFindings ?? [],
|
||||
emailFindings: section.emailFindings ?? [],
|
||||
}))
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
numOfCallsSearched: data.numOfCallsSearched ?? null,
|
||||
numOfEmailsSearched: data.numOfEmailsSearched ?? null,
|
||||
answer,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
numOfCallsSearched: {
|
||||
type: 'number',
|
||||
description: 'Number of calls used to generate the answer',
|
||||
optional: true,
|
||||
},
|
||||
numOfEmailsSearched: {
|
||||
type: 'number',
|
||||
description: 'Number of emails used to generate the answer',
|
||||
optional: true,
|
||||
},
|
||||
answer: {
|
||||
type: 'array',
|
||||
description: 'Sections of the generated answer with supporting evidence',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
answerItems: {
|
||||
type: 'array',
|
||||
description: 'Text items that make up this part of the answer',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
callFindings: {
|
||||
type: 'array',
|
||||
description: 'Evidence from calls used to generate this answer item',
|
||||
items: { type: 'object' },
|
||||
},
|
||||
emailFindings: {
|
||||
type: 'array',
|
||||
description: 'Evidence from emails used to generate this answer item',
|
||||
items: { type: 'object' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -53,9 +53,10 @@ export const createCallTool: ToolConfig<GongCreateCallParams, GongCreateCallResp
|
||||
},
|
||||
downloadMediaUrl: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'URL where Gong can download the call media file',
|
||||
description:
|
||||
'URL where Gong can download the call media file. If omitted, the call is created without media and Gong waits for a separate media upload.',
|
||||
},
|
||||
title: {
|
||||
type: 'string',
|
||||
@@ -108,10 +109,10 @@ export const createCallTool: ToolConfig<GongCreateCallParams, GongCreateCallResp
|
||||
actualStart: params.actualStart.trim(),
|
||||
primaryUser: params.primaryUser.trim(),
|
||||
parties: parseGongJsonArray(params.parties, 'parties'),
|
||||
direction: params.direction,
|
||||
downloadMediaUrl: params.downloadMediaUrl.trim(),
|
||||
direction: params.direction.trim(),
|
||||
}
|
||||
|
||||
if (params.downloadMediaUrl?.trim()) body.downloadMediaUrl = params.downloadMediaUrl.trim()
|
||||
if (params.title?.trim()) body.title = params.title.trim()
|
||||
if (params.workspaceId?.trim()) body.workspaceId = params.workspaceId.trim()
|
||||
if (params.disposition?.trim()) body.disposition = params.disposition.trim()
|
||||
@@ -134,7 +135,6 @@ export const createCallTool: ToolConfig<GongCreateCallParams, GongCreateCallResp
|
||||
output: {
|
||||
callId: data.callId ?? '',
|
||||
requestId: data.requestId ?? '',
|
||||
url: data.url ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -148,10 +148,5 @@ export const createCallTool: ToolConfig<GongCreateCallParams, GongCreateCallResp
|
||||
type: 'string',
|
||||
description: 'Gong request reference ID for troubleshooting',
|
||||
},
|
||||
url: {
|
||||
type: 'string',
|
||||
description: 'URL to the created call in the Gong web app',
|
||||
optional: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -0,0 +1,164 @@
|
||||
import type { GongGetBriefParams, GongGetBriefResponse } from '@/tools/gong/types'
|
||||
import { getGongErrorMessage } from '@/tools/gong/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const getBriefTool: ToolConfig<GongGetBriefParams, GongGetBriefResponse> = {
|
||||
id: 'gong_get_brief',
|
||||
name: 'Gong Get Brief',
|
||||
description:
|
||||
'Generate an AI brief (configured in Gong Agent Studio) for a CRM account, deal, contact, or lead. Consumes Gong credits.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
accessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'Gong API Access Key',
|
||||
},
|
||||
accessKeySecret: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'Gong API Access Key Secret',
|
||||
},
|
||||
workspaceId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Gong workspace ID the entity belongs to',
|
||||
},
|
||||
briefName: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Name of the brief to generate, as configured in Gong Agent Studio > AI Briefer',
|
||||
},
|
||||
crmEntityType: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Type of the CRM entity: ACCOUNT, CONTACT, DEAL, or LEAD',
|
||||
},
|
||||
crmEntityId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The CRM ID of the entity to generate the brief for',
|
||||
},
|
||||
timePeriod: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Time period of conversations to consider: LAST_7DAYS, LAST_30DAYS, LAST_90DAYS, LAST_90_DAYS_SINCE_LAST_ACTIVITY, LAST_YEAR_SINCE_LAST_ACTIVITY, LAST_YEAR, THIS_WEEK, THIS_MONTH, THIS_YEAR, THIS_QUARTER, CUSTOM_RANGE, or ALL_CONVERSATIONS',
|
||||
},
|
||||
fromDateTime: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Start date/time (UTC, ISO-8601) for calls and emails to include. Required when timePeriod is CUSTOM_RANGE.',
|
||||
},
|
||||
toDateTime: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'End date/time (UTC, ISO-8601) for calls and emails to include. Required when timePeriod is CUSTOM_RANGE.',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const timePeriod = params.timePeriod.trim().toUpperCase()
|
||||
if (
|
||||
timePeriod === 'CUSTOM_RANGE' &&
|
||||
(!params.fromDateTime?.trim() || !params.toDateTime?.trim())
|
||||
) {
|
||||
throw new Error('fromDateTime and toDateTime are required when timePeriod is CUSTOM_RANGE')
|
||||
}
|
||||
const url = new URL('https://api.gong.io/v2/entities/get-brief')
|
||||
url.searchParams.set('workspaceId', params.workspaceId.trim())
|
||||
url.searchParams.set('briefName', params.briefName.trim())
|
||||
url.searchParams.set('crmEntityType', params.crmEntityType.trim().toUpperCase())
|
||||
url.searchParams.set('crmEntityId', params.crmEntityId.trim())
|
||||
url.searchParams.set('timePeriod', timePeriod)
|
||||
if (timePeriod === 'CUSTOM_RANGE') {
|
||||
url.searchParams.set('fromDateTime', params.fromDateTime?.trim() ?? '')
|
||||
url.searchParams.set('toDateTime', params.toDateTime?.trim() ?? '')
|
||||
}
|
||||
return url.toString()
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => ({
|
||||
Authorization: `Basic ${btoa(`${params.accessKey}:${params.accessKeySecret}`)}`,
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(getGongErrorMessage(data, 'Failed to generate the brief'))
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
numOfCallsSearched: data.numOfCallsSearched ?? null,
|
||||
numOfEmailsSearched: data.numOfEmailsSearched ?? null,
|
||||
briefSections: data.briefSections ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
numOfCallsSearched: {
|
||||
type: 'number',
|
||||
description: 'Number of calls used to generate the brief',
|
||||
optional: true,
|
||||
},
|
||||
numOfEmailsSearched: {
|
||||
type: 'number',
|
||||
description: 'Number of emails used to generate the brief',
|
||||
optional: true,
|
||||
},
|
||||
briefSections: {
|
||||
type: 'array',
|
||||
description: 'Sections of the generated brief',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
title: { type: 'string', description: 'Section title' },
|
||||
sectionSummary: {
|
||||
type: 'array',
|
||||
description: 'The content displayed for this section',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
briefSectionType: {
|
||||
type: 'string',
|
||||
description: 'The section type, which determines the source of the data',
|
||||
},
|
||||
conversationFindings: {
|
||||
type: 'object',
|
||||
description: 'Evidence from calls and emails used to generate this section',
|
||||
},
|
||||
webFindings: {
|
||||
type: 'array',
|
||||
description: 'Evidence from web search results used to generate this section',
|
||||
items: { type: 'object' },
|
||||
},
|
||||
mcpResult: {
|
||||
type: 'object',
|
||||
description: 'Result from an MCP data source used to generate this section',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -30,7 +30,7 @@ export const getCallTool: ToolConfig<GongGetCallParams, GongGetCallResponse> = {
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `https://api.gong.io/v2/calls/${params.callId.trim()}`,
|
||||
url: (params) => `https://api.gong.io/v2/calls/${encodeURIComponent(params.callId.trim())}`,
|
||||
method: 'GET',
|
||||
headers: (params) => ({
|
||||
'Content-Type': 'application/json',
|
||||
@@ -47,6 +47,7 @@ export const getCallTool: ToolConfig<GongGetCallParams, GongGetCallResponse> = {
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
id: call.id ?? '',
|
||||
title: call.title ?? null,
|
||||
url: call.url ?? null,
|
||||
@@ -72,6 +73,11 @@ export const getCallTool: ToolConfig<GongGetCallParams, GongGetCallResponse> = {
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
id: { type: 'string', description: "Gong's unique numeric identifier for the call" },
|
||||
title: { type: 'string', description: 'Call title', optional: true },
|
||||
url: { type: 'string', description: 'URL to the call in the Gong web app', optional: true },
|
||||
|
||||
@@ -96,6 +96,7 @@ export const getCallTranscriptTool: ToolConfig<
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
callTranscripts,
|
||||
cursor: data.records?.cursor ?? null,
|
||||
},
|
||||
@@ -103,6 +104,11 @@ export const getCallTranscriptTool: ToolConfig<
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
callTranscripts: {
|
||||
type: 'array',
|
||||
description: 'List of call transcripts with speaker turns and sentences',
|
||||
|
||||
@@ -115,6 +115,7 @@ export const getCoachingTool: ToolConfig<GongGetCoachingParams, GongGetCoachingR
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
coachingData: {
|
||||
type: 'array',
|
||||
|
||||
@@ -121,6 +121,7 @@ export const getExtensiveCallsTool: ToolConfig<
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
calls: data.calls ?? [],
|
||||
cursor: data.records?.cursor ?? null,
|
||||
},
|
||||
@@ -128,6 +129,11 @@ export const getExtensiveCallsTool: ToolConfig<
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
calls: {
|
||||
type: 'array',
|
||||
description:
|
||||
@@ -331,23 +337,13 @@ export const getExtensiveCallsTool: ToolConfig<
|
||||
properties: {
|
||||
interactionStats: {
|
||||
type: 'array',
|
||||
description: 'Interaction stats per user',
|
||||
description:
|
||||
'Interaction stat measurements (Longest Monologue, Interactivity, Patience, etc.)',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
userId: { type: 'string', description: 'Gong user ID' },
|
||||
userEmailAddress: { type: 'string', description: 'User email' },
|
||||
personInteractionStats: {
|
||||
type: 'array',
|
||||
description: 'Stats list (Longest Monologue, Interactivity, Patience, etc.)',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
name: { type: 'string', description: 'Stat name' },
|
||||
value: { type: 'number', description: 'Stat value' },
|
||||
},
|
||||
},
|
||||
},
|
||||
name: { type: 'string', description: 'Stat name' },
|
||||
value: { type: 'number', description: 'Stat value' },
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -26,16 +26,16 @@ export const getFolderContentTool: ToolConfig<
|
||||
},
|
||||
folderId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The library folder ID to retrieve content for',
|
||||
description: 'The library folder ID to retrieve content for (up to 20 digits)',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const url = new URL('https://api.gong.io/v2/library/folder-content')
|
||||
url.searchParams.set('folderId', params.folderId.trim())
|
||||
if (params.folderId?.trim()) url.searchParams.set('folderId', params.folderId.trim())
|
||||
return url.toString()
|
||||
},
|
||||
method: 'GET',
|
||||
@@ -67,6 +67,7 @@ export const getFolderContentTool: ToolConfig<
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
folderId: data.id ?? null,
|
||||
folderName: data.name ?? null,
|
||||
createdBy: data.createdBy ?? null,
|
||||
@@ -77,6 +78,11 @@ export const getFolderContentTool: ToolConfig<
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
folderId: {
|
||||
type: 'string',
|
||||
description: "Gong's unique numeric identifier for the folder",
|
||||
|
||||
@@ -0,0 +1,163 @@
|
||||
import type { GongGetLogsParams, GongGetLogsResponse } from '@/tools/gong/types'
|
||||
import { getGongErrorMessage } from '@/tools/gong/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const getLogsTool: ToolConfig<GongGetLogsParams, GongGetLogsResponse> = {
|
||||
id: 'gong_get_logs',
|
||||
name: 'Gong Get Logs',
|
||||
description: 'Retrieve Gong log entries of a specific type within a time range.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
accessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'Gong API Access Key',
|
||||
},
|
||||
accessKeySecret: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'Gong API Access Key Secret',
|
||||
},
|
||||
logType: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Type of logs requested: AccessLog, UserActivityLog, UserCallPlay, ExternallySharedCallAccess, or ExternallySharedCallPlay',
|
||||
},
|
||||
fromDateTime: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
"Time from which to retrieve log records, in ISO-8601 format (e.g., '2024-01-01T00:00:00Z')",
|
||||
},
|
||||
toDateTime: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'Time until which to retrieve log records, in ISO-8601 format. Defaults to the latest available logs when omitted.',
|
||||
},
|
||||
cursor: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Pagination cursor from a previous response',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const url = new URL('https://api.gong.io/v2/logs')
|
||||
url.searchParams.set('logType', params.logType.trim())
|
||||
url.searchParams.set('fromDateTime', params.fromDateTime.trim())
|
||||
if (params.toDateTime?.trim()) url.searchParams.set('toDateTime', params.toDateTime.trim())
|
||||
if (params.cursor?.trim()) url.searchParams.set('cursor', params.cursor.trim())
|
||||
return url.toString()
|
||||
},
|
||||
method: 'GET',
|
||||
headers: (params) => ({
|
||||
Authorization: `Basic ${btoa(`${params.accessKey}:${params.accessKeySecret}`)}`,
|
||||
}),
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(getGongErrorMessage(data, 'Failed to get logs'))
|
||||
}
|
||||
const logEntries = (data.logEntries ?? []).map((entry: Record<string, unknown>) => ({
|
||||
userId: entry.userId ?? null,
|
||||
userEmailAddress: entry.userEmailAddress ?? null,
|
||||
userFullName: entry.userFullName ?? null,
|
||||
impersonatorUserId: entry.impersonatorUserId ?? null,
|
||||
impersonatorEmailAddress: entry.impersonatorEmailAddress ?? null,
|
||||
impersonatorFullName: entry.impersonatorFullName ?? null,
|
||||
impersonatorCompanyId: entry.impersonatorCompanyId ?? null,
|
||||
eventTime: entry.eventTime ?? null,
|
||||
logRecord: entry.logRecord ?? null,
|
||||
}))
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
logEntries,
|
||||
cursor: data.records?.cursor ?? null,
|
||||
totalRecords: data.records?.totalRecords ?? null,
|
||||
currentPageSize: data.records?.currentPageSize ?? null,
|
||||
currentPageNumber: data.records?.currentPageNumber ?? null,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
logEntries: {
|
||||
type: 'array',
|
||||
description: 'Log entries matching the requested type and time range',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
userId: {
|
||||
type: 'string',
|
||||
description: "Gong's unique numeric identifier for the user, if available",
|
||||
},
|
||||
userEmailAddress: {
|
||||
type: 'string',
|
||||
description: 'Email address of the user, if available',
|
||||
},
|
||||
userFullName: { type: 'string', description: 'Full name of the user, if available' },
|
||||
impersonatorUserId: {
|
||||
type: 'string',
|
||||
description: "Gong's unique numeric identifier for the impersonating user, if any",
|
||||
},
|
||||
impersonatorEmailAddress: {
|
||||
type: 'string',
|
||||
description: 'Email address of the impersonating user, if any',
|
||||
},
|
||||
impersonatorFullName: {
|
||||
type: 'string',
|
||||
description: 'Full name of the impersonating user, if any',
|
||||
},
|
||||
impersonatorCompanyId: {
|
||||
type: 'string',
|
||||
description: "Gong's unique numeric identifier for the impersonating user's company",
|
||||
},
|
||||
eventTime: { type: 'string', description: 'Time of the event in ISO-8601 format' },
|
||||
logRecord: {
|
||||
type: 'object',
|
||||
description: 'Log fields and associated values, populated dynamically per log type',
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
cursor: {
|
||||
type: 'string',
|
||||
description: 'Pagination cursor for the next page',
|
||||
optional: true,
|
||||
},
|
||||
totalRecords: {
|
||||
type: 'number',
|
||||
description: 'Total number of records matching the filter',
|
||||
optional: true,
|
||||
},
|
||||
currentPageSize: {
|
||||
type: 'number',
|
||||
description: 'Number of records in the current page',
|
||||
optional: true,
|
||||
},
|
||||
currentPageNumber: {
|
||||
type: 'number',
|
||||
description: 'Current page number',
|
||||
optional: true,
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -30,7 +30,7 @@ export const getUserTool: ToolConfig<GongGetUserParams, GongGetUserResponse> = {
|
||||
},
|
||||
|
||||
request: {
|
||||
url: (params) => `https://api.gong.io/v2/users/${params.userId.trim()}`,
|
||||
url: (params) => `https://api.gong.io/v2/users/${encodeURIComponent(params.userId.trim())}`,
|
||||
method: 'GET',
|
||||
headers: (params) => ({
|
||||
'Content-Type': 'application/json',
|
||||
@@ -47,6 +47,7 @@ export const getUserTool: ToolConfig<GongGetUserParams, GongGetUserResponse> = {
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
id: user.id ?? '',
|
||||
emailAddress: user.emailAddress ?? null,
|
||||
created: user.created ?? null,
|
||||
@@ -68,6 +69,11 @@ export const getUserTool: ToolConfig<GongGetUserParams, GongGetUserResponse> = {
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
id: { type: 'string', description: 'Unique numeric user ID (up to 20 digits)' },
|
||||
emailAddress: { type: 'string', description: 'User email address', optional: true },
|
||||
created: { type: 'string', description: 'User creation timestamp (ISO-8601)', optional: true },
|
||||
|
||||
@@ -1,14 +1,17 @@
|
||||
import { aggregateActivityTool } from '@/tools/gong/aggregate_activity'
|
||||
import { aggregateByPeriodTool } from '@/tools/gong/aggregate_by_period'
|
||||
import { answeredScorecardsTool } from '@/tools/gong/answered_scorecards'
|
||||
import { askAnythingTool } from '@/tools/gong/ask_anything'
|
||||
import { assignFlowProspectsTool } from '@/tools/gong/assign_flow_prospects'
|
||||
import { createCallTool } from '@/tools/gong/create_call'
|
||||
import { dayByDayActivityTool } from '@/tools/gong/day_by_day_activity'
|
||||
import { getBriefTool } from '@/tools/gong/get_brief'
|
||||
import { getCallTool } from '@/tools/gong/get_call'
|
||||
import { getCallTranscriptTool } from '@/tools/gong/get_call_transcript'
|
||||
import { getCoachingTool } from '@/tools/gong/get_coaching'
|
||||
import { getExtensiveCallsTool } from '@/tools/gong/get_extensive_calls'
|
||||
import { getFolderContentTool } from '@/tools/gong/get_folder_content'
|
||||
import { getLogsTool } from '@/tools/gong/get_logs'
|
||||
import { getProspectFlowsTool } from '@/tools/gong/get_prospect_flows'
|
||||
import { getUserTool } from '@/tools/gong/get_user'
|
||||
import { interactionStatsTool } from '@/tools/gong/interaction_stats'
|
||||
@@ -23,6 +26,7 @@ import { lookupEmailTool } from '@/tools/gong/lookup_email'
|
||||
import { lookupPhoneTool } from '@/tools/gong/lookup_phone'
|
||||
import { purgeEmailAddressTool } from '@/tools/gong/purge_email_address'
|
||||
import { purgePhoneNumberTool } from '@/tools/gong/purge_phone_number'
|
||||
import { unassignFlowProspectsTool } from '@/tools/gong/unassign_flow_prospects'
|
||||
|
||||
export const gongListCallsTool = listCallsTool
|
||||
export const gongCreateCallTool = createCallTool
|
||||
@@ -49,5 +53,9 @@ export const gongPurgeEmailAddressTool = purgeEmailAddressTool
|
||||
export const gongPurgePhoneNumberTool = purgePhoneNumberTool
|
||||
export const gongAssignFlowProspectsTool = assignFlowProspectsTool
|
||||
export const gongGetProspectFlowsTool = getProspectFlowsTool
|
||||
export const gongAskAnythingTool = askAnythingTool
|
||||
export const gongGetBriefTool = getBriefTool
|
||||
export const gongUnassignFlowProspectsTool = unassignFlowProspectsTool
|
||||
export const gongGetLogsTool = getLogsTool
|
||||
|
||||
export * from './types'
|
||||
export * from '@/tools/gong/types'
|
||||
|
||||
@@ -92,6 +92,7 @@ export const interactionStatsTool: ToolConfig<
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
peopleInteractionStats,
|
||||
timeZone: data.timeZone ?? null,
|
||||
fromDateTime: data.fromDateTime ?? null,
|
||||
@@ -102,6 +103,11 @@ export const interactionStatsTool: ToolConfig<
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
peopleInteractionStats: {
|
||||
type: 'array',
|
||||
description:
|
||||
|
||||
@@ -97,7 +97,7 @@ export const listCallsTool: ToolConfig<GongListCallsParams, GongListCallsRespons
|
||||
requestId: data.requestId ?? null,
|
||||
calls,
|
||||
cursor: data.records?.cursor ?? null,
|
||||
totalRecords: data.records?.totalRecords ?? calls.length,
|
||||
totalRecords: data.records?.totalRecords ?? null,
|
||||
currentPageSize: data.records?.currentPageSize ?? null,
|
||||
currentPageNumber: data.records?.currentPageNumber ?? null,
|
||||
},
|
||||
@@ -153,6 +153,7 @@ export const listCallsTool: ToolConfig<GongListCallsParams, GongListCallsRespons
|
||||
totalRecords: {
|
||||
type: 'number',
|
||||
description: 'Total number of records matching the filter',
|
||||
optional: true,
|
||||
},
|
||||
currentPageSize: {
|
||||
type: 'number',
|
||||
|
||||
@@ -46,8 +46,8 @@ export const listFlowsTool: ToolConfig<GongListFlowsParams, GongListFlowsRespons
|
||||
request: {
|
||||
url: (params) => {
|
||||
const url = new URL('https://api.gong.io/v2/flows')
|
||||
url.searchParams.set('flowEmailOwner', params.flowOwnerEmail.trim())
|
||||
if (params.workspaceId) url.searchParams.set('workspaceId', params.workspaceId.trim())
|
||||
url.searchParams.set('flowOwnerEmail', params.flowOwnerEmail.trim())
|
||||
if (params.workspaceId?.trim()) url.searchParams.set('workspaceId', params.workspaceId.trim())
|
||||
if (params.cursor?.trim()) url.searchParams.set('cursor', params.cursor.trim())
|
||||
return url.toString()
|
||||
},
|
||||
@@ -89,6 +89,7 @@ export const listFlowsTool: ToolConfig<GongListFlowsParams, GongListFlowsRespons
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
flows: {
|
||||
type: 'array',
|
||||
@@ -118,14 +119,17 @@ export const listFlowsTool: ToolConfig<GongListFlowsParams, GongListFlowsRespons
|
||||
totalRecords: {
|
||||
type: 'number',
|
||||
description: 'Total number of flow records available',
|
||||
optional: true,
|
||||
},
|
||||
currentPageSize: {
|
||||
type: 'number',
|
||||
description: 'Number of records returned in the current page',
|
||||
optional: true,
|
||||
},
|
||||
currentPageNumber: {
|
||||
type: 'number',
|
||||
description: 'Current page number',
|
||||
optional: true,
|
||||
},
|
||||
cursor: {
|
||||
type: 'string',
|
||||
|
||||
@@ -62,11 +62,19 @@ export const listLibraryFoldersTool: ToolConfig<
|
||||
}))
|
||||
return {
|
||||
success: true,
|
||||
output: { folders },
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
folders,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
folders: {
|
||||
type: 'array',
|
||||
description: 'List of library folders with id, name, and parent relationships',
|
||||
|
||||
@@ -39,47 +39,58 @@ export const listScorecardsTool: ToolConfig<GongListScorecardsParams, GongListSc
|
||||
throw new Error(getGongErrorMessage(data, 'Failed to list scorecards'))
|
||||
}
|
||||
const scorecards = (data.scorecards ?? []).map((sc: Record<string, unknown>) => ({
|
||||
scorecardId: sc.scorecardId ?? '',
|
||||
scorecardId: sc.scorecardId ?? null,
|
||||
scorecardName: sc.scorecardName ?? '',
|
||||
workspaceId: sc.workspaceId ?? null,
|
||||
enabled: sc.enabled ?? false,
|
||||
updaterUserId: sc.updaterUserId ?? null,
|
||||
created: sc.created ?? null,
|
||||
updated: sc.updated ?? null,
|
||||
reviewMethod: sc.reviewMethod ?? null,
|
||||
questions: ((sc.questions as Record<string, unknown>[] | undefined) ?? []).map(
|
||||
(q: Record<string, unknown>) => ({
|
||||
questionId: q.questionId ?? '',
|
||||
questionText: q.questionText ?? '',
|
||||
questionId: q.questionId ?? null,
|
||||
questionRevisionId: q.questionRevisionId ?? null,
|
||||
questionText: q.questionText ?? '',
|
||||
isOverall: q.isOverall ?? false,
|
||||
created: q.created ?? null,
|
||||
updated: q.updated ?? null,
|
||||
updaterUserId: q.updaterUserId ?? null,
|
||||
questionType: q.questionType ?? null,
|
||||
answerGuide: q.answerGuide ?? null,
|
||||
minRange: q.minRange ?? null,
|
||||
maxRange: q.maxRange ?? null,
|
||||
answerOptions: q.answerOptions ?? [],
|
||||
})
|
||||
),
|
||||
}))
|
||||
return {
|
||||
success: true,
|
||||
output: { scorecards },
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
scorecards,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
scorecards: {
|
||||
type: 'array',
|
||||
description: 'List of scorecard definitions with questions',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
scorecardId: { type: 'string', description: 'Unique identifier for the scorecard' },
|
||||
scorecardId: { type: 'number', description: 'Unique identifier for the scorecard' },
|
||||
scorecardName: { type: 'string', description: 'Display name of the scorecard' },
|
||||
workspaceId: {
|
||||
type: 'string',
|
||||
type: 'number',
|
||||
description: 'Workspace identifier associated with this scorecard',
|
||||
},
|
||||
enabled: { type: 'boolean', description: 'Whether the scorecard is active' },
|
||||
updaterUserId: {
|
||||
type: 'string',
|
||||
type: 'number',
|
||||
description: 'ID of the user who last modified the scorecard',
|
||||
},
|
||||
created: {
|
||||
@@ -90,33 +101,52 @@ export const listScorecardsTool: ToolConfig<GongListScorecardsParams, GongListSc
|
||||
type: 'string',
|
||||
description: 'Last update timestamp in ISO-8601 format',
|
||||
},
|
||||
reviewMethod: {
|
||||
type: 'string',
|
||||
description: 'Review method configured for the scorecard',
|
||||
},
|
||||
questions: {
|
||||
type: 'array',
|
||||
description: 'List of questions in the scorecard',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
questionId: { type: 'string', description: 'Unique identifier for the question' },
|
||||
questionText: { type: 'string', description: 'The text content of the question' },
|
||||
questionId: { type: 'number', description: 'Unique identifier for the question' },
|
||||
questionRevisionId: {
|
||||
type: 'string',
|
||||
type: 'number',
|
||||
description: 'Identifier for the specific revision of the question',
|
||||
},
|
||||
questionText: { type: 'string', description: 'The text content of the question' },
|
||||
isOverall: {
|
||||
type: 'boolean',
|
||||
description: 'Whether this is the primary overall question',
|
||||
},
|
||||
created: {
|
||||
questionType: {
|
||||
type: 'string',
|
||||
description: 'Question creation timestamp in ISO-8601 format',
|
||||
description: 'The type of the question (e.g. range or select)',
|
||||
},
|
||||
updated: {
|
||||
answerGuide: {
|
||||
type: 'string',
|
||||
description: 'Question last update timestamp in ISO-8601 format',
|
||||
description: 'Guidance text describing how to answer the question',
|
||||
},
|
||||
updaterUserId: {
|
||||
type: 'string',
|
||||
description: 'ID of the user who last modified the question',
|
||||
minRange: {
|
||||
type: 'number',
|
||||
description: 'Minimum score for range-type questions',
|
||||
},
|
||||
maxRange: {
|
||||
type: 'number',
|
||||
description: 'Maximum score for range-type questions',
|
||||
},
|
||||
answerOptions: {
|
||||
type: 'array',
|
||||
description: 'Selectable options for select-type questions',
|
||||
items: {
|
||||
type: 'object',
|
||||
properties: {
|
||||
id: { type: 'number', description: 'Identifier of the option' },
|
||||
text: { type: 'string', description: 'Display text of the option' },
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
@@ -65,7 +65,6 @@ export const listTrackersTool: ToolConfig<GongListTrackersParams, GongListTracke
|
||||
saidAtInterval: t.saidAtInterval ?? null,
|
||||
saidAtUnit: t.saidAtUnit ?? null,
|
||||
saidInTopics: t.saidInTopics ?? [],
|
||||
saidInCallParts: t.saidInCallParts ?? [],
|
||||
filterQuery: t.filterQuery ?? null,
|
||||
created: t.created ?? null,
|
||||
creatorUserId: t.creatorUserId ?? null,
|
||||
@@ -74,11 +73,19 @@ export const listTrackersTool: ToolConfig<GongListTrackersParams, GongListTracke
|
||||
}))
|
||||
return {
|
||||
success: true,
|
||||
output: { trackers },
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
trackers,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
trackers: {
|
||||
type: 'array',
|
||||
description: 'List of keyword tracker definitions',
|
||||
@@ -134,10 +141,6 @@ export const listTrackersTool: ToolConfig<GongListTrackersParams, GongListTracke
|
||||
type: 'array',
|
||||
description: 'Topics where keywords should be detected',
|
||||
},
|
||||
saidInCallParts: {
|
||||
type: 'array',
|
||||
description: 'Specific call segments to monitor',
|
||||
},
|
||||
filterQuery: {
|
||||
type: 'string',
|
||||
description: 'JSON-formatted call filtering criteria',
|
||||
|
||||
@@ -39,7 +39,9 @@ export const listUsersTool: ToolConfig<GongListUsersParams, GongListUsersRespons
|
||||
url: (params) => {
|
||||
const url = new URL('https://api.gong.io/v2/users')
|
||||
if (params.cursor?.trim()) url.searchParams.set('cursor', params.cursor.trim())
|
||||
if (params.includeAvatars) url.searchParams.set('includeAvatars', params.includeAvatars)
|
||||
if (params.includeAvatars?.trim().toLowerCase() === 'true') {
|
||||
url.searchParams.set('includeAvatars', 'true')
|
||||
}
|
||||
return url.toString()
|
||||
},
|
||||
method: 'GET',
|
||||
|
||||
@@ -45,11 +45,19 @@ export const listWorkspacesTool: ToolConfig<GongListWorkspacesParams, GongListWo
|
||||
}))
|
||||
return {
|
||||
success: true,
|
||||
output: { workspaces },
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
workspaces,
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
workspaces: {
|
||||
type: 'array',
|
||||
description: 'List of Gong workspaces',
|
||||
|
||||
@@ -35,8 +35,12 @@ export const purgeEmailAddressTool: ToolConfig<
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const emailAddress = params.emailAddress.trim()
|
||||
if (!emailAddress.includes('@')) {
|
||||
throw new Error('emailAddress must be a valid email address')
|
||||
}
|
||||
const url = new URL('https://api.gong.io/v2/data-privacy/erase-data-for-email-address')
|
||||
url.searchParams.set('emailAddress', params.emailAddress.trim())
|
||||
url.searchParams.set('emailAddress', emailAddress)
|
||||
return url.toString()
|
||||
},
|
||||
method: 'POST',
|
||||
|
||||
@@ -36,8 +36,12 @@ export const purgePhoneNumberTool: ToolConfig<
|
||||
|
||||
request: {
|
||||
url: (params) => {
|
||||
const phoneNumber = params.phoneNumber.trim()
|
||||
if (!phoneNumber.startsWith('+')) {
|
||||
throw new Error("phoneNumber must start with '+' followed by the country code")
|
||||
}
|
||||
const url = new URL('https://api.gong.io/v2/data-privacy/erase-data-for-phone-number')
|
||||
url.searchParams.set('phoneNumber', params.phoneNumber.trim())
|
||||
url.searchParams.set('phoneNumber', phoneNumber)
|
||||
return url.toString()
|
||||
},
|
||||
method: 'POST',
|
||||
|
||||
+127
-14
@@ -21,7 +21,7 @@ export interface GongCreateCallParams extends GongBaseParams {
|
||||
primaryUser: string
|
||||
parties: unknown
|
||||
direction: string
|
||||
downloadMediaUrl: string
|
||||
downloadMediaUrl?: string
|
||||
title?: string
|
||||
workspaceId?: string
|
||||
disposition?: string
|
||||
@@ -34,7 +34,6 @@ export interface GongCreateCallResponse extends ToolResponse {
|
||||
output: {
|
||||
callId: string
|
||||
requestId: string
|
||||
url: string | null
|
||||
}
|
||||
}
|
||||
|
||||
@@ -79,7 +78,7 @@ export interface GongListCallsResponse extends ToolResponse {
|
||||
requestId: string | null
|
||||
calls: GongCallBasic[]
|
||||
cursor: string | null
|
||||
totalRecords: number
|
||||
totalRecords: number | null
|
||||
currentPageSize: number | null
|
||||
currentPageNumber: number | null
|
||||
}
|
||||
@@ -91,7 +90,7 @@ export interface GongGetCallParams extends GongBaseParams {
|
||||
}
|
||||
|
||||
export interface GongGetCallResponse extends ToolResponse {
|
||||
output: GongCallBasic
|
||||
output: GongCallBasic & { requestId: string | null }
|
||||
}
|
||||
|
||||
/** Get Call Transcript */
|
||||
@@ -122,6 +121,7 @@ interface GongCallTranscript {
|
||||
|
||||
export interface GongGetCallTranscriptResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
callTranscripts: GongCallTranscript[]
|
||||
cursor: string | null
|
||||
}
|
||||
@@ -148,6 +148,7 @@ interface GongExtensiveCall {
|
||||
|
||||
export interface GongGetExtensiveCallsResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
calls: GongExtensiveCall[]
|
||||
cursor: string | null
|
||||
}
|
||||
@@ -211,6 +212,7 @@ export interface GongGetUserParams extends GongBaseParams {
|
||||
|
||||
export interface GongGetUserResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
id: string
|
||||
emailAddress: string | null
|
||||
created: string | null
|
||||
@@ -260,6 +262,7 @@ interface GongUserActivity {
|
||||
|
||||
export interface GongAggregateActivityResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
usersActivity: GongUserActivity[]
|
||||
timeZone: string | null
|
||||
fromDateTime: string | null
|
||||
@@ -289,6 +292,7 @@ export interface GongInteractionStatsParams extends GongBaseParams {
|
||||
|
||||
export interface GongInteractionStatsResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
peopleInteractionStats: GongUserInteractionStats[]
|
||||
timeZone: string | null
|
||||
fromDateTime: string | null
|
||||
@@ -400,6 +404,7 @@ interface GongScorecardAnswer {
|
||||
score: number | null
|
||||
answerText: string | null
|
||||
notApplicable: boolean | null
|
||||
selectedOptions: string[] | null
|
||||
}
|
||||
|
||||
interface GongAnsweredScorecard {
|
||||
@@ -417,6 +422,7 @@ interface GongAnsweredScorecard {
|
||||
|
||||
export interface GongAnsweredScorecardsResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
answeredScorecards: GongAnsweredScorecard[]
|
||||
cursor: string | null
|
||||
}
|
||||
@@ -437,13 +443,14 @@ interface GongLibraryFolder {
|
||||
|
||||
export interface GongListLibraryFoldersResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
folders: GongLibraryFolder[]
|
||||
}
|
||||
}
|
||||
|
||||
/** Get Folder Content */
|
||||
export interface GongGetFolderContentParams extends GongBaseParams {
|
||||
folderId: string
|
||||
folderId?: string
|
||||
}
|
||||
|
||||
interface GongFolderCallSnippet {
|
||||
@@ -463,6 +470,7 @@ interface GongFolderCall {
|
||||
|
||||
export interface GongGetFolderContentResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
folderId: string | null
|
||||
folderName: string | null
|
||||
createdBy: string | null
|
||||
@@ -474,29 +482,38 @@ export interface GongGetFolderContentResponse extends ToolResponse {
|
||||
/** List Scorecards */
|
||||
export interface GongListScorecardsParams extends GongBaseParams {}
|
||||
|
||||
interface GongScorecardQuestionOption {
|
||||
id: number
|
||||
text: string
|
||||
}
|
||||
|
||||
interface GongScorecardQuestion {
|
||||
questionId: string
|
||||
questionId: number | null
|
||||
questionRevisionId: number | null
|
||||
questionText: string
|
||||
questionRevisionId: string | null
|
||||
isOverall: boolean
|
||||
created: string | null
|
||||
updated: string | null
|
||||
updaterUserId: string | null
|
||||
questionType: string | null
|
||||
answerGuide: string | null
|
||||
minRange: number | null
|
||||
maxRange: number | null
|
||||
answerOptions: GongScorecardQuestionOption[]
|
||||
}
|
||||
|
||||
interface GongScorecard {
|
||||
scorecardId: string
|
||||
scorecardId: number | null
|
||||
scorecardName: string
|
||||
workspaceId: string | null
|
||||
workspaceId: number | null
|
||||
enabled: boolean
|
||||
updaterUserId: string | null
|
||||
updaterUserId: number | null
|
||||
created: string | null
|
||||
updated: string | null
|
||||
reviewMethod: string | null
|
||||
questions: GongScorecardQuestion[]
|
||||
}
|
||||
|
||||
export interface GongListScorecardsResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
scorecards: GongScorecard[]
|
||||
}
|
||||
}
|
||||
@@ -523,7 +540,6 @@ interface GongTracker {
|
||||
saidAtInterval: number | null
|
||||
saidAtUnit: string | null
|
||||
saidInTopics: string[]
|
||||
saidInCallParts: string[]
|
||||
filterQuery: string | null
|
||||
created: string | null
|
||||
creatorUserId: string | null
|
||||
@@ -533,6 +549,7 @@ interface GongTracker {
|
||||
|
||||
export interface GongListTrackersResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
trackers: GongTracker[]
|
||||
}
|
||||
}
|
||||
@@ -548,6 +565,7 @@ interface GongWorkspace {
|
||||
|
||||
export interface GongListWorkspacesResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
workspaces: GongWorkspace[]
|
||||
}
|
||||
}
|
||||
@@ -765,6 +783,97 @@ export interface GongGetProspectFlowsResponse extends ToolResponse {
|
||||
}
|
||||
}
|
||||
|
||||
/** Ask Anything */
|
||||
export interface GongAskAnythingParams extends GongBaseParams {
|
||||
workspaceId: string
|
||||
crmEntityType: string
|
||||
crmEntityId: string
|
||||
question: string
|
||||
timePeriod: string
|
||||
fromDateTime?: string
|
||||
toDateTime?: string
|
||||
}
|
||||
|
||||
interface GongAnswerSection {
|
||||
answerItems: string[]
|
||||
callFindings: Record<string, unknown>[]
|
||||
emailFindings: Record<string, unknown>[]
|
||||
}
|
||||
|
||||
export interface GongAskAnythingResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
numOfCallsSearched: number | null
|
||||
numOfEmailsSearched: number | null
|
||||
answer: GongAnswerSection[]
|
||||
}
|
||||
}
|
||||
|
||||
/** Get Brief */
|
||||
export interface GongGetBriefParams extends GongBaseParams {
|
||||
workspaceId: string
|
||||
briefName: string
|
||||
crmEntityType: string
|
||||
crmEntityId: string
|
||||
timePeriod: string
|
||||
fromDateTime?: string
|
||||
toDateTime?: string
|
||||
}
|
||||
|
||||
export interface GongGetBriefResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
numOfCallsSearched: number | null
|
||||
numOfEmailsSearched: number | null
|
||||
briefSections: Record<string, unknown>[]
|
||||
}
|
||||
}
|
||||
|
||||
/** Unassign Flow Prospects */
|
||||
export interface GongUnassignFlowProspectsParams extends GongBaseParams {
|
||||
crmProspectId: string
|
||||
flowId?: string
|
||||
unassignedByUserEmail?: string
|
||||
}
|
||||
|
||||
export interface GongUnassignFlowProspectsResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
unassignedFlowInstanceIds: string[]
|
||||
}
|
||||
}
|
||||
|
||||
/** Get Logs */
|
||||
export interface GongGetLogsParams extends GongBaseParams {
|
||||
logType: string
|
||||
fromDateTime: string
|
||||
toDateTime?: string
|
||||
cursor?: string
|
||||
}
|
||||
|
||||
interface GongLogEntry {
|
||||
userId: string | null
|
||||
userEmailAddress: string | null
|
||||
userFullName: string | null
|
||||
impersonatorUserId: string | null
|
||||
impersonatorEmailAddress: string | null
|
||||
impersonatorFullName: string | null
|
||||
impersonatorCompanyId: string | null
|
||||
eventTime: string | null
|
||||
logRecord: Record<string, unknown> | null
|
||||
}
|
||||
|
||||
export interface GongGetLogsResponse extends ToolResponse {
|
||||
output: {
|
||||
requestId: string | null
|
||||
logEntries: GongLogEntry[]
|
||||
cursor: string | null
|
||||
totalRecords: number | null
|
||||
currentPageSize: number | null
|
||||
currentPageNumber: number | null
|
||||
}
|
||||
}
|
||||
|
||||
/** Union type for all Gong responses */
|
||||
export type GongResponse =
|
||||
| GongListCallsResponse
|
||||
@@ -792,3 +901,7 @@ export type GongResponse =
|
||||
| GongPurgePhoneNumberResponse
|
||||
| GongAssignFlowProspectsResponse
|
||||
| GongGetProspectFlowsResponse
|
||||
| GongAskAnythingResponse
|
||||
| GongGetBriefResponse
|
||||
| GongUnassignFlowProspectsResponse
|
||||
| GongGetLogsResponse
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
import type {
|
||||
GongUnassignFlowProspectsParams,
|
||||
GongUnassignFlowProspectsResponse,
|
||||
} from '@/tools/gong/types'
|
||||
import { getGongErrorMessage } from '@/tools/gong/utils'
|
||||
import type { ToolConfig } from '@/tools/types'
|
||||
|
||||
export const unassignFlowProspectsTool: ToolConfig<
|
||||
GongUnassignFlowProspectsParams,
|
||||
GongUnassignFlowProspectsResponse
|
||||
> = {
|
||||
id: 'gong_unassign_flow_prospects',
|
||||
name: 'Gong Unassign Flow Prospects',
|
||||
description:
|
||||
'Remove a prospect from Gong Engage flows. Omit the flow ID to remove the prospect from all flows they are assigned to.',
|
||||
version: '1.0.0',
|
||||
|
||||
params: {
|
||||
accessKey: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'Gong API Access Key',
|
||||
},
|
||||
accessKeySecret: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-only',
|
||||
description: 'Gong API Access Key Secret',
|
||||
},
|
||||
crmProspectId: {
|
||||
type: 'string',
|
||||
required: true,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'The CRM ID of the prospect to unassign',
|
||||
},
|
||||
flowId: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description:
|
||||
'The ID of the flow to unassign the prospect from. If omitted, the prospect is removed from all flows they are assigned to.',
|
||||
},
|
||||
unassignedByUserEmail: {
|
||||
type: 'string',
|
||||
required: false,
|
||||
visibility: 'user-or-llm',
|
||||
description: 'Email address of the Gong user requesting to remove the prospect from the flow',
|
||||
},
|
||||
},
|
||||
|
||||
request: {
|
||||
url: 'https://api.gong.io/v2/flows/prospects/unassign-flows-by-crm-id',
|
||||
method: 'POST',
|
||||
headers: (params) => ({
|
||||
'Content-Type': 'application/json',
|
||||
Authorization: `Basic ${btoa(`${params.accessKey}:${params.accessKeySecret}`)}`,
|
||||
}),
|
||||
body: (params) => {
|
||||
const body: Record<string, unknown> = {
|
||||
crmProspectId: params.crmProspectId.trim(),
|
||||
}
|
||||
if (params.flowId?.trim()) body.flowId = params.flowId.trim()
|
||||
if (params.unassignedByUserEmail?.trim()) {
|
||||
body.unassignedByUserEmail = params.unassignedByUserEmail.trim()
|
||||
}
|
||||
return body
|
||||
},
|
||||
},
|
||||
|
||||
transformResponse: async (response: Response) => {
|
||||
const data = await response.json()
|
||||
if (!response.ok) {
|
||||
throw new Error(getGongErrorMessage(data, 'Failed to unassign prospect from flows'))
|
||||
}
|
||||
return {
|
||||
success: true,
|
||||
output: {
|
||||
requestId: data.requestId ?? null,
|
||||
unassignedFlowInstanceIds: data.unassignedFlowInstanceIds ?? [],
|
||||
},
|
||||
}
|
||||
},
|
||||
|
||||
outputs: {
|
||||
requestId: {
|
||||
type: 'string',
|
||||
description: 'A Gong request reference ID for troubleshooting purposes',
|
||||
optional: true,
|
||||
},
|
||||
unassignedFlowInstanceIds: {
|
||||
type: 'array',
|
||||
description: 'IDs of the flow instances the prospect was successfully removed from',
|
||||
items: { type: 'string' },
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -1287,14 +1287,17 @@ import {
|
||||
gongAggregateActivityTool,
|
||||
gongAggregateByPeriodTool,
|
||||
gongAnsweredScorecardsTool,
|
||||
gongAskAnythingTool,
|
||||
gongAssignFlowProspectsTool,
|
||||
gongCreateCallTool,
|
||||
gongDayByDayActivityTool,
|
||||
gongGetBriefTool,
|
||||
gongGetCallTool,
|
||||
gongGetCallTranscriptTool,
|
||||
gongGetCoachingTool,
|
||||
gongGetExtensiveCallsTool,
|
||||
gongGetFolderContentTool,
|
||||
gongGetLogsTool,
|
||||
gongGetProspectFlowsTool,
|
||||
gongGetUserTool,
|
||||
gongInteractionStatsTool,
|
||||
@@ -1309,6 +1312,7 @@ import {
|
||||
gongLookupPhoneTool,
|
||||
gongPurgeEmailAddressTool,
|
||||
gongPurgePhoneNumberTool,
|
||||
gongUnassignFlowProspectsTool,
|
||||
} from '@/tools/gong'
|
||||
import { googleSearchTool } from '@/tools/google'
|
||||
import {
|
||||
@@ -4769,14 +4773,17 @@ export const tools: Record<string, ToolConfig> = {
|
||||
gong_aggregate_activity: gongAggregateActivityTool,
|
||||
gong_aggregate_by_period: gongAggregateByPeriodTool,
|
||||
gong_answered_scorecards: gongAnsweredScorecardsTool,
|
||||
gong_ask_anything: gongAskAnythingTool,
|
||||
gong_assign_flow_prospects: gongAssignFlowProspectsTool,
|
||||
gong_create_call: gongCreateCallTool,
|
||||
gong_day_by_day_activity: gongDayByDayActivityTool,
|
||||
gong_get_brief: gongGetBriefTool,
|
||||
gong_get_call: gongGetCallTool,
|
||||
gong_get_call_transcript: gongGetCallTranscriptTool,
|
||||
gong_get_coaching: gongGetCoachingTool,
|
||||
gong_get_extensive_calls: gongGetExtensiveCallsTool,
|
||||
gong_get_folder_content: gongGetFolderContentTool,
|
||||
gong_get_logs: gongGetLogsTool,
|
||||
gong_get_prospect_flows: gongGetProspectFlowsTool,
|
||||
gong_get_user: gongGetUserTool,
|
||||
gong_interaction_stats: gongInteractionStatsTool,
|
||||
@@ -4791,6 +4798,7 @@ export const tools: Record<string, ToolConfig> = {
|
||||
gong_lookup_phone: gongLookupPhoneTool,
|
||||
gong_purge_email_address: gongPurgeEmailAddressTool,
|
||||
gong_purge_phone_number: gongPurgePhoneNumberTool,
|
||||
gong_unassign_flow_prospects: gongUnassignFlowProspectsTool,
|
||||
grafana_get_dashboard: grafanaGetDashboardTool,
|
||||
grafana_list_dashboards: grafanaListDashboardsTool,
|
||||
grafana_create_dashboard: grafanaCreateDashboardTool,
|
||||
|
||||
Reference in New Issue
Block a user