tuix-mcp-host-client 0.20.0 → 0.22.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/apis/ClientApi.ts CHANGED
@@ -33,6 +33,16 @@ import {
33
33
  ApplicationMCPServerDTOFromJSON,
34
34
  ApplicationMCPServerDTOToJSON,
35
35
  } from '../models/ApplicationMCPServerDTO';
36
+ import {
37
+ type CallMCPServerToolDTO,
38
+ CallMCPServerToolDTOFromJSON,
39
+ CallMCPServerToolDTOToJSON,
40
+ } from '../models/CallMCPServerToolDTO';
41
+ import {
42
+ type CallMCPServerToolResultDTO,
43
+ CallMCPServerToolResultDTOFromJSON,
44
+ CallMCPServerToolResultDTOToJSON,
45
+ } from '../models/CallMCPServerToolResultDTO';
36
46
  import {
37
47
  type CreateAPIKeyRequestDTO,
38
48
  CreateAPIKeyRequestDTOFromJSON,
@@ -78,6 +88,11 @@ import {
78
88
  MCPServerStatusDTOFromJSON,
79
89
  MCPServerStatusDTOToJSON,
80
90
  } from '../models/MCPServerStatusDTO';
91
+ import {
92
+ type MCPServerToolDTO,
93
+ MCPServerToolDTOFromJSON,
94
+ MCPServerToolDTOToJSON,
95
+ } from '../models/MCPServerToolDTO';
81
96
  import {
82
97
  type PaginatedApplicationsDTO,
83
98
  PaginatedApplicationsDTOFromJSON,
@@ -93,11 +108,6 @@ import {
93
108
  UpdateApplicationDTOFromJSON,
94
109
  UpdateApplicationDTOToJSON,
95
110
  } from '../models/UpdateApplicationDTO';
96
- import {
97
- type UpdateMCPServerDTO,
98
- UpdateMCPServerDTOFromJSON,
99
- UpdateMCPServerDTOToJSON,
100
- } from '../models/UpdateMCPServerDTO';
101
111
 
102
112
  export interface ApiKeysGetRequest {
103
113
  /**
@@ -135,6 +145,25 @@ export interface AttachMCPServerRequest {
135
145
  applicationMCPServerDTO: ApplicationMCPServerDTO;
136
146
  }
137
147
 
148
+ export interface CallMCPServerToolRequest {
149
+ /**
150
+ * MCP Server ID
151
+ */
152
+ mcpServerId: string;
153
+ /**
154
+ * Tool name to call
155
+ */
156
+ toolName: string;
157
+ /**
158
+ *
159
+ */
160
+ callMCPServerToolDTO: CallMCPServerToolDTO;
161
+ /**
162
+ * Downstream authorization token for the MCP server
163
+ */
164
+ xDownstreamAuthorization?: string;
165
+ }
166
+
138
167
  export interface CreateAccountRequest {
139
168
  /**
140
169
  *
@@ -259,26 +288,26 @@ export interface GetMCPServersByApplicationRequest {
259
288
  pageSize?: number;
260
289
  }
261
290
 
262
- export interface UpdateApplicationRequest {
291
+ export interface ListMCPServerToolsRequest {
263
292
  /**
264
- * Application ID
293
+ * MCP Server ID
265
294
  */
266
- applicationId: string;
295
+ mcpServerId: string;
267
296
  /**
268
- *
297
+ * Downstream authorization token for the MCP server
269
298
  */
270
- updateApplicationDTO: UpdateApplicationDTO;
299
+ xDownstreamAuthorization?: string;
271
300
  }
272
301
 
273
- export interface UpdateMCPServerRequest {
302
+ export interface UpdateApplicationRequest {
274
303
  /**
275
- * MCP Server ID
304
+ * Application ID
276
305
  */
277
- mcpServerId: string;
306
+ applicationId: string;
278
307
  /**
279
308
  *
280
309
  */
281
- updateMCPServerDTO: UpdateMCPServerDTO;
310
+ updateApplicationDTO: UpdateApplicationDTO;
282
311
  }
283
312
 
284
313
  /**
@@ -484,6 +513,75 @@ export class ClientApi extends runtime.BaseAPI {
484
513
  await this.attachMCPServerRaw(requestParameters, initOverrides);
485
514
  }
486
515
 
516
+ /**
517
+ * Creates request options for callMCPServerTool without sending the request
518
+ */
519
+ async callMCPServerToolRequestOpts(requestParameters: CallMCPServerToolRequest): Promise<runtime.RequestOpts> {
520
+ if (requestParameters['mcpServerId'] == null) {
521
+ throw new runtime.RequiredError(
522
+ 'mcpServerId',
523
+ 'Required parameter "mcpServerId" was null or undefined when calling callMCPServerTool().'
524
+ );
525
+ }
526
+
527
+ if (requestParameters['toolName'] == null) {
528
+ throw new runtime.RequiredError(
529
+ 'toolName',
530
+ 'Required parameter "toolName" was null or undefined when calling callMCPServerTool().'
531
+ );
532
+ }
533
+
534
+ if (requestParameters['callMCPServerToolDTO'] == null) {
535
+ throw new runtime.RequiredError(
536
+ 'callMCPServerToolDTO',
537
+ 'Required parameter "callMCPServerToolDTO" was null or undefined when calling callMCPServerTool().'
538
+ );
539
+ }
540
+
541
+ const queryParameters: any = {};
542
+
543
+ const headerParameters: runtime.HTTPHeaders = {};
544
+
545
+ headerParameters['Content-Type'] = 'application/json';
546
+
547
+ if (requestParameters['xDownstreamAuthorization'] != null) {
548
+ headerParameters['X-Downstream-Authorization'] = String(requestParameters['xDownstreamAuthorization']);
549
+ }
550
+
551
+
552
+ let urlPath = `/mcp-servers/{mcpServerId}/tools/{toolName}/executions`;
553
+ urlPath = urlPath.replace('{mcpServerId}', encodeURIComponent(String(requestParameters['mcpServerId'])));
554
+ urlPath = urlPath.replace('{toolName}', encodeURIComponent(String(requestParameters['toolName'])));
555
+
556
+ return {
557
+ path: urlPath,
558
+ method: 'POST',
559
+ headers: headerParameters,
560
+ query: queryParameters,
561
+ body: CallMCPServerToolDTOToJSON(requestParameters['callMCPServerToolDTO']),
562
+ };
563
+ }
564
+
565
+ /**
566
+ * Send a JSON-RPC tools/call request to a deployed MCP server and return its result
567
+ * Call a tool of an MCP server
568
+ */
569
+ async callMCPServerToolRaw(requestParameters: CallMCPServerToolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CallMCPServerToolResultDTO>> {
570
+ const requestOptions = await this.callMCPServerToolRequestOpts(requestParameters);
571
+ const response = await this.request(requestOptions, initOverrides);
572
+
573
+ return new runtime.JSONApiResponse(response, (jsonValue) => CallMCPServerToolResultDTOFromJSON(jsonValue));
574
+ }
575
+
576
+ /**
577
+ * Send a JSON-RPC tools/call request to a deployed MCP server and return its result
578
+ * Call a tool of an MCP server
579
+ */
580
+ async callMCPServerTool(requestParameters: CallMCPServerToolRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CallMCPServerToolResultDTO> {
581
+ const response = await this.callMCPServerToolRaw(requestParameters, initOverrides);
582
+ return await response.value();
583
+ }
584
+
487
585
  /**
488
586
  * Creates request options for createAccount without sending the request
489
587
  */
@@ -1127,20 +1225,13 @@ export class ClientApi extends runtime.BaseAPI {
1127
1225
  }
1128
1226
 
1129
1227
  /**
1130
- * Creates request options for updateApplication without sending the request
1228
+ * Creates request options for listMCPServerTools without sending the request
1131
1229
  */
1132
- async updateApplicationRequestOpts(requestParameters: UpdateApplicationRequest): Promise<runtime.RequestOpts> {
1133
- if (requestParameters['applicationId'] == null) {
1134
- throw new runtime.RequiredError(
1135
- 'applicationId',
1136
- 'Required parameter "applicationId" was null or undefined when calling updateApplication().'
1137
- );
1138
- }
1139
-
1140
- if (requestParameters['updateApplicationDTO'] == null) {
1230
+ async listMCPServerToolsRequestOpts(requestParameters: ListMCPServerToolsRequest): Promise<runtime.RequestOpts> {
1231
+ if (requestParameters['mcpServerId'] == null) {
1141
1232
  throw new runtime.RequiredError(
1142
- 'updateApplicationDTO',
1143
- 'Required parameter "updateApplicationDTO" was null or undefined when calling updateApplication().'
1233
+ 'mcpServerId',
1234
+ 'Required parameter "mcpServerId" was null or undefined when calling listMCPServerTools().'
1144
1235
  );
1145
1236
  }
1146
1237
 
@@ -1148,56 +1239,57 @@ export class ClientApi extends runtime.BaseAPI {
1148
1239
 
1149
1240
  const headerParameters: runtime.HTTPHeaders = {};
1150
1241
 
1151
- headerParameters['Content-Type'] = 'application/json';
1242
+ if (requestParameters['xDownstreamAuthorization'] != null) {
1243
+ headerParameters['X-Downstream-Authorization'] = String(requestParameters['xDownstreamAuthorization']);
1244
+ }
1152
1245
 
1153
1246
 
1154
- let urlPath = `/applications/{applicationId}`;
1155
- urlPath = urlPath.replace('{applicationId}', encodeURIComponent(String(requestParameters['applicationId'])));
1247
+ let urlPath = `/mcp-servers/{mcpServerId}/tools`;
1248
+ urlPath = urlPath.replace('{mcpServerId}', encodeURIComponent(String(requestParameters['mcpServerId'])));
1156
1249
 
1157
1250
  return {
1158
1251
  path: urlPath,
1159
- method: 'PATCH',
1252
+ method: 'GET',
1160
1253
  headers: headerParameters,
1161
1254
  query: queryParameters,
1162
- body: UpdateApplicationDTOToJSON(requestParameters['updateApplicationDTO']),
1163
1255
  };
1164
1256
  }
1165
1257
 
1166
1258
  /**
1167
- * Update an application belonging to the authenticated account
1168
- * Update an application
1259
+ * Send a JSON-RPC tools/list request to a deployed MCP server and return its tools with their roles
1260
+ * List tools of an MCP server
1169
1261
  */
1170
- async updateApplicationRaw(requestParameters: UpdateApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApplicationDTO>> {
1171
- const requestOptions = await this.updateApplicationRequestOpts(requestParameters);
1262
+ async listMCPServerToolsRaw(requestParameters: ListMCPServerToolsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<MCPServerToolDTO>>> {
1263
+ const requestOptions = await this.listMCPServerToolsRequestOpts(requestParameters);
1172
1264
  const response = await this.request(requestOptions, initOverrides);
1173
1265
 
1174
- return new runtime.JSONApiResponse(response, (jsonValue) => ApplicationDTOFromJSON(jsonValue));
1266
+ return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(MCPServerToolDTOFromJSON));
1175
1267
  }
1176
1268
 
1177
1269
  /**
1178
- * Update an application belonging to the authenticated account
1179
- * Update an application
1270
+ * Send a JSON-RPC tools/list request to a deployed MCP server and return its tools with their roles
1271
+ * List tools of an MCP server
1180
1272
  */
1181
- async updateApplication(requestParameters: UpdateApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApplicationDTO> {
1182
- const response = await this.updateApplicationRaw(requestParameters, initOverrides);
1273
+ async listMCPServerTools(requestParameters: ListMCPServerToolsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<MCPServerToolDTO>> {
1274
+ const response = await this.listMCPServerToolsRaw(requestParameters, initOverrides);
1183
1275
  return await response.value();
1184
1276
  }
1185
1277
 
1186
1278
  /**
1187
- * Creates request options for updateMCPServer without sending the request
1279
+ * Creates request options for updateApplication without sending the request
1188
1280
  */
1189
- async updateMCPServerRequestOpts(requestParameters: UpdateMCPServerRequest): Promise<runtime.RequestOpts> {
1190
- if (requestParameters['mcpServerId'] == null) {
1281
+ async updateApplicationRequestOpts(requestParameters: UpdateApplicationRequest): Promise<runtime.RequestOpts> {
1282
+ if (requestParameters['applicationId'] == null) {
1191
1283
  throw new runtime.RequiredError(
1192
- 'mcpServerId',
1193
- 'Required parameter "mcpServerId" was null or undefined when calling updateMCPServer().'
1284
+ 'applicationId',
1285
+ 'Required parameter "applicationId" was null or undefined when calling updateApplication().'
1194
1286
  );
1195
1287
  }
1196
1288
 
1197
- if (requestParameters['updateMCPServerDTO'] == null) {
1289
+ if (requestParameters['updateApplicationDTO'] == null) {
1198
1290
  throw new runtime.RequiredError(
1199
- 'updateMCPServerDTO',
1200
- 'Required parameter "updateMCPServerDTO" was null or undefined when calling updateMCPServer().'
1291
+ 'updateApplicationDTO',
1292
+ 'Required parameter "updateApplicationDTO" was null or undefined when calling updateApplication().'
1201
1293
  );
1202
1294
  }
1203
1295
 
@@ -1208,35 +1300,35 @@ export class ClientApi extends runtime.BaseAPI {
1208
1300
  headerParameters['Content-Type'] = 'application/json';
1209
1301
 
1210
1302
 
1211
- let urlPath = `/mcp-servers/{mcpServerId}`;
1212
- urlPath = urlPath.replace('{mcpServerId}', encodeURIComponent(String(requestParameters['mcpServerId'])));
1303
+ let urlPath = `/applications/{applicationId}`;
1304
+ urlPath = urlPath.replace('{applicationId}', encodeURIComponent(String(requestParameters['applicationId'])));
1213
1305
 
1214
1306
  return {
1215
1307
  path: urlPath,
1216
1308
  method: 'PATCH',
1217
1309
  headers: headerParameters,
1218
1310
  query: queryParameters,
1219
- body: UpdateMCPServerDTOToJSON(requestParameters['updateMCPServerDTO']),
1311
+ body: UpdateApplicationDTOToJSON(requestParameters['updateApplicationDTO']),
1220
1312
  };
1221
1313
  }
1222
1314
 
1223
1315
  /**
1224
- * Update an existing MCP server for the authenticated account
1225
- * Update an existing MCP server
1316
+ * Update an application belonging to the authenticated account
1317
+ * Update an application
1226
1318
  */
1227
- async updateMCPServerRaw(requestParameters: UpdateMCPServerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MCPServerDTO>> {
1228
- const requestOptions = await this.updateMCPServerRequestOpts(requestParameters);
1319
+ async updateApplicationRaw(requestParameters: UpdateApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ApplicationDTO>> {
1320
+ const requestOptions = await this.updateApplicationRequestOpts(requestParameters);
1229
1321
  const response = await this.request(requestOptions, initOverrides);
1230
1322
 
1231
- return new runtime.JSONApiResponse(response, (jsonValue) => MCPServerDTOFromJSON(jsonValue));
1323
+ return new runtime.JSONApiResponse(response, (jsonValue) => ApplicationDTOFromJSON(jsonValue));
1232
1324
  }
1233
1325
 
1234
1326
  /**
1235
- * Update an existing MCP server for the authenticated account
1236
- * Update an existing MCP server
1327
+ * Update an application belonging to the authenticated account
1328
+ * Update an application
1237
1329
  */
1238
- async updateMCPServer(requestParameters: UpdateMCPServerRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MCPServerDTO> {
1239
- const response = await this.updateMCPServerRaw(requestParameters, initOverrides);
1330
+ async updateApplication(requestParameters: UpdateApplicationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ApplicationDTO> {
1331
+ const response = await this.updateApplicationRaw(requestParameters, initOverrides);
1240
1332
  return await response.value();
1241
1333
  }
1242
1334
 
@@ -0,0 +1,36 @@
1
+
2
+ # CallMCPServerToolDTO
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `arguments` | { [key: string]: any; }
10
+ `sessionId` | string
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { CallMCPServerToolDTO } from ''
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "arguments": null,
20
+ "sessionId": null,
21
+ } satisfies CallMCPServerToolDTO
22
+
23
+ console.log(example)
24
+
25
+ // Convert the instance to a JSON string
26
+ const exampleJSON: string = JSON.stringify(example)
27
+ console.log(exampleJSON)
28
+
29
+ // Parse the JSON string back to an object
30
+ const exampleParsed = JSON.parse(exampleJSON) as CallMCPServerToolDTO
31
+ console.log(exampleParsed)
32
+ ```
33
+
34
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
35
+
36
+
@@ -1,24 +1,22 @@
1
1
 
2
- # UpdateMCPServerDTO
2
+ # CallMCPServerToolResultDTO
3
3
 
4
4
 
5
5
  ## Properties
6
6
 
7
7
  Name | Type
8
8
  ------------ | -------------
9
- `transport` | string
10
- `url` | string
9
+ `result` | any
11
10
 
12
11
  ## Example
13
12
 
14
13
  ```typescript
15
- import type { UpdateMCPServerDTO } from ''
14
+ import type { CallMCPServerToolResultDTO } from ''
16
15
 
17
16
  // TODO: Update the object below with actual values
18
17
  const example = {
19
- "transport": null,
20
- "url": null,
21
- } satisfies UpdateMCPServerDTO
18
+ "result": null,
19
+ } satisfies CallMCPServerToolResultDTO
22
20
 
23
21
  console.log(example)
24
22
 
@@ -27,7 +25,7 @@ const exampleJSON: string = JSON.stringify(example)
27
25
  console.log(exampleJSON)
28
26
 
29
27
  // Parse the JSON string back to an object
30
- const exampleParsed = JSON.parse(exampleJSON) as UpdateMCPServerDTO
28
+ const exampleParsed = JSON.parse(exampleJSON) as CallMCPServerToolResultDTO
31
29
  console.log(exampleParsed)
32
30
  ```
33
31