Skip to content

Commit 62f7ec4

Browse files
authored
Add conversation transcription tool (#20)
1 parent 7dd30d6 commit 62f7ec4

32 files changed

+1122
-225
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ in the [tools doc](/docs/tools.md).
1919
| [Conversation Sentiment](/docs/tools.md#conversation-sentiment) | Retrieves the sentiment for one or more conversations by ID |
2020
| [Conversation Topics](/docs/tools.md#conversation-topics) | Retrieves the topics for a conversation by ID |
2121
| [Search Voice Conversation](/docs/tools.md#search-voice-conversations) | Searches voice conversations by optional criteria |
22+
| [Conversation Transcript](/docs/tools.md#conversation-transcript) | Retrieves conversation transcript |
2223

2324
## Authentication
2425

docs/tools.md

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ Platform API endpoint used:
3737

3838
Returns a breakdown of how many conversations occurred in each specified queue between two dates. Useful for comparing workload across queues.
3939

40-
[Source file](/src/tools/queryQueueVolumes.ts).
40+
[Source file](/src/tools/queryQueueVolumes/queryQueueVolumes.ts).
4141

4242
### Inputs
4343

@@ -69,7 +69,7 @@ Retrieves conversation analytics for a specific queue between two dates, returni
6969
### Inputs
7070

7171
- `queueId`
72-
- The UUID ID of the queue to filter conversations by. (e.g., 00000000-0000-0000-0000-000000000000)
72+
- The UUID of the queue to filter conversations by. (e.g., 00000000-0000-0000-0000-000000000000)
7373
- `startDate`
7474
- The start date/time in ISO-8601 format (e.g., '2024-01-01T00:00:00Z')
7575
- `endDate`
@@ -118,7 +118,7 @@ Platform API endpoint used:
118118

119119
Retrieves sentiment analysis scores for one or more conversations. Sentiment is evaluated based on customer phrases, categorized as positive, neutral, or negative. The result includes both a numeric sentiment score (-100 to 100) and an interpreted sentiment label.
120120

121-
[Source file](/src/tools/conversationSentiment.ts).
121+
[Source file](/src/tools/conversationSentiment/conversationSentiment.ts).
122122

123123
### Inputs
124124

@@ -144,12 +144,12 @@ Retrieves Speech and Text Analytics topics detected for a specific conversation.
144144

145145
Read more [about programs, topics, and phrases](https://help.mypurecloud.com/articles/about-programs-topics-and-phrases/).
146146

147-
[Source file](/src/tools/conversationTopics.ts).
147+
[Source file](/src/tools/conversationTopics/conversationTopics.ts).
148148

149149
### Input
150150

151151
- `conversationId`
152-
- A UUID ID for a conversation. (e.g., 00000000-0000-0000-0000-000000000000)
152+
- A UUID for a conversation. (e.g., 00000000-0000-0000-0000-000000000000)
153153

154154
### Security
155155

@@ -195,3 +195,28 @@ Required Permissions:
195195
Platform API endpoints used:
196196

197197
- [POST /api/v2/analytics/conversations/details/query](https://developer.genesys.cloud/devapps/api-explorer-standalone#post-api-v2-analytics-conversations-details-query)
198+
199+
## Conversation Transcript
200+
201+
**Tool name:** `conversation_transcript`
202+
203+
Retrieves a structured transcript of the conversation, including speaker labels, utterance timestamps, and sentiment annotations where available. The transcript is formatted as a time-aligned list of utterances attributed to each participant (e.g., customer or agent)
204+
205+
[Source file](/src/tools/conversationTranscription/conversationTranscription.ts).
206+
207+
### Input
208+
209+
- `conversationId`
210+
- The UUID of the conversation to retrieve the transcript for (e.g., 00000000-0000-0000-0000-000000000000)
211+
212+
### Security
213+
214+
Required Permissions:
215+
216+
- `recording:recording:view`
217+
- `speechAndTextAnalytics:data:view`
218+
219+
Platform API endpoints used:
220+
221+
- [GET /api/v2/conversations/{conversationId}/recordings](https://developer.genesys.cloud/devapps/api-explorer-standalone#get-api-v2-conversations--conversationId--recordings)
222+
- [GET /api/v2/speechandtextanalytics/conversations/{conversationId}/communications/{communicationId}/transcripturl](https://developer.genesys.cloud/devapps/api-explorer-standalone#get-api-v2-speechandtextanalytics-conversations--conversationId--communications--communicationId--transcripturl)

package-lock.json

Lines changed: 152 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@makingchatbots/genesys-cloud-mcp-server",
3-
"version": "0.0.8",
3+
"version": "0.0.9",
44
"description": "A Model Context Protocol (MCP) server exposing Genesys Cloud tools for LLMs, including sentiment analysis, conversation search, topic detection and more.",
55
"exports": "./dist/index.js",
66
"type": "module",
@@ -38,7 +38,8 @@
3838
"@modelcontextprotocol/sdk": "^1.12.1",
3939
"date-fns": "^4.1.0",
4040
"purecloud-platform-client-v2": "^223.0.0",
41-
"zod": "^3.25.48"
41+
"table": "^6.9.0",
42+
"zod": "^3.25.56"
4243
},
4344
"devDependencies": {
4445
"@eslint/eslintrc": "^3.3.1",

src/index.ts

Lines changed: 24 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1+
import platformClient from "purecloud-platform-client-v2";
12
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
23
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
3-
import platformClient from "purecloud-platform-client-v2";
44
import { withAuth } from "./withAuth.js";
5-
import { searchQueues } from "./tools/searchQueues.js";
65
import { loadConfig } from "./loadConfig.js";
7-
import { sampleConversationsByQueue } from "./tools/sampleConversationsByQueue.js";
8-
import { queryQueueVolumes } from "./tools/queryQueueVolumes.js";
6+
import { searchQueues } from "./tools/searchQueues.js";
7+
import { sampleConversationsByQueue } from "./tools/sampleConversationsByQueue/sampleConversationsByQueue.js";
8+
import { queryQueueVolumes } from "./tools/queryQueueVolumes/queryQueueVolumes.js";
99
import { voiceCallQuality } from "./tools/voiceCallQuality.js";
10-
import { conversationSentiment } from "./tools/conversationSentiment.js";
11-
import { conversationTopics } from "./tools/conversationTopics.js";
10+
import { conversationSentiment } from "./tools/conversationSentiment/conversationSentiment.js";
11+
import { conversationTopics } from "./tools/conversationTopics/conversationTopics.js";
1212
import { searchVoiceConversations } from "./tools/searchVoiceConversations.js";
13+
import { conversationTranscription } from "./tools/conversationTranscription/conversationTranscription.js";
1314

1415
const configResult = loadConfig(process.env);
1516
if (!configResult.success) {
@@ -27,6 +28,7 @@ const server: McpServer = new McpServer({
2728
const routingApi = new platformClient.RoutingApi();
2829
const analyticsApi = new platformClient.AnalyticsApi();
2930
const speechTextAnalyticsApi = new platformClient.SpeechTextAnalyticsApi();
31+
const recordingApi = new platformClient.RecordingApi();
3032

3133
const searchQueuesTool = searchQueues({ routingApi });
3234
server.tool(
@@ -121,6 +123,22 @@ server.tool(
121123
),
122124
);
123125

126+
const conversationTranscriptTool = conversationTranscription({
127+
recordingApi,
128+
speechTextAnalyticsApi,
129+
fetchUrl: fetch,
130+
});
131+
server.tool(
132+
conversationTranscriptTool.schema.name,
133+
conversationTranscriptTool.schema.description,
134+
conversationTranscriptTool.schema.paramsSchema.shape,
135+
withAuth(
136+
conversationTranscriptTool.call,
137+
config.genesysCloud,
138+
platformClient.ApiClient.instance,
139+
),
140+
);
141+
124142
const transport = new StdioServerTransport();
125143
await server.connect(transport);
126144
console.log("Started...");

0 commit comments

Comments
 (0)