Skip to content

Commit eaf2881

Browse files
authored
Update MCP SDK tool usage (#39)
1 parent e319763 commit eaf2881

File tree

2 files changed

+49
-33
lines changed

2 files changed

+49
-33
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"clean:mcpb": "npm run clean && rm -rf mcpb-contents/*",
3030
"deps:mcpb": "cp manifest.json package.json package-lock.json mcpb-contents/ && cd mcpb-contents && npm ci --omit=dev && rm package-lock.json",
3131
"package:mcpb": "npm run clean:mcpb && npm run build:esm:mcpb && npm run deps:mcpb && mcpb pack mcpb-contents genesys-cloud-mcp-server.mcpb",
32-
"lint:write": "biome check --write",
32+
"lint:fix": "biome check --write",
3333
"lint:check": "biome check",
3434
"test": "npx vitest --config ./vitest.config.ts --project unit",
3535
"test:evaluation": "npx vitest --config ./vitest.config.ts --project evaluation",

src/index.ts

Lines changed: 48 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -28,74 +28,88 @@ const speechTextAnalyticsApi = new platformClient.SpeechTextAnalyticsApi();
2828
const recordingApi = new platformClient.RecordingApi();
2929

3030
const searchQueuesTool = searchQueues({ routingApi });
31-
server.tool(
31+
server.registerTool(
3232
searchQueuesTool.schema.name,
33-
searchQueuesTool.schema.description,
34-
searchQueuesTool.schema.paramsSchema.shape,
35-
searchQueuesTool.schema.annotations,
33+
{
34+
description: searchQueuesTool.schema.description,
35+
inputSchema: searchQueuesTool.schema.paramsSchema.shape,
36+
annotations: searchQueuesTool.schema.annotations,
37+
},
3638
withAuth(searchQueuesTool.call),
3739
);
3840

3941
const sampleConversationsByQueueTool = sampleConversationsByQueue({
4042
analyticsApi,
4143
});
42-
server.tool(
44+
server.registerTool(
4345
sampleConversationsByQueueTool.schema.name,
44-
sampleConversationsByQueueTool.schema.description,
45-
sampleConversationsByQueueTool.schema.paramsSchema.shape,
46-
sampleConversationsByQueueTool.schema.annotations,
46+
{
47+
description: sampleConversationsByQueueTool.schema.description,
48+
inputSchema: sampleConversationsByQueueTool.schema.paramsSchema.shape,
49+
annotations: sampleConversationsByQueueTool.schema.annotations,
50+
},
4751
withAuth(sampleConversationsByQueueTool.call),
4852
);
4953

5054
const queryQueueVolumesTool = queryQueueVolumes({ analyticsApi });
51-
server.tool(
55+
server.registerTool(
5256
queryQueueVolumesTool.schema.name,
53-
queryQueueVolumesTool.schema.description,
54-
queryQueueVolumesTool.schema.paramsSchema.shape,
55-
queryQueueVolumesTool.schema.annotations,
57+
{
58+
description: queryQueueVolumesTool.schema.description,
59+
inputSchema: queryQueueVolumesTool.schema.paramsSchema.shape,
60+
annotations: queryQueueVolumesTool.schema.annotations,
61+
},
5662
withAuth(queryQueueVolumesTool.call),
5763
);
5864

5965
const voiceCallQualityTool = voiceCallQuality({ analyticsApi });
60-
server.tool(
66+
server.registerTool(
6167
voiceCallQualityTool.schema.name,
62-
voiceCallQualityTool.schema.description,
63-
voiceCallQualityTool.schema.paramsSchema.shape,
64-
voiceCallQualityTool.schema.annotations,
68+
{
69+
description: voiceCallQualityTool.schema.description,
70+
inputSchema: voiceCallQualityTool.schema.paramsSchema.shape,
71+
annotations: voiceCallQualityTool.schema.annotations,
72+
},
6573
withAuth(voiceCallQualityTool.call),
6674
);
6775

6876
const conversationSentimentTool = conversationSentiment({
6977
speechTextAnalyticsApi,
7078
});
71-
server.tool(
79+
server.registerTool(
7280
conversationSentimentTool.schema.name,
73-
conversationSentimentTool.schema.description,
74-
conversationSentimentTool.schema.paramsSchema.shape,
75-
conversationSentimentTool.schema.annotations,
81+
{
82+
description: conversationSentimentTool.schema.description,
83+
inputSchema: conversationSentimentTool.schema.paramsSchema.shape,
84+
annotations: conversationSentimentTool.schema.annotations,
85+
},
7686
withAuth(conversationSentimentTool.call),
7787
);
7888

7989
const conversationTopicsTool = conversationTopics({
8090
speechTextAnalyticsApi,
8191
analyticsApi,
8292
});
83-
server.tool(
93+
server.registerTool(
8494
conversationTopicsTool.schema.name,
85-
conversationTopicsTool.schema.description,
86-
conversationTopicsTool.schema.paramsSchema.shape,
87-
conversationTopicsTool.schema.annotations,
95+
{
96+
description: conversationTopicsTool.schema.description,
97+
inputSchema: conversationTopicsTool.schema.paramsSchema.shape,
98+
annotations: conversationTopicsTool.schema.annotations,
99+
},
88100
withAuth(conversationTopicsTool.call),
89101
);
90102

91103
const searchVoiceConversationsTool = searchVoiceConversations({
92104
analyticsApi,
93105
});
94-
server.tool(
106+
server.registerTool(
95107
searchVoiceConversationsTool.schema.name,
96-
searchVoiceConversationsTool.schema.description,
97-
searchVoiceConversationsTool.schema.paramsSchema.shape,
98-
searchVoiceConversationsTool.schema.annotations,
108+
{
109+
description: searchVoiceConversationsTool.schema.description,
110+
inputSchema: searchVoiceConversationsTool.schema.paramsSchema.shape,
111+
annotations: searchVoiceConversationsTool.schema.annotations,
112+
},
99113
withAuth(searchVoiceConversationsTool.call),
100114
);
101115

@@ -104,11 +118,13 @@ const conversationTranscriptTool = conversationTranscription({
104118
speechTextAnalyticsApi,
105119
fetchUrl: fetch,
106120
});
107-
server.tool(
121+
server.registerTool(
108122
conversationTranscriptTool.schema.name,
109-
conversationTranscriptTool.schema.description,
110-
conversationTranscriptTool.schema.paramsSchema.shape,
111-
conversationTranscriptTool.schema.annotations,
123+
{
124+
description: conversationTranscriptTool.schema.description,
125+
inputSchema: conversationTranscriptTool.schema.paramsSchema.shape,
126+
annotations: conversationTranscriptTool.schema.annotations,
127+
},
112128
withAuth(conversationTranscriptTool.call),
113129
);
114130

0 commit comments

Comments
 (0)