search_calls
Search Gong.io sales calls using filters like date range, user IDs, or specific call IDs to find relevant conversations for analysis.
Instructions
Search for calls with various filters including date range, user IDs, and specific call IDs.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fromDateTime | No | Start date/time filter in ISO 8601 format | |
| toDateTime | No | End date/time filter in ISO 8601 format | |
| primaryUserIds | No | Filter by primary user IDs (the call hosts) | |
| callIds | No | Filter by specific call IDs | |
| cursor | No | Pagination cursor for fetching next page of results |
Implementation Reference
- src/gong.ts:383-418 (handler)Core handler function that implements the search_calls tool logic by building a filter from options (date range, users, call IDs, cursor) and calling the Gong API POST /v2/calls/extensive.async searchCalls(options?: { fromDateTime?: string; toDateTime?: string; workspaceId?: string; primaryUserIds?: string[]; callIds?: string[]; cursor?: string; }): Promise<CallDetailsResponse> { const body: Record<string, unknown> = { filter: {}, }; if (options?.fromDateTime) { (body.filter as Record<string, unknown>).fromDateTime = options.fromDateTime; } if (options?.toDateTime) { (body.filter as Record<string, unknown>).toDateTime = options.toDateTime; } if (options?.workspaceId) { (body.filter as Record<string, unknown>).workspaceId = options.workspaceId; } if (options?.primaryUserIds?.length) { (body.filter as Record<string, unknown>).primaryUserIds = options.primaryUserIds; } if (options?.callIds?.length) { (body.filter as Record<string, unknown>).callIds = options.callIds; } if (options?.cursor) { body.cursor = options.cursor; } return this.request<CallDetailsResponse>('POST', '/calls/extensive', body); }
- src/index.ts:115-146 (registration)Registration of the search_calls tool in the MCP server's listTools handler, defining name, description, and input schema.{ name: "search_calls", description: "Search for calls with various filters including date range, user IDs, and specific call IDs.", inputSchema: { type: "object", properties: { fromDateTime: { type: "string", description: "Start date/time filter in ISO 8601 format", }, toDateTime: { type: "string", description: "End date/time filter in ISO 8601 format", }, primaryUserIds: { type: "array", items: { type: "string" }, description: "Filter by primary user IDs (the call hosts)", }, callIds: { type: "array", items: { type: "string" }, description: "Filter by specific call IDs", }, cursor: { type: "string", description: "Pagination cursor for fetching next page of results", }, }, }, },
- src/index.ts:219-235 (handler)MCP CallToolRequest handler case for search_calls: delegates to GongClient.searchCalls and returns JSON-formatted result as text content.case "search_calls": { const result = await gong.searchCalls({ fromDateTime: args?.fromDateTime as string | undefined, toDateTime: args?.toDateTime as string | undefined, primaryUserIds: args?.primaryUserIds as string[] | undefined, callIds: args?.callIds as string[] | undefined, cursor: args?.cursor as string | undefined, }); return { content: [ { type: "text", text: JSON.stringify(result, null, 2), }, ], }; }