From f60cbe1bbd62112f7b64fa5977f2acec6b61a308 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 13 Jul 2026 10:38:51 -0700 Subject: [PATCH 1/3] 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 --- apps/sim/blocks/blocks/gong.ts | 232 +++++++++++++++++- apps/sim/tools/gong/aggregate_activity.ts | 6 + apps/sim/tools/gong/aggregate_by_period.ts | 2 +- apps/sim/tools/gong/answered_scorecards.ts | 15 +- apps/sim/tools/gong/ask_anything.ts | 153 ++++++++++++ apps/sim/tools/gong/create_call.ts | 15 +- apps/sim/tools/gong/get_brief.ts | 152 ++++++++++++ apps/sim/tools/gong/get_call.ts | 6 + apps/sim/tools/gong/get_call_transcript.ts | 6 + apps/sim/tools/gong/get_extensive_calls.ts | 6 + apps/sim/tools/gong/get_folder_content.ts | 6 + apps/sim/tools/gong/get_logs.ts | 162 ++++++++++++ apps/sim/tools/gong/get_user.ts | 8 +- apps/sim/tools/gong/index.ts | 8 + apps/sim/tools/gong/interaction_stats.ts | 6 + apps/sim/tools/gong/list_calls.ts | 3 +- apps/sim/tools/gong/list_flows.ts | 4 +- apps/sim/tools/gong/list_library_folders.ts | 10 +- apps/sim/tools/gong/list_scorecards.ts | 70 ++++-- apps/sim/tools/gong/list_trackers.ts | 10 +- apps/sim/tools/gong/list_users.ts | 4 +- apps/sim/tools/gong/list_workspaces.ts | 10 +- apps/sim/tools/gong/purge_email_address.ts | 6 +- apps/sim/tools/gong/purge_phone_number.ts | 6 +- apps/sim/tools/gong/types.ts | 138 ++++++++++- .../sim/tools/gong/unassign_flow_prospects.ts | 97 ++++++++ apps/sim/tools/registry.ts | 8 + 27 files changed, 1093 insertions(+), 56 deletions(-) create mode 100644 apps/sim/tools/gong/ask_anything.ts create mode 100644 apps/sim/tools/gong/get_brief.ts create mode 100644 apps/sim/tools/gong/get_logs.ts create mode 100644 apps/sim/tools/gong/unassign_flow_prospects.ts diff --git a/apps/sim/blocks/blocks/gong.ts b/apps/sim/blocks/blocks/gong.ts index 7a28123fa3a..a862d315253 100644 --- a/apps/sim/blocks/blocks/gong.ts +++ b/apps/sim/blocks/blocks/gong.ts @@ -44,8 +44,12 @@ export const GongBlock: BlockConfig = { { 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', @@ -590,9 +593,28 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`, title: 'Flow ID', type: 'short-input', placeholder: 'Enter the Gong Engage flow ID', - condition: { field: 'operation', value: 'assign_flow_prospects' }, + condition: { + field: 'operation', + value: ['assign_flow_prospects', 'unassign_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: '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 +698,154 @@ 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 (required for custom range)', + condition: { field: 'operation', value: ['ask_anything', 'get_brief'] }, + 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 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 (required for custom range)', + condition: { field: 'operation', value: ['ask_anything', 'get_brief'] }, + 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., "end of last quarter")...', + generationType: 'timestamp', + }, + }, + + // Get Logs inputs + { + id: 'logType', + title: 'Log Type', + type: 'short-input', + placeholder: 'Type of logs to retrieve', + 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 +885,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 +930,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', @@ -782,6 +957,11 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes if (params.coachingWorkspaceId) result.workspaceId = params.coachingWorkspaceId if (params.coachingFromDate) result.fromDate = params.coachingFromDate if (params.coachingToDate) result.toDate = params.coachingToDate + if (params.entityWorkspaceId) result.workspaceId = params.entityWorkspaceId + if (params.entityFromDateTime) result.fromDateTime = params.entityFromDateTime + if (params.entityToDateTime) result.toDateTime = params.entityToDateTime + if (params.logsFromDateTime) result.fromDateTime = params.logsFromDateTime + if (params.logsToDateTime) result.toDateTime = params.logsToDateTime return result }, }, @@ -835,6 +1015,23 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes }, 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' }, + 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', @@ -983,6 +1180,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', diff --git a/apps/sim/tools/gong/aggregate_activity.ts b/apps/sim/tools/gong/aggregate_activity.ts index d7708966d30..66dd10f3432 100644 --- a/apps/sim/tools/gong/aggregate_activity.ts +++ b/apps/sim/tools/gong/aggregate_activity.ts @@ -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', diff --git a/apps/sim/tools/gong/aggregate_by_period.ts b/apps/sim/tools/gong/aggregate_by_period.ts index cc8b0576c7f..3ae39316a3a 100644 --- a/apps/sim/tools/gong/aggregate_by_period.ts +++ b/apps/sim/tools/gong/aggregate_by_period.ts @@ -74,7 +74,7 @@ export const aggregateByPeriodTool: ToolConfig< const userIds = parseGongIdList(params.userIds) if (userIds) filter.userIds = userIds const body: Record = { - aggregationPeriod: params.aggregationPeriod.trim(), + aggregationPeriod: params.aggregationPeriod.trim().toUpperCase(), filter, } if (params.cursor?.trim()) body.cursor = params.cursor.trim() diff --git a/apps/sim/tools/gong/answered_scorecards.ts b/apps/sim/tools/gong/answered_scorecards.ts index 92e105fdc55..1362f3c7825 100644 --- a/apps/sim/tools/gong/answered_scorecards.ts +++ b/apps/sim/tools/gong/answered_scorecards.ts @@ -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' }, + }, }, }, }, diff --git a/apps/sim/tools/gong/ask_anything.ts b/apps/sim/tools/gong/ask_anything.ts new file mode 100644 index 00000000000..ea06337e386 --- /dev/null +++ b/apps/sim/tools/gong/ask_anything.ts @@ -0,0 +1,153 @@ +import type { GongAskAnythingParams, GongAskAnythingResponse } from '@/tools/gong/types' +import { getGongErrorMessage } from '@/tools/gong/utils' +import type { ToolConfig } from '@/tools/types' + +export const askAnythingTool: ToolConfig = { + 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 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', params.timePeriod.trim().toUpperCase()) + url.searchParams.set('question', params.question.trim()) + if (params.fromDateTime?.trim()) + url.searchParams.set('fromDateTime', params.fromDateTime.trim()) + if (params.toDateTime?.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) => ({ + 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' }, + }, + }, + }, + }, + }, +} diff --git a/apps/sim/tools/gong/create_call.ts b/apps/sim/tools/gong/create_call.ts index 5a2c35f0858..c029e437a1c 100644 --- a/apps/sim/tools/gong/create_call.ts +++ b/apps/sim/tools/gong/create_call.ts @@ -53,9 +53,10 @@ export const createCallTool: ToolConfig = { + 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 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', params.timePeriod.trim().toUpperCase()) + if (params.fromDateTime?.trim()) + url.searchParams.set('fromDateTime', params.fromDateTime.trim()) + if (params.toDateTime?.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' }, + }, + }, + }, + }, + }, +} diff --git a/apps/sim/tools/gong/get_call.ts b/apps/sim/tools/gong/get_call.ts index 35b31585248..bab1deb47c6 100644 --- a/apps/sim/tools/gong/get_call.ts +++ b/apps/sim/tools/gong/get_call.ts @@ -47,6 +47,7 @@ export const getCallTool: ToolConfig = { 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 = { }, 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 }, diff --git a/apps/sim/tools/gong/get_call_transcript.ts b/apps/sim/tools/gong/get_call_transcript.ts index ddd26bfb6e6..531b96354ca 100644 --- a/apps/sim/tools/gong/get_call_transcript.ts +++ b/apps/sim/tools/gong/get_call_transcript.ts @@ -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', diff --git a/apps/sim/tools/gong/get_extensive_calls.ts b/apps/sim/tools/gong/get_extensive_calls.ts index 0ed7e8995ad..10cd4f3ec9f 100644 --- a/apps/sim/tools/gong/get_extensive_calls.ts +++ b/apps/sim/tools/gong/get_extensive_calls.ts @@ -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: diff --git a/apps/sim/tools/gong/get_folder_content.ts b/apps/sim/tools/gong/get_folder_content.ts index 65a91da7843..8f7f7852bf9 100644 --- a/apps/sim/tools/gong/get_folder_content.ts +++ b/apps/sim/tools/gong/get_folder_content.ts @@ -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", diff --git a/apps/sim/tools/gong/get_logs.ts b/apps/sim/tools/gong/get_logs.ts new file mode 100644 index 00000000000..02730a33573 --- /dev/null +++ b/apps/sim/tools/gong/get_logs.ts @@ -0,0 +1,162 @@ +import type { GongGetLogsParams, GongGetLogsResponse } from '@/tools/gong/types' +import { getGongErrorMessage } from '@/tools/gong/utils' +import type { ToolConfig } from '@/tools/types' + +export const getLogsTool: ToolConfig = { + 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, as defined in the Gong logs documentation', + }, + 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) => ({ + 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, + }, + }, +} diff --git a/apps/sim/tools/gong/get_user.ts b/apps/sim/tools/gong/get_user.ts index 6c5be146d69..d5069a814b9 100644 --- a/apps/sim/tools/gong/get_user.ts +++ b/apps/sim/tools/gong/get_user.ts @@ -30,7 +30,7 @@ export const getUserTool: ToolConfig = { }, 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 = { 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 = { }, 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 }, diff --git a/apps/sim/tools/gong/index.ts b/apps/sim/tools/gong/index.ts index 0d67c6a583c..fdf2df51a96 100644 --- a/apps/sim/tools/gong/index.ts +++ b/apps/sim/tools/gong/index.ts @@ -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' diff --git a/apps/sim/tools/gong/interaction_stats.ts b/apps/sim/tools/gong/interaction_stats.ts index b01da11cd5f..f2aa7421815 100644 --- a/apps/sim/tools/gong/interaction_stats.ts +++ b/apps/sim/tools/gong/interaction_stats.ts @@ -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: diff --git a/apps/sim/tools/gong/list_calls.ts b/apps/sim/tools/gong/list_calls.ts index 655bed2966d..2fbf6982164 100644 --- a/apps/sim/tools/gong/list_calls.ts +++ b/apps/sim/tools/gong/list_calls.ts @@ -97,7 +97,7 @@ export const listCallsTool: ToolConfig { 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() }, diff --git a/apps/sim/tools/gong/list_library_folders.ts b/apps/sim/tools/gong/list_library_folders.ts index e3d77b9a7a5..363e204fc80 100644 --- a/apps/sim/tools/gong/list_library_folders.ts +++ b/apps/sim/tools/gong/list_library_folders.ts @@ -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', diff --git a/apps/sim/tools/gong/list_scorecards.ts b/apps/sim/tools/gong/list_scorecards.ts index c08fb1a018a..5cecdd841d7 100644 --- a/apps/sim/tools/gong/list_scorecards.ts +++ b/apps/sim/tools/gong/list_scorecards.ts @@ -39,47 +39,58 @@ export const listScorecardsTool: ToolConfig) => ({ - 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[] | undefined) ?? []).map( (q: Record) => ({ - 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 { 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', diff --git a/apps/sim/tools/gong/list_workspaces.ts b/apps/sim/tools/gong/list_workspaces.ts index 0611c1f3c22..1ce34604660 100644 --- a/apps/sim/tools/gong/list_workspaces.ts +++ b/apps/sim/tools/gong/list_workspaces.ts @@ -45,11 +45,19 @@ export const listWorkspacesTool: ToolConfig { + 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', diff --git a/apps/sim/tools/gong/purge_phone_number.ts b/apps/sim/tools/gong/purge_phone_number.ts index 3109f0b84ab..d1baa578f28 100644 --- a/apps/sim/tools/gong/purge_phone_number.ts +++ b/apps/sim/tools/gong/purge_phone_number.ts @@ -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', diff --git a/apps/sim/tools/gong/types.ts b/apps/sim/tools/gong/types.ts index 31143bd1577..a41e08a9f7f 100644 --- a/apps/sim/tools/gong/types.ts +++ b/apps/sim/tools/gong/types.ts @@ -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,6 +443,7 @@ interface GongLibraryFolder { export interface GongListLibraryFoldersResponse extends ToolResponse { output: { + requestId: string | null folders: GongLibraryFolder[] } } @@ -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[] } } @@ -533,6 +550,7 @@ interface GongTracker { export interface GongListTrackersResponse extends ToolResponse { output: { + requestId: string | null trackers: GongTracker[] } } @@ -548,6 +566,7 @@ interface GongWorkspace { export interface GongListWorkspacesResponse extends ToolResponse { output: { + requestId: string | null workspaces: GongWorkspace[] } } @@ -765,6 +784,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[] + emailFindings: Record[] +} + +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[] + } +} + +/** 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 | 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 +902,7 @@ export type GongResponse = | GongPurgePhoneNumberResponse | GongAssignFlowProspectsResponse | GongGetProspectFlowsResponse + | GongAskAnythingResponse + | GongGetBriefResponse + | GongUnassignFlowProspectsResponse + | GongGetLogsResponse diff --git a/apps/sim/tools/gong/unassign_flow_prospects.ts b/apps/sim/tools/gong/unassign_flow_prospects.ts new file mode 100644 index 00000000000..72351a39811 --- /dev/null +++ b/apps/sim/tools/gong/unassign_flow_prospects.ts @@ -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 = { + 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' }, + }, + }, +} diff --git a/apps/sim/tools/registry.ts b/apps/sim/tools/registry.ts index e6f33250a0d..53ee68bd10d 100644 --- a/apps/sim/tools/registry.ts +++ b/apps/sim/tools/registry.ts @@ -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 = { 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 = { 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, From 4554be56c54c84a2fb2f14786a603144ab11e048 Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 13 Jul 2026 10:50:27 -0700 Subject: [PATCH 2/3] 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 --- apps/sim/blocks/blocks/gong.ts | 77 ++++++++++++++++++++--------- apps/sim/tools/gong/ask_anything.ts | 9 +++- apps/sim/tools/gong/get_brief.ts | 9 +++- 3 files changed, 70 insertions(+), 25 deletions(-) diff --git a/apps/sim/blocks/blocks/gong.ts b/apps/sim/blocks/blocks/gong.ts index a862d315253..47c651fa7f2 100644 --- a/apps/sim/blocks/blocks/gong.ts +++ b/apps/sim/blocks/blocks/gong.ts @@ -771,9 +771,17 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes id: 'entityFromDateTime', title: 'From Date/Time', type: 'short-input', - placeholder: '2024-01-01T00:00:00Z (required for custom range)', - condition: { field: 'operation', value: ['ask_anything', 'get_brief'] }, - mode: 'advanced', + 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. @@ -788,9 +796,17 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes id: 'entityToDateTime', title: 'To Date/Time', type: 'short-input', - placeholder: '2024-01-31T23:59:59Z (required for custom range)', - condition: { field: 'operation', value: ['ask_anything', 'get_brief'] }, - mode: 'advanced', + 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. @@ -945,23 +961,38 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes tool: (params) => `gong_${params.operation}`, params: (params) => { const result: Record = {} - // 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 - if (params.entityWorkspaceId) result.workspaceId = params.entityWorkspaceId - if (params.entityFromDateTime) result.fromDateTime = params.entityFromDateTime - if (params.entityToDateTime) result.toDateTime = params.entityToDateTime - if (params.logsFromDateTime) result.fromDateTime = params.logsFromDateTime - if (params.logsToDateTime) result.toDateTime = params.logsToDateTime + // 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 + } return result }, }, diff --git a/apps/sim/tools/gong/ask_anything.ts b/apps/sim/tools/gong/ask_anything.ts index ea06337e386..8ffdd371e57 100644 --- a/apps/sim/tools/gong/ask_anything.ts +++ b/apps/sim/tools/gong/ask_anything.ts @@ -71,11 +71,18 @@ export const askAnythingTool: ToolConfig { + 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', params.timePeriod.trim().toUpperCase()) + url.searchParams.set('timePeriod', timePeriod) url.searchParams.set('question', params.question.trim()) if (params.fromDateTime?.trim()) url.searchParams.set('fromDateTime', params.fromDateTime.trim()) diff --git a/apps/sim/tools/gong/get_brief.ts b/apps/sim/tools/gong/get_brief.ts index 439e3e3c06a..1b0ffd6d3db 100644 --- a/apps/sim/tools/gong/get_brief.ts +++ b/apps/sim/tools/gong/get_brief.ts @@ -71,12 +71,19 @@ export const getBriefTool: ToolConfig 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', params.timePeriod.trim().toUpperCase()) + url.searchParams.set('timePeriod', timePeriod) if (params.fromDateTime?.trim()) url.searchParams.set('fromDateTime', params.fromDateTime.trim()) if (params.toDateTime?.trim()) url.searchParams.set('toDateTime', params.toDateTime.trim()) From f95748c55642795a8cf6fcab896d2ae246260afa Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Mon, 13 Jul 2026 11:07:25 -0700 Subject: [PATCH 3/3] 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) --- .../content/docs/en/integrations/gong.mdx | 170 ++++++++++++++++-- apps/sim/blocks/blocks/gong.ts | 70 +++++++- apps/sim/lib/integrations/integrations.json | 18 +- apps/sim/tools/gong/answered_scorecards.ts | 1 + apps/sim/tools/gong/ask_anything.ts | 7 +- apps/sim/tools/gong/get_brief.ts | 11 +- apps/sim/tools/gong/get_call.ts | 2 +- apps/sim/tools/gong/get_coaching.ts | 1 + apps/sim/tools/gong/get_extensive_calls.ts | 18 +- apps/sim/tools/gong/get_folder_content.ts | 6 +- apps/sim/tools/gong/get_logs.ts | 3 +- apps/sim/tools/gong/index.ts | 2 +- apps/sim/tools/gong/list_flows.ts | 4 + apps/sim/tools/gong/list_trackers.ts | 5 - apps/sim/tools/gong/types.ts | 3 +- 15 files changed, 259 insertions(+), 62 deletions(-) diff --git a/apps/docs/content/docs/en/integrations/gong.mdx b/apps/docs/content/docs/en/integrations/gong.mdx index 6d111ddc52c..8cbaa076301 100644 --- a/apps/docs/content/docs/en/integrations/gong.mdx +++ b/apps/docs/content/docs/en/integrations/gong.mdx @@ -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). diff --git a/apps/sim/blocks/blocks/gong.ts b/apps/sim/blocks/blocks/gong.ts index 47c651fa7f2..73b44d599d6 100644 --- a/apps/sim/blocks/blocks/gong.ts +++ b/apps/sim/blocks/blocks/gong.ts @@ -551,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,10 +592,7 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`, title: 'Flow ID', type: 'short-input', placeholder: 'Enter the Gong Engage flow ID', - condition: { - field: 'operation', - value: ['assign_flow_prospects', 'unassign_flow_prospects'], - }, + condition: { field: 'operation', value: 'assign_flow_prospects' }, required: { field: 'operation', value: 'assign_flow_prospects' }, }, { @@ -607,6 +603,13 @@ Return ONLY the comma-separated list of IDs - no explanations, no extra text.`, 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', @@ -822,8 +825,15 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes { id: 'logType', title: 'Log Type', - type: 'short-input', - placeholder: 'Type of logs to retrieve', + 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' }, }, @@ -993,6 +1003,9 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes 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 }, }, @@ -1019,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: { @@ -1040,6 +1065,29 @@ 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', @@ -1047,6 +1095,10 @@ Return ONLY the timestamp string in ISO 8601 format - no explanations, no quotes 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', @@ -1096,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' }, diff --git a/apps/sim/lib/integrations/integrations.json b/apps/sim/lib/integrations/integrations.json index 98849d6a9a4..b077fd0747d 100644 --- a/apps/sim/lib/integrations/integrations.json +++ b/apps/sim/lib/integrations/integrations.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", diff --git a/apps/sim/tools/gong/answered_scorecards.ts b/apps/sim/tools/gong/answered_scorecards.ts index 1362f3c7825..8b426ebb17a 100644 --- a/apps/sim/tools/gong/answered_scorecards.ts +++ b/apps/sim/tools/gong/answered_scorecards.ts @@ -215,6 +215,7 @@ export const answeredScorecardsTool: ToolConfig< cursor: { type: 'string', description: 'Pagination cursor for the next page', + optional: true, }, }, } diff --git a/apps/sim/tools/gong/ask_anything.ts b/apps/sim/tools/gong/ask_anything.ts index 8ffdd371e57..7826ac93f9f 100644 --- a/apps/sim/tools/gong/ask_anything.ts +++ b/apps/sim/tools/gong/ask_anything.ts @@ -84,9 +84,10 @@ export const askAnythingTool: ToolConfig url.searchParams.set('crmEntityType', params.crmEntityType.trim().toUpperCase()) url.searchParams.set('crmEntityId', params.crmEntityId.trim()) url.searchParams.set('timePeriod', timePeriod) - if (params.fromDateTime?.trim()) - url.searchParams.set('fromDateTime', params.fromDateTime.trim()) - if (params.toDateTime?.trim()) url.searchParams.set('toDateTime', params.toDateTime.trim()) + if (timePeriod === 'CUSTOM_RANGE') { + url.searchParams.set('fromDateTime', params.fromDateTime?.trim() ?? '') + url.searchParams.set('toDateTime', params.toDateTime?.trim() ?? '') + } return url.toString() }, method: 'GET', @@ -152,6 +153,10 @@ export const getBriefTool: ToolConfig 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', + }, }, }, }, diff --git a/apps/sim/tools/gong/get_call.ts b/apps/sim/tools/gong/get_call.ts index bab1deb47c6..a3011b08ded 100644 --- a/apps/sim/tools/gong/get_call.ts +++ b/apps/sim/tools/gong/get_call.ts @@ -30,7 +30,7 @@ export const getCallTool: ToolConfig = { }, 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', diff --git a/apps/sim/tools/gong/get_coaching.ts b/apps/sim/tools/gong/get_coaching.ts index 21b0323131b..dadf32e044f 100644 --- a/apps/sim/tools/gong/get_coaching.ts +++ b/apps/sim/tools/gong/get_coaching.ts @@ -115,6 +115,7 @@ export const getCoachingTool: ToolConfig { 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', diff --git a/apps/sim/tools/gong/get_logs.ts b/apps/sim/tools/gong/get_logs.ts index 02730a33573..1f372c70140 100644 --- a/apps/sim/tools/gong/get_logs.ts +++ b/apps/sim/tools/gong/get_logs.ts @@ -25,7 +25,8 @@ export const getLogsTool: ToolConfig = { type: 'string', required: true, visibility: 'user-or-llm', - description: 'Type of logs requested, as defined in the Gong logs documentation', + description: + 'Type of logs requested: AccessLog, UserActivityLog, UserCallPlay, ExternallySharedCallAccess, or ExternallySharedCallPlay', }, fromDateTime: { type: 'string', diff --git a/apps/sim/tools/gong/index.ts b/apps/sim/tools/gong/index.ts index fdf2df51a96..f75671a9ee1 100644 --- a/apps/sim/tools/gong/index.ts +++ b/apps/sim/tools/gong/index.ts @@ -58,4 +58,4 @@ export const gongGetBriefTool = getBriefTool export const gongUnassignFlowProspectsTool = unassignFlowProspectsTool export const gongGetLogsTool = getLogsTool -export * from './types' +export * from '@/tools/gong/types' diff --git a/apps/sim/tools/gong/list_flows.ts b/apps/sim/tools/gong/list_flows.ts index 94bdc42b788..0b9393e1f04 100644 --- a/apps/sim/tools/gong/list_flows.ts +++ b/apps/sim/tools/gong/list_flows.ts @@ -89,6 +89,7 @@ export const listFlowsTool: ToolConfig