@burdenoff/mcp-libs 2026.523.1 → 2026.529.1
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/dist/chunk-HRWIDQJE.js +1771 -0
- package/dist/chunk-HRWIDQJE.js.map +1 -0
- package/dist/modules/conversations/index.cjs +1174 -0
- package/dist/modules/conversations/index.cjs.map +1 -1
- package/dist/modules/conversations/index.js +1174 -0
- package/dist/modules/conversations/index.js.map +1 -1
- package/dist/modules/export/index.cjs +348 -0
- package/dist/modules/export/index.cjs.map +1 -1
- package/dist/modules/export/index.js +348 -0
- package/dist/modules/export/index.js.map +1 -1
- package/dist/modules/integrations/index.cjs +539 -0
- package/dist/modules/integrations/index.cjs.map +1 -1
- package/dist/modules/integrations/index.js +539 -0
- package/dist/modules/integrations/index.js.map +1 -1
- package/dist/modules/sandbox/index.cjs +864 -0
- package/dist/modules/sandbox/index.cjs.map +1 -1
- package/dist/modules/sandbox/index.js +699 -1
- package/dist/modules/sandbox/index.js.map +1 -1
- package/dist/modules/scheduler/index.cjs +736 -0
- package/dist/modules/scheduler/index.cjs.map +1 -1
- package/dist/modules/scheduler/index.js +736 -0
- package/dist/modules/scheduler/index.js.map +1 -1
- package/dist/modules/vibecontrols/index.cjs +4230 -477
- package/dist/modules/vibecontrols/index.cjs.map +1 -1
- package/dist/modules/vibecontrols/index.js +3424 -401
- package/dist/modules/vibecontrols/index.js.map +1 -1
- package/package.json +2 -2
- package/dist/chunk-N2CZNPYC.js +0 -875
- package/dist/chunk-N2CZNPYC.js.map +0 -1
|
@@ -101,6 +101,109 @@ var GET_INTEGRATION_LOGS = `
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
`;
|
|
104
|
+
var UPDATE_CONNECTION = `
|
|
105
|
+
mutation UpdateConnection($id: ID!, $input: UpdateConnectionInput!) {
|
|
106
|
+
updateConnection(id: $id, input: $input) { id name status }
|
|
107
|
+
}
|
|
108
|
+
`;
|
|
109
|
+
var REVOKE_CONNECTION = `
|
|
110
|
+
mutation RevokeConnection($connectionId: ID!) {
|
|
111
|
+
revokeConnection(connectionId: $connectionId) { id name status }
|
|
112
|
+
}
|
|
113
|
+
`;
|
|
114
|
+
var TEST_CONNECTION = `
|
|
115
|
+
mutation TestConnection($connectionId: ID!) {
|
|
116
|
+
testConnection(connectionId: $connectionId) { success message latencyMs }
|
|
117
|
+
}
|
|
118
|
+
`;
|
|
119
|
+
var LINK_INTEGRATION_TO_CHANNEL = `
|
|
120
|
+
mutation LinkIntegrationToChannel($channelId: String!, $connectionId: ID!, $organizationId: String!) {
|
|
121
|
+
linkIntegrationToChannel(channelId: $channelId, connectionId: $connectionId, organizationId: $organizationId) {
|
|
122
|
+
id name status channelId organizationId
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
`;
|
|
126
|
+
var REFRESH_CONNECTION_TOKEN = `
|
|
127
|
+
mutation RefreshConnectionToken($connectionId: ID!) {
|
|
128
|
+
refreshConnectionToken(connectionId: $connectionId) { id status }
|
|
129
|
+
}
|
|
130
|
+
`;
|
|
131
|
+
var AUTHENTICATE_API_KEY = `
|
|
132
|
+
mutation AuthenticateWithApiKey($input: ApiKeyAuthInput!) {
|
|
133
|
+
authenticateWithApiKey(input: $input) { id name status }
|
|
134
|
+
}
|
|
135
|
+
`;
|
|
136
|
+
var AUTHENTICATE_BASIC = `
|
|
137
|
+
mutation AuthenticateWithBasicAuth($input: BasicAuthInput!) {
|
|
138
|
+
authenticateWithBasicAuth(input: $input) { id name status }
|
|
139
|
+
}
|
|
140
|
+
`;
|
|
141
|
+
var AUTHENTICATE_BEARER = `
|
|
142
|
+
mutation AuthenticateWithBearerToken($input: BearerTokenAuthInput!) {
|
|
143
|
+
authenticateWithBearerToken(input: $input) { id name status }
|
|
144
|
+
}
|
|
145
|
+
`;
|
|
146
|
+
var INITIATE_OAUTH = `
|
|
147
|
+
mutation InitiateOAuth($input: InitiateOAuthInput!) {
|
|
148
|
+
initiateOAuth(input: $input) { redirectUrl state }
|
|
149
|
+
}
|
|
150
|
+
`;
|
|
151
|
+
var COMPLETE_OAUTH = `
|
|
152
|
+
mutation CompleteOAuth($input: CompleteOAuthInput!) {
|
|
153
|
+
completeOAuth(input: $input) { id name status }
|
|
154
|
+
}
|
|
155
|
+
`;
|
|
156
|
+
var GET_PROVIDER_BY_KEY = `
|
|
157
|
+
query GetProviderByKey($key: String!) {
|
|
158
|
+
getProviderByKey(key: $key) { id key name authType category connectionCount isEnabled }
|
|
159
|
+
}
|
|
160
|
+
`;
|
|
161
|
+
var GET_PROVIDER_CATALOG = `
|
|
162
|
+
query GetProviderCatalog($pagination: IntegrationsPaginationInput) {
|
|
163
|
+
getProviderCatalog(pagination: $pagination) {
|
|
164
|
+
items { id key name category authType isEnabled }
|
|
165
|
+
total hasMore
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
`;
|
|
169
|
+
var GET_CONNECTIONS_BY_PROVIDER = `
|
|
170
|
+
query GetConnectionsByProvider($providerId: ID!, $pagination: IntegrationsPaginationInput) {
|
|
171
|
+
getConnectionsByProvider(providerId: $providerId, pagination: $pagination) {
|
|
172
|
+
items { id name providerId status grantedScopes }
|
|
173
|
+
total hasMore
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
`;
|
|
177
|
+
var ENABLE_PROVIDER = `
|
|
178
|
+
mutation EnableProvider($id: ID!) {
|
|
179
|
+
enableProvider(id: $id) { id key name isEnabled }
|
|
180
|
+
}
|
|
181
|
+
`;
|
|
182
|
+
var DISABLE_PROVIDER = `
|
|
183
|
+
mutation DisableProvider($id: ID!) {
|
|
184
|
+
disableProvider(id: $id) { id key name isEnabled }
|
|
185
|
+
}
|
|
186
|
+
`;
|
|
187
|
+
var TAG_CONNECTION = `
|
|
188
|
+
mutation TagConnection($input: TagConnectionInput!) {
|
|
189
|
+
tagConnection(input: $input) { id entityId tagId source }
|
|
190
|
+
}
|
|
191
|
+
`;
|
|
192
|
+
var UNTAG_CONNECTION = `
|
|
193
|
+
mutation UntagConnection($input: UntagConnectionInput!) {
|
|
194
|
+
untagConnection(input: $input)
|
|
195
|
+
}
|
|
196
|
+
`;
|
|
197
|
+
var REPLACE_CONNECTION_TAGS = `
|
|
198
|
+
mutation ReplaceConnectionTags($input: ReplaceConnectionTagsInput!) {
|
|
199
|
+
replaceConnectionTags(input: $input) { id entityId tagId source }
|
|
200
|
+
}
|
|
201
|
+
`;
|
|
202
|
+
var GET_CONNECTION_TAGS = `
|
|
203
|
+
query GetConnectionTags($input: GetConnectionTagsInput!) {
|
|
204
|
+
getConnectionTags(input: $input) { id entityId tagId source assignedAt }
|
|
205
|
+
}
|
|
206
|
+
`;
|
|
104
207
|
|
|
105
208
|
// src/modules/integrations/tools.ts
|
|
106
209
|
function registerIntegrationsTools(server, ctx, track) {
|
|
@@ -261,6 +364,442 @@ function registerIntegrationsTools(server, ctx, track) {
|
|
|
261
364
|
}
|
|
262
365
|
}
|
|
263
366
|
);
|
|
367
|
+
server.registerTool(
|
|
368
|
+
track(mcpToolName(ctx.productName, "integrations_connections_update")),
|
|
369
|
+
{
|
|
370
|
+
title: "Update Connection",
|
|
371
|
+
description: "Update a connection (name, description, config JSON object).",
|
|
372
|
+
inputSchema: {
|
|
373
|
+
id: zod.z.string().describe("Connection ID"),
|
|
374
|
+
name: zod.z.string().optional(),
|
|
375
|
+
description: zod.z.string().optional(),
|
|
376
|
+
config: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
|
|
377
|
+
}
|
|
378
|
+
},
|
|
379
|
+
async ({ id, name, description, config }) => {
|
|
380
|
+
try {
|
|
381
|
+
const input = {};
|
|
382
|
+
if (name !== void 0) input.name = name;
|
|
383
|
+
if (description !== void 0) input.description = description;
|
|
384
|
+
if (config !== void 0) input.config = config;
|
|
385
|
+
if (Object.keys(input).length === 0) {
|
|
386
|
+
return errorResult("Provide at least one of name, description, config");
|
|
387
|
+
}
|
|
388
|
+
const data = await ctx.gql.workspace.request(
|
|
389
|
+
UPDATE_CONNECTION,
|
|
390
|
+
{ id, input }
|
|
391
|
+
);
|
|
392
|
+
return jsonResult(data.updateConnection);
|
|
393
|
+
} catch (error) {
|
|
394
|
+
ctx.logger.error("integrations_connections_update failed", { error: String(error) });
|
|
395
|
+
return errorResult(
|
|
396
|
+
`Failed to update connection: ${error instanceof Error ? error.message : String(error)}`
|
|
397
|
+
);
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
);
|
|
401
|
+
server.registerTool(
|
|
402
|
+
track(mcpToolName(ctx.productName, "integrations_connections_revoke")),
|
|
403
|
+
{
|
|
404
|
+
title: "Revoke Connection",
|
|
405
|
+
description: "Revoke a connection \u2014 invalidates tokens and marks as REVOKED.",
|
|
406
|
+
inputSchema: { connectionId: zod.z.string().describe("Connection ID") }
|
|
407
|
+
},
|
|
408
|
+
async ({ connectionId }) => {
|
|
409
|
+
try {
|
|
410
|
+
const data = await ctx.gql.workspace.request(
|
|
411
|
+
REVOKE_CONNECTION,
|
|
412
|
+
{ connectionId }
|
|
413
|
+
);
|
|
414
|
+
return jsonResult(data.revokeConnection);
|
|
415
|
+
} catch (error) {
|
|
416
|
+
ctx.logger.error("integrations_connections_revoke failed", { error: String(error) });
|
|
417
|
+
return errorResult(
|
|
418
|
+
`Failed to revoke connection: ${error instanceof Error ? error.message : String(error)}`
|
|
419
|
+
);
|
|
420
|
+
}
|
|
421
|
+
}
|
|
422
|
+
);
|
|
423
|
+
server.registerTool(
|
|
424
|
+
track(mcpToolName(ctx.productName, "integrations_connections_test")),
|
|
425
|
+
{
|
|
426
|
+
title: "Test Connection",
|
|
427
|
+
description: "Health/auth probe for a connection; returns success/message/latencyMs.",
|
|
428
|
+
inputSchema: { connectionId: zod.z.string().describe("Connection ID") }
|
|
429
|
+
},
|
|
430
|
+
async ({ connectionId }) => {
|
|
431
|
+
try {
|
|
432
|
+
const data = await ctx.gql.workspace.request(TEST_CONNECTION, { connectionId });
|
|
433
|
+
return jsonResult(data.testConnection);
|
|
434
|
+
} catch (error) {
|
|
435
|
+
ctx.logger.error("integrations_connections_test failed", { error: String(error) });
|
|
436
|
+
return errorResult(
|
|
437
|
+
`Failed to test connection: ${error instanceof Error ? error.message : String(error)}`
|
|
438
|
+
);
|
|
439
|
+
}
|
|
440
|
+
}
|
|
441
|
+
);
|
|
442
|
+
server.registerTool(
|
|
443
|
+
track(mcpToolName(ctx.productName, "integrations_connections_link_channel")),
|
|
444
|
+
{
|
|
445
|
+
title: "Link Connection to Channel",
|
|
446
|
+
description: "Link an integration connection to a channel for DM/notification routing.",
|
|
447
|
+
inputSchema: {
|
|
448
|
+
channelId: zod.z.string(),
|
|
449
|
+
connectionId: zod.z.string(),
|
|
450
|
+
organizationId: zod.z.string()
|
|
451
|
+
}
|
|
452
|
+
},
|
|
453
|
+
async ({ channelId, connectionId, organizationId }) => {
|
|
454
|
+
try {
|
|
455
|
+
const data = await ctx.gql.workspace.request(LINK_INTEGRATION_TO_CHANNEL, { channelId, connectionId, organizationId });
|
|
456
|
+
return jsonResult(data.linkIntegrationToChannel);
|
|
457
|
+
} catch (error) {
|
|
458
|
+
ctx.logger.error("integrations_connections_link_channel failed", {
|
|
459
|
+
error: String(error)
|
|
460
|
+
});
|
|
461
|
+
return errorResult(
|
|
462
|
+
`Failed to link connection: ${error instanceof Error ? error.message : String(error)}`
|
|
463
|
+
);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
);
|
|
467
|
+
server.registerTool(
|
|
468
|
+
track(mcpToolName(ctx.productName, "integrations_connections_refresh_token")),
|
|
469
|
+
{
|
|
470
|
+
title: "Refresh Connection Token",
|
|
471
|
+
description: "Force a token refresh for an OAuth connection.",
|
|
472
|
+
inputSchema: { connectionId: zod.z.string() }
|
|
473
|
+
},
|
|
474
|
+
async ({ connectionId }) => {
|
|
475
|
+
try {
|
|
476
|
+
const data = await ctx.gql.workspace.request(REFRESH_CONNECTION_TOKEN, { connectionId });
|
|
477
|
+
return jsonResult(data.refreshConnectionToken);
|
|
478
|
+
} catch (error) {
|
|
479
|
+
ctx.logger.error("integrations_connections_refresh_token failed", {
|
|
480
|
+
error: String(error)
|
|
481
|
+
});
|
|
482
|
+
return errorResult(
|
|
483
|
+
`Failed to refresh token: ${error instanceof Error ? error.message : String(error)}`
|
|
484
|
+
);
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
);
|
|
488
|
+
server.registerTool(
|
|
489
|
+
track(mcpToolName(ctx.productName, "integrations_auth_api_key")),
|
|
490
|
+
{
|
|
491
|
+
title: "Authenticate Connection (API Key)",
|
|
492
|
+
description: "Attach an API key to an existing connection.",
|
|
493
|
+
inputSchema: { connectionId: zod.z.string(), apiKey: zod.z.string() }
|
|
494
|
+
},
|
|
495
|
+
async ({ connectionId, apiKey }) => {
|
|
496
|
+
try {
|
|
497
|
+
const data = await ctx.gql.workspace.request(AUTHENTICATE_API_KEY, { input: { connectionId, apiKey } });
|
|
498
|
+
return jsonResult(data.authenticateWithApiKey);
|
|
499
|
+
} catch (error) {
|
|
500
|
+
ctx.logger.error("integrations_auth_api_key failed", { error: String(error) });
|
|
501
|
+
return errorResult(
|
|
502
|
+
`Failed to authenticate: ${error instanceof Error ? error.message : String(error)}`
|
|
503
|
+
);
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
);
|
|
507
|
+
server.registerTool(
|
|
508
|
+
track(mcpToolName(ctx.productName, "integrations_auth_basic")),
|
|
509
|
+
{
|
|
510
|
+
title: "Authenticate Connection (Basic Auth)",
|
|
511
|
+
description: "Attach Basic Auth credentials to an existing connection.",
|
|
512
|
+
inputSchema: {
|
|
513
|
+
connectionId: zod.z.string(),
|
|
514
|
+
username: zod.z.string(),
|
|
515
|
+
password: zod.z.string()
|
|
516
|
+
}
|
|
517
|
+
},
|
|
518
|
+
async ({ connectionId, username, password }) => {
|
|
519
|
+
try {
|
|
520
|
+
const data = await ctx.gql.workspace.request(AUTHENTICATE_BASIC, { input: { connectionId, username, password } });
|
|
521
|
+
return jsonResult(data.authenticateWithBasicAuth);
|
|
522
|
+
} catch (error) {
|
|
523
|
+
ctx.logger.error("integrations_auth_basic failed", { error: String(error) });
|
|
524
|
+
return errorResult(
|
|
525
|
+
`Failed to authenticate: ${error instanceof Error ? error.message : String(error)}`
|
|
526
|
+
);
|
|
527
|
+
}
|
|
528
|
+
}
|
|
529
|
+
);
|
|
530
|
+
server.registerTool(
|
|
531
|
+
track(mcpToolName(ctx.productName, "integrations_auth_bearer")),
|
|
532
|
+
{
|
|
533
|
+
title: "Authenticate Connection (Bearer Token)",
|
|
534
|
+
description: "Attach a Bearer token to an existing connection.",
|
|
535
|
+
inputSchema: { connectionId: zod.z.string(), token: zod.z.string() }
|
|
536
|
+
},
|
|
537
|
+
async ({ connectionId, token }) => {
|
|
538
|
+
try {
|
|
539
|
+
const data = await ctx.gql.workspace.request(AUTHENTICATE_BEARER, { input: { connectionId, token } });
|
|
540
|
+
return jsonResult(data.authenticateWithBearerToken);
|
|
541
|
+
} catch (error) {
|
|
542
|
+
ctx.logger.error("integrations_auth_bearer failed", { error: String(error) });
|
|
543
|
+
return errorResult(
|
|
544
|
+
`Failed to authenticate: ${error instanceof Error ? error.message : String(error)}`
|
|
545
|
+
);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
);
|
|
549
|
+
server.registerTool(
|
|
550
|
+
track(mcpToolName(ctx.productName, "integrations_auth_oauth_start")),
|
|
551
|
+
{
|
|
552
|
+
title: "Initiate OAuth Flow",
|
|
553
|
+
description: "Start an OAuth flow; returns redirectUrl + state for the client to use.",
|
|
554
|
+
inputSchema: {
|
|
555
|
+
connectionId: zod.z.string(),
|
|
556
|
+
redirectUri: zod.z.string(),
|
|
557
|
+
scopes: zod.z.array(zod.z.string()).optional()
|
|
558
|
+
}
|
|
559
|
+
},
|
|
560
|
+
async ({ connectionId, redirectUri, scopes }) => {
|
|
561
|
+
try {
|
|
562
|
+
const input = { connectionId, redirectUri };
|
|
563
|
+
if (scopes !== void 0) input.scopes = scopes;
|
|
564
|
+
const data = await ctx.gql.workspace.request(INITIATE_OAUTH, { input });
|
|
565
|
+
return jsonResult(data.initiateOAuth);
|
|
566
|
+
} catch (error) {
|
|
567
|
+
ctx.logger.error("integrations_auth_oauth_start failed", { error: String(error) });
|
|
568
|
+
return errorResult(
|
|
569
|
+
`Failed to initiate OAuth: ${error instanceof Error ? error.message : String(error)}`
|
|
570
|
+
);
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
);
|
|
574
|
+
server.registerTool(
|
|
575
|
+
track(mcpToolName(ctx.productName, "integrations_auth_oauth_complete")),
|
|
576
|
+
{
|
|
577
|
+
title: "Complete OAuth Flow",
|
|
578
|
+
description: "Complete an OAuth flow with code+state returned by the IdP.",
|
|
579
|
+
inputSchema: {
|
|
580
|
+
connectionId: zod.z.string(),
|
|
581
|
+
code: zod.z.string(),
|
|
582
|
+
redirectUri: zod.z.string(),
|
|
583
|
+
state: zod.z.string()
|
|
584
|
+
}
|
|
585
|
+
},
|
|
586
|
+
async ({ connectionId, code, redirectUri, state }) => {
|
|
587
|
+
try {
|
|
588
|
+
const data = await ctx.gql.workspace.request(
|
|
589
|
+
COMPLETE_OAUTH,
|
|
590
|
+
{ input: { connectionId, code, redirectUri, state } }
|
|
591
|
+
);
|
|
592
|
+
return jsonResult(data.completeOAuth);
|
|
593
|
+
} catch (error) {
|
|
594
|
+
ctx.logger.error("integrations_auth_oauth_complete failed", { error: String(error) });
|
|
595
|
+
return errorResult(
|
|
596
|
+
`Failed to complete OAuth: ${error instanceof Error ? error.message : String(error)}`
|
|
597
|
+
);
|
|
598
|
+
}
|
|
599
|
+
}
|
|
600
|
+
);
|
|
601
|
+
server.registerTool(
|
|
602
|
+
track(mcpToolName(ctx.productName, "integrations_providers_get_by_key")),
|
|
603
|
+
{
|
|
604
|
+
title: "Get Provider By Key",
|
|
605
|
+
description: "Look up an integration provider by its string key (e.g. github, slack).",
|
|
606
|
+
inputSchema: { key: zod.z.string() }
|
|
607
|
+
},
|
|
608
|
+
async ({ key }) => {
|
|
609
|
+
try {
|
|
610
|
+
const data = await ctx.gql.workspace.request(
|
|
611
|
+
GET_PROVIDER_BY_KEY,
|
|
612
|
+
{ key }
|
|
613
|
+
);
|
|
614
|
+
if (!data.getProviderByKey) return errorResult(`Provider ${key} not found`);
|
|
615
|
+
return jsonResult(data.getProviderByKey);
|
|
616
|
+
} catch (error) {
|
|
617
|
+
ctx.logger.error("integrations_providers_get_by_key failed", { error: String(error) });
|
|
618
|
+
return errorResult(
|
|
619
|
+
`Failed to get provider: ${error instanceof Error ? error.message : String(error)}`
|
|
620
|
+
);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
);
|
|
624
|
+
server.registerTool(
|
|
625
|
+
track(mcpToolName(ctx.productName, "integrations_providers_catalog")),
|
|
626
|
+
{
|
|
627
|
+
title: "Provider Catalog",
|
|
628
|
+
description: "Browseable catalog of integration providers (paginated).",
|
|
629
|
+
inputSchema: { limit: zod.z.number().optional() }
|
|
630
|
+
},
|
|
631
|
+
async ({ limit }) => {
|
|
632
|
+
try {
|
|
633
|
+
const data = await ctx.gql.workspace.request(GET_PROVIDER_CATALOG, { pagination: { limit: limit ?? 100, offset: 0 } });
|
|
634
|
+
return jsonResult(data.getProviderCatalog);
|
|
635
|
+
} catch (error) {
|
|
636
|
+
ctx.logger.error("integrations_providers_catalog failed", { error: String(error) });
|
|
637
|
+
return errorResult(
|
|
638
|
+
`Failed to get catalog: ${error instanceof Error ? error.message : String(error)}`
|
|
639
|
+
);
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
);
|
|
643
|
+
server.registerTool(
|
|
644
|
+
track(mcpToolName(ctx.productName, "integrations_providers_connections")),
|
|
645
|
+
{
|
|
646
|
+
title: "Connections By Provider",
|
|
647
|
+
description: "List all connections that belong to a given provider.",
|
|
648
|
+
inputSchema: { providerId: zod.z.string(), limit: zod.z.number().optional() }
|
|
649
|
+
},
|
|
650
|
+
async ({ providerId, limit }) => {
|
|
651
|
+
try {
|
|
652
|
+
const data = await ctx.gql.workspace.request(GET_CONNECTIONS_BY_PROVIDER, {
|
|
653
|
+
providerId,
|
|
654
|
+
pagination: { limit: limit ?? 100, offset: 0 }
|
|
655
|
+
});
|
|
656
|
+
return jsonResult(data.getConnectionsByProvider);
|
|
657
|
+
} catch (error) {
|
|
658
|
+
ctx.logger.error("integrations_providers_connections failed", { error: String(error) });
|
|
659
|
+
return errorResult(
|
|
660
|
+
`Failed to list: ${error instanceof Error ? error.message : String(error)}`
|
|
661
|
+
);
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
);
|
|
665
|
+
server.registerTool(
|
|
666
|
+
track(mcpToolName(ctx.productName, "integrations_providers_enable")),
|
|
667
|
+
{
|
|
668
|
+
title: "Enable Provider",
|
|
669
|
+
description: "Enable an integration provider in this workspace.",
|
|
670
|
+
inputSchema: { id: zod.z.string() }
|
|
671
|
+
},
|
|
672
|
+
async ({ id }) => {
|
|
673
|
+
try {
|
|
674
|
+
const data = await ctx.gql.workspace.request(
|
|
675
|
+
ENABLE_PROVIDER,
|
|
676
|
+
{ id }
|
|
677
|
+
);
|
|
678
|
+
return jsonResult(data.enableProvider);
|
|
679
|
+
} catch (error) {
|
|
680
|
+
ctx.logger.error("integrations_providers_enable failed", { error: String(error) });
|
|
681
|
+
return errorResult(
|
|
682
|
+
`Failed to enable: ${error instanceof Error ? error.message : String(error)}`
|
|
683
|
+
);
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
);
|
|
687
|
+
server.registerTool(
|
|
688
|
+
track(mcpToolName(ctx.productName, "integrations_providers_disable")),
|
|
689
|
+
{
|
|
690
|
+
title: "Disable Provider",
|
|
691
|
+
description: "Disable an integration provider in this workspace.",
|
|
692
|
+
inputSchema: { id: zod.z.string() }
|
|
693
|
+
},
|
|
694
|
+
async ({ id }) => {
|
|
695
|
+
try {
|
|
696
|
+
const data = await ctx.gql.workspace.request(
|
|
697
|
+
DISABLE_PROVIDER,
|
|
698
|
+
{ id }
|
|
699
|
+
);
|
|
700
|
+
return jsonResult(data.disableProvider);
|
|
701
|
+
} catch (error) {
|
|
702
|
+
ctx.logger.error("integrations_providers_disable failed", { error: String(error) });
|
|
703
|
+
return errorResult(
|
|
704
|
+
`Failed to disable: ${error instanceof Error ? error.message : String(error)}`
|
|
705
|
+
);
|
|
706
|
+
}
|
|
707
|
+
}
|
|
708
|
+
);
|
|
709
|
+
server.registerTool(
|
|
710
|
+
track(mcpToolName(ctx.productName, "integrations_connections_tag_add")),
|
|
711
|
+
{
|
|
712
|
+
title: "Tag Connection",
|
|
713
|
+
description: "Add a tag assignment to a connection.",
|
|
714
|
+
inputSchema: {
|
|
715
|
+
entityId: zod.z.string(),
|
|
716
|
+
tagId: zod.z.string(),
|
|
717
|
+
source: zod.z.string().optional()
|
|
718
|
+
}
|
|
719
|
+
},
|
|
720
|
+
async ({ entityId, tagId, source }) => {
|
|
721
|
+
try {
|
|
722
|
+
const input = { entityId, tagId };
|
|
723
|
+
if (source !== void 0) input.source = source;
|
|
724
|
+
const data = await ctx.gql.workspace.request(
|
|
725
|
+
TAG_CONNECTION,
|
|
726
|
+
{ input }
|
|
727
|
+
);
|
|
728
|
+
return jsonResult(data.tagConnection);
|
|
729
|
+
} catch (error) {
|
|
730
|
+
ctx.logger.error("integrations_connections_tag_add failed", { error: String(error) });
|
|
731
|
+
return errorResult(
|
|
732
|
+
`Failed to tag: ${error instanceof Error ? error.message : String(error)}`
|
|
733
|
+
);
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
);
|
|
737
|
+
server.registerTool(
|
|
738
|
+
track(mcpToolName(ctx.productName, "integrations_connections_tag_remove")),
|
|
739
|
+
{
|
|
740
|
+
title: "Untag Connection",
|
|
741
|
+
description: "Remove a tag assignment from a connection.",
|
|
742
|
+
inputSchema: { entityId: zod.z.string(), tagId: zod.z.string() }
|
|
743
|
+
},
|
|
744
|
+
async ({ entityId, tagId }) => {
|
|
745
|
+
try {
|
|
746
|
+
const data = await ctx.gql.workspace.request(
|
|
747
|
+
UNTAG_CONNECTION,
|
|
748
|
+
{ input: { entityId, tagId } }
|
|
749
|
+
);
|
|
750
|
+
return jsonResult({ removed: data.untagConnection });
|
|
751
|
+
} catch (error) {
|
|
752
|
+
ctx.logger.error("integrations_connections_tag_remove failed", { error: String(error) });
|
|
753
|
+
return errorResult(
|
|
754
|
+
`Failed to untag: ${error instanceof Error ? error.message : String(error)}`
|
|
755
|
+
);
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
);
|
|
759
|
+
server.registerTool(
|
|
760
|
+
track(mcpToolName(ctx.productName, "integrations_connections_tag_replace")),
|
|
761
|
+
{
|
|
762
|
+
title: "Replace Connection Tags",
|
|
763
|
+
description: "Replace all tag assignments on a connection.",
|
|
764
|
+
inputSchema: { entityId: zod.z.string(), tagIds: zod.z.array(zod.z.string()) }
|
|
765
|
+
},
|
|
766
|
+
async ({ entityId, tagIds }) => {
|
|
767
|
+
try {
|
|
768
|
+
const data = await ctx.gql.workspace.request(
|
|
769
|
+
REPLACE_CONNECTION_TAGS,
|
|
770
|
+
{ input: { entityId, tagIds } }
|
|
771
|
+
);
|
|
772
|
+
return jsonResult(data.replaceConnectionTags);
|
|
773
|
+
} catch (error) {
|
|
774
|
+
ctx.logger.error("integrations_connections_tag_replace failed", { error: String(error) });
|
|
775
|
+
return errorResult(
|
|
776
|
+
`Failed to replace tags: ${error instanceof Error ? error.message : String(error)}`
|
|
777
|
+
);
|
|
778
|
+
}
|
|
779
|
+
}
|
|
780
|
+
);
|
|
781
|
+
server.registerTool(
|
|
782
|
+
track(mcpToolName(ctx.productName, "integrations_connections_tag_list")),
|
|
783
|
+
{
|
|
784
|
+
title: "List Connection Tags",
|
|
785
|
+
description: "List tag assignments on a connection.",
|
|
786
|
+
inputSchema: { entityId: zod.z.string() }
|
|
787
|
+
},
|
|
788
|
+
async ({ entityId }) => {
|
|
789
|
+
try {
|
|
790
|
+
const data = await ctx.gql.workspace.request(
|
|
791
|
+
GET_CONNECTION_TAGS,
|
|
792
|
+
{ input: { entityId } }
|
|
793
|
+
);
|
|
794
|
+
return jsonResult(data.getConnectionTags);
|
|
795
|
+
} catch (error) {
|
|
796
|
+
ctx.logger.error("integrations_connections_tag_list failed", { error: String(error) });
|
|
797
|
+
return errorResult(
|
|
798
|
+
`Failed to list tags: ${error instanceof Error ? error.message : String(error)}`
|
|
799
|
+
);
|
|
800
|
+
}
|
|
801
|
+
}
|
|
802
|
+
);
|
|
264
803
|
server.registerTool(
|
|
265
804
|
track(mcpToolName(ctx.productName, "integrations_logs")),
|
|
266
805
|
{
|