@burdenoff/mcp-libs 2026.1031.2 → 2026.1031.3

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.
Files changed (59) hide show
  1. package/dist/modules/auth/index.cjs +1 -1
  2. package/dist/modules/auth/index.cjs.map +1 -1
  3. package/dist/modules/auth/index.js +1 -1
  4. package/dist/modules/auth/index.js.map +1 -1
  5. package/dist/modules/auth/operations.d.ts +2 -2
  6. package/dist/modules/billing/index.cjs +45 -19
  7. package/dist/modules/billing/index.cjs.map +1 -1
  8. package/dist/modules/billing/index.js +45 -19
  9. package/dist/modules/billing/index.js.map +1 -1
  10. package/dist/modules/billing/operations.d.ts +4 -4
  11. package/dist/modules/channels/index.cjs +0 -35
  12. package/dist/modules/channels/index.cjs.map +1 -1
  13. package/dist/modules/channels/index.js +0 -35
  14. package/dist/modules/channels/index.js.map +1 -1
  15. package/dist/modules/channels/operations.d.ts +0 -1
  16. package/dist/modules/conversations/index.cjs +6 -6
  17. package/dist/modules/conversations/index.cjs.map +1 -1
  18. package/dist/modules/conversations/index.js +6 -6
  19. package/dist/modules/conversations/index.js.map +1 -1
  20. package/dist/modules/conversations/operations.d.ts +1 -1
  21. package/dist/modules/files/index.cjs +421 -101
  22. package/dist/modules/files/index.cjs.map +1 -1
  23. package/dist/modules/files/index.js +412 -97
  24. package/dist/modules/files/index.js.map +1 -1
  25. package/dist/modules/files/operations.d.ts +9 -8
  26. package/dist/modules/files/tools.d.ts +2 -0
  27. package/dist/modules/products/index.cjs +1 -1
  28. package/dist/modules/products/index.cjs.map +1 -1
  29. package/dist/modules/products/index.js +1 -1
  30. package/dist/modules/products/index.js.map +1 -1
  31. package/dist/modules/products/operations.d.ts +1 -1
  32. package/dist/modules/rbac/index.cjs +0 -64
  33. package/dist/modules/rbac/index.cjs.map +1 -1
  34. package/dist/modules/rbac/index.js +0 -64
  35. package/dist/modules/rbac/index.js.map +1 -1
  36. package/dist/modules/rbac/operations.d.ts +0 -2
  37. package/dist/modules/scheduler/index.cjs +4 -4
  38. package/dist/modules/scheduler/index.cjs.map +1 -1
  39. package/dist/modules/scheduler/index.js +4 -4
  40. package/dist/modules/scheduler/index.js.map +1 -1
  41. package/dist/modules/scheduler/operations.d.ts +3 -3
  42. package/dist/modules/tags/index.cjs +454 -48
  43. package/dist/modules/tags/index.cjs.map +1 -1
  44. package/dist/modules/tags/index.js +443 -42
  45. package/dist/modules/tags/index.js.map +1 -1
  46. package/dist/modules/tags/operations.d.ts +10 -6
  47. package/dist/modules/tags/tools.d.ts +1 -1
  48. package/dist/modules/vibecontrols/index.cjs +8 -8
  49. package/dist/modules/vibecontrols/index.cjs.map +1 -1
  50. package/dist/modules/vibecontrols/index.js +8 -8
  51. package/dist/modules/vibecontrols/index.js.map +1 -1
  52. package/dist/modules/workspaces/index.cjs +235 -5
  53. package/dist/modules/workspaces/index.cjs.map +1 -1
  54. package/dist/modules/workspaces/index.js +224 -6
  55. package/dist/modules/workspaces/index.js.map +1 -1
  56. package/dist/modules/workspaces/operations.d.ts +2 -2
  57. package/dist/modules/workspaces/prompts.d.ts +3 -0
  58. package/dist/modules/workspaces/resources.d.ts +4 -0
  59. package/package.json +1 -1
@@ -1,19 +1,19 @@
1
1
  'use strict';
2
2
 
3
+ var zod = require('zod');
3
4
  require('graphql-request');
4
5
  require('cross-fetch');
5
6
  require('@modelcontextprotocol/sdk/server/mcp.js');
6
7
  require('@modelcontextprotocol/sdk/types.js');
7
8
  require('crypto');
8
- require('zod');
9
9
 
10
- // src/core/auth/store.ts
10
+ // src/modules/tags/tools.ts
11
11
 
12
12
  // src/core/errors.ts
13
13
  var McpInternalError = class extends Error {
14
14
  cause;
15
- constructor(message, cause) {
16
- super(message);
15
+ constructor(message2, cause) {
16
+ super(message2);
17
17
  this.name = "McpInternalError";
18
18
  this.cause = cause;
19
19
  }
@@ -38,59 +38,465 @@ function mcpToolName(productName, ...parts) {
38
38
  }
39
39
 
40
40
  // src/core/result.ts
41
- function errorResult(message, hint) {
42
- const text = hint ? `${message}
41
+ function jsonResult(data, structured) {
42
+ const result = {
43
+ content: [{ type: "text", text: JSON.stringify(data, null, 2) }]
44
+ };
45
+ return result;
46
+ }
47
+ function errorResult(message2, hint) {
48
+ const text = hint ? `${message2}
43
49
 
44
- Hint: ${hint}` : message;
50
+ Hint: ${hint}` : message2;
45
51
  return { content: [{ type: "text", text }], isError: true };
46
52
  }
47
53
 
54
+ // src/modules/tags/operations.ts
55
+ var LIST_TAGS = `
56
+ query TagsList($filter: TagFilterInput, $pagination: TagsPaginationInput) {
57
+ getTags(filter: $filter, pagination: $pagination) {
58
+ items { id key label description scope vocabularyId parentId displayOrder usageCount }
59
+ total hasMore nextCursor
60
+ }
61
+ }
62
+ `;
63
+ var GET_TAG = `
64
+ query GetTag($id: ID!) {
65
+ getTag(id: $id) {
66
+ id key label description color icon scope vocabularyId parentId
67
+ displayOrder assignmentCount usageCount hierarchyLevel hierarchyPath
68
+ createdAt updatedAt
69
+ }
70
+ }
71
+ `;
72
+ var LIST_VOCABULARIES = `
73
+ query TagVocabularies($filter: VocabularyFilterInput, $pagination: TagsPaginationInput) {
74
+ getVocabularies(filter: $filter, pagination: $pagination) {
75
+ items {
76
+ id key name description kind scope dataType cardinality
77
+ allowCustomTags predefinedValuesOnly applicableEntityTypes tagCount
78
+ }
79
+ total hasMore nextCursor
80
+ }
81
+ }
82
+ `;
83
+ var CREATE_TAG = `
84
+ mutation CreateTag($input: CreateTagInput!) {
85
+ createTag(input: $input) {
86
+ id key label description scope vocabularyId parentId displayOrder createdAt
87
+ }
88
+ }
89
+ `;
90
+ var UPDATE_TAG = `
91
+ mutation UpdateTag($id: ID!, $input: UpdateTagInput!) {
92
+ updateTag(id: $id, input: $input) {
93
+ id label description color icon parentId displayOrder updatedAt
94
+ }
95
+ }
96
+ `;
97
+ var DELETE_TAG = `
98
+ mutation DeleteTag($id: ID!) {
99
+ deleteTag(id: $id)
100
+ }
101
+ `;
102
+ var TAG_ANALYTICS = `
103
+ query TagAnalytics($tagId: ID!, $startDate: DateTime!, $endDate: DateTime!) {
104
+ getTagAnalytics(tagId: $tagId, startDate: $startDate, endDate: $endDate) {
105
+ date assignmentCount removalCount uniqueUsers uniqueEntities entityTypeBreakdown
106
+ }
107
+ }
108
+ `;
109
+ var TAG_RELATIONS = `
110
+ query GetRelatedTags($tagId: ID!, $relationType: TagRelationType) {
111
+ getRelatedTags(tagId: $tagId, relationType: $relationType) {
112
+ relationType
113
+ tag { id key label }
114
+ }
115
+ }
116
+ `;
117
+ var CREATE_TAG_RELATION = `
118
+ mutation CreateTagRelation($input: CreateTagRelationInput!) {
119
+ createTagRelation(input: $input) {
120
+ id fromTagId toTagId relationType bidirectional createdAt
121
+ }
122
+ }
123
+ `;
124
+ var DELETE_TAG_RELATION = `
125
+ mutation DeleteTagRelation($id: ID!) {
126
+ deleteTagRelation(id: $id)
127
+ }
128
+ `;
129
+ var ASSIGN_TAG = `
130
+ mutation AssignTag($input: AssignTagInput!) {
131
+ assignTag(input: $input) {
132
+ id tagId entityType entityId source createdAt
133
+ tag { id key label }
134
+ }
135
+ }
136
+ `;
137
+ var ENTITY_TAGS = `
138
+ query EntityTags($entityType: String!, $entityId: ID!) {
139
+ getEntityTags(entityType: $entityType, entityId: $entityId) {
140
+ id tagId entityType entityId source isCurrentlyValid createdAt
141
+ tag { id key label vocabularyId }
142
+ }
143
+ }
144
+ `;
145
+ var REMOVE_TAG_ASSIGNMENT = `
146
+ mutation RemoveTagAssignment($id: ID!) {
147
+ removeTagAssignment(id: $id)
148
+ }
149
+ `;
150
+
48
151
  // src/modules/tags/tools.ts
49
- function stubbedTool(server, toolName, title, description, featureNote, inputSchema, altSuggestions) {
152
+ var TagScopeEnum = zod.z.enum(["WORKSPACE", "PRIVATE", "TENANT", "GLOBAL"]);
153
+ var TagRelationTypeEnum = zod.z.enum(["SYNONYM", "ANTONYM", "BROADER", "NARROWER", "RELATED", "IMPLIES", "EXCLUDES"]).describe(
154
+ "Semantic relationship (SYNONYM = same meaning, BROADER/NARROWER = hierarchy, IMPLIES/EXCLUDES = behaviour, RELATED = generic)"
155
+ );
156
+ function message(error) {
157
+ return error instanceof Error ? error.message : String(error);
158
+ }
159
+ function pagination(limit, offset) {
160
+ return { limit: limit ?? 50, offset: offset ?? 0 };
161
+ }
162
+ function registerTagsTools(server, ctx, track) {
50
163
  server.registerTool(
51
- toolName,
164
+ track(mcpToolName(ctx.productName, "tags_list")),
52
165
  {
53
- title,
54
- description: `${description} [STUB]`,
55
- inputSchema
166
+ title: "List Tags",
167
+ description: "List tags in the current workspace, optionally filtered by text, vocabulary or parent. Returns { items, total, hasMore, nextCursor }.",
168
+ inputSchema: {
169
+ search: zod.z.string().optional().describe("Free-text search across key/label"),
170
+ vocabularyId: zod.z.string().optional().describe("Only tags in this vocabulary"),
171
+ parentId: zod.z.string().optional().describe("Only direct children of this tag"),
172
+ limit: zod.z.number().int().min(1).max(200).optional().describe("Page size (default 50)"),
173
+ offset: zod.z.number().int().min(0).optional().describe("Pagination offset (default 0)")
174
+ }
56
175
  },
57
- async () => errorResult(
58
- `[stubbed] ${featureNote} Use ${altSuggestions.join(", ")} instead. The tool remains registered so callers receive a meaningful response instead of a schema-validation error.`
59
- )
176
+ async ({ search, vocabularyId, parentId, limit, offset }) => {
177
+ try {
178
+ const filter = {};
179
+ if (search !== void 0) filter.search = search;
180
+ if (vocabularyId !== void 0) filter.vocabularyId = vocabularyId;
181
+ if (parentId !== void 0) filter.parentId = parentId;
182
+ const data = await ctx.gql.workspace.request(LIST_TAGS, {
183
+ filter: Object.keys(filter).length ? filter : void 0,
184
+ pagination: pagination(limit, offset)
185
+ });
186
+ return jsonResult(data.getTags);
187
+ } catch (error) {
188
+ ctx.logger.error("tags_list failed", { error: String(error) });
189
+ return errorResult(`Failed to list tags: ${message(error)}`);
190
+ }
191
+ }
192
+ );
193
+ server.registerTool(
194
+ track(mcpToolName(ctx.productName, "tags_get")),
195
+ {
196
+ title: "Get Tag",
197
+ description: "Get one tag with its hierarchy position and usage counts.",
198
+ inputSchema: { id: zod.z.string().describe("Tag ID") }
199
+ },
200
+ async ({ id }) => {
201
+ try {
202
+ const data = await ctx.gql.workspace.request(GET_TAG, {
203
+ id
204
+ });
205
+ if (!data.getTag) return errorResult(`Tag ${id} not found`);
206
+ return jsonResult(data.getTag);
207
+ } catch (error) {
208
+ ctx.logger.error("tags_get failed", { error: String(error) });
209
+ return errorResult(`Failed to get tag: ${message(error)}`);
210
+ }
211
+ }
212
+ );
213
+ server.registerTool(
214
+ track(mcpToolName(ctx.productName, "tags_vocabularies_list")),
215
+ {
216
+ title: "List Tag Vocabularies",
217
+ description: "List the tag vocabularies (taxonomies) available in the current workspace. Every tag belongs to a vocabulary, so call this before tags_create.",
218
+ inputSchema: {
219
+ applicableEntityType: zod.z.string().optional().describe("Only vocabularies that apply to this entity type (e.g. file)"),
220
+ limit: zod.z.number().int().min(1).max(200).optional().describe("Page size (default 50)"),
221
+ offset: zod.z.number().int().min(0).optional().describe("Pagination offset (default 0)")
222
+ }
223
+ },
224
+ async ({ applicableEntityType, limit, offset }) => {
225
+ try {
226
+ const data = await ctx.gql.workspace.request(
227
+ LIST_VOCABULARIES,
228
+ {
229
+ filter: applicableEntityType ? { applicableEntityType } : void 0,
230
+ pagination: pagination(limit, offset)
231
+ }
232
+ );
233
+ return jsonResult(data.getVocabularies);
234
+ } catch (error) {
235
+ ctx.logger.error("tags_vocabularies_list failed", { error: String(error) });
236
+ return errorResult(`Failed to list vocabularies: ${message(error)}`);
237
+ }
238
+ }
239
+ );
240
+ server.registerTool(
241
+ track(mcpToolName(ctx.productName, "tags_analytics")),
242
+ {
243
+ title: "Tag Analytics",
244
+ description: "Daily assignment / removal / unique-user counts for a tag over a time window.",
245
+ inputSchema: {
246
+ tagId: zod.z.string().describe("Tag ID"),
247
+ from: zod.z.string().describe("Window start (ISO-8601 date-time)"),
248
+ to: zod.z.string().describe("Window end (ISO-8601 date-time)")
249
+ }
250
+ },
251
+ async ({ tagId, from, to }) => {
252
+ try {
253
+ const data = await ctx.gql.workspace.request(
254
+ TAG_ANALYTICS,
255
+ { tagId, startDate: from, endDate: to }
256
+ );
257
+ return jsonResult(data.getTagAnalytics);
258
+ } catch (error) {
259
+ ctx.logger.error("tags_analytics failed", { error: String(error) });
260
+ return errorResult(`Failed to load tag analytics: ${message(error)}`);
261
+ }
262
+ }
263
+ );
264
+ server.registerTool(
265
+ track(mcpToolName(ctx.productName, "tags_create")),
266
+ {
267
+ title: "Create Tag",
268
+ description: "Create a tag in the current workspace. `key` must be unique within the vocabulary; get a vocabularyId from tags_vocabularies_list.",
269
+ inputSchema: {
270
+ vocabularyId: zod.z.string().describe("Vocabulary the tag belongs to"),
271
+ key: zod.z.string().min(1).describe("Stable identifier (kebab-case recommended)"),
272
+ label: zod.z.string().min(1).describe("Human-readable display name"),
273
+ description: zod.z.string().optional().describe("Free-form description"),
274
+ color: zod.z.string().optional().describe("Color value stored with the tag"),
275
+ icon: zod.z.string().optional().describe("Icon name (lucide identifier)"),
276
+ scope: TagScopeEnum.optional().describe("Visibility scope (default WORKSPACE)"),
277
+ parentId: zod.z.string().optional().describe("Parent tag ID for hierarchical taxonomies")
278
+ }
279
+ },
280
+ async ({ vocabularyId, key, label, description, color, icon, scope, parentId }) => {
281
+ try {
282
+ const input = {
283
+ vocabularyId,
284
+ key,
285
+ label,
286
+ scope: scope ?? "WORKSPACE"
287
+ };
288
+ if (description !== void 0) input.description = description;
289
+ if (color !== void 0) input.color = color;
290
+ if (icon !== void 0) input.icon = icon;
291
+ if (parentId !== void 0) input.parentId = parentId;
292
+ const data = await ctx.gql.workspace.request(CREATE_TAG, {
293
+ input
294
+ });
295
+ return jsonResult(data.createTag);
296
+ } catch (error) {
297
+ ctx.logger.error("tags_create failed", { error: String(error) });
298
+ return errorResult(`Failed to create tag: ${message(error)}`);
299
+ }
300
+ }
301
+ );
302
+ server.registerTool(
303
+ track(mcpToolName(ctx.productName, "tags_update")),
304
+ {
305
+ title: "Update Tag",
306
+ description: "Update a tag. Provide at least one of label, description, color, icon, parentId or displayOrder.",
307
+ inputSchema: {
308
+ id: zod.z.string().describe("Tag ID"),
309
+ label: zod.z.string().optional().describe("New display name"),
310
+ description: zod.z.string().optional().describe("New description (empty string clears it)"),
311
+ color: zod.z.string().optional().describe("New color value"),
312
+ icon: zod.z.string().optional().describe("New icon name"),
313
+ parentId: zod.z.string().optional().describe("New parent tag ID"),
314
+ displayOrder: zod.z.number().int().optional().describe("New order within the parent")
315
+ }
316
+ },
317
+ async ({ id, label, description, color, icon, parentId, displayOrder }) => {
318
+ try {
319
+ const input = {};
320
+ if (label !== void 0) input.label = label;
321
+ if (description !== void 0) input.description = description;
322
+ if (color !== void 0) input.color = color;
323
+ if (icon !== void 0) input.icon = icon;
324
+ if (parentId !== void 0) input.parentId = parentId;
325
+ if (displayOrder !== void 0) input.displayOrder = displayOrder;
326
+ if (Object.keys(input).length === 0) {
327
+ return errorResult(
328
+ "No updates specified: provide at least one of label, description, color, icon, parentId or displayOrder."
329
+ );
330
+ }
331
+ const data = await ctx.gql.workspace.request(UPDATE_TAG, {
332
+ id,
333
+ input
334
+ });
335
+ return jsonResult(data.updateTag);
336
+ } catch (error) {
337
+ ctx.logger.error("tags_update failed", { error: String(error) });
338
+ return errorResult(`Failed to update tag: ${message(error)}`);
339
+ }
340
+ }
341
+ );
342
+ server.registerTool(
343
+ track(mcpToolName(ctx.productName, "tags_delete")),
344
+ {
345
+ title: "Delete Tag",
346
+ description: "Delete a tag. Its assignments are removed with it.",
347
+ inputSchema: { id: zod.z.string().describe("Tag ID") }
348
+ },
349
+ async ({ id }) => {
350
+ try {
351
+ const data = await ctx.gql.workspace.request(DELETE_TAG, {
352
+ id
353
+ });
354
+ if (!data.deleteTag) return errorResult(`Tag ${id} was not deleted`);
355
+ return jsonResult({ deleted: true, id });
356
+ } catch (error) {
357
+ ctx.logger.error("tags_delete failed", { error: String(error) });
358
+ return errorResult(`Failed to delete tag: ${message(error)}`);
359
+ }
360
+ }
361
+ );
362
+ server.registerTool(
363
+ track(mcpToolName(ctx.productName, "tags_relations_list")),
364
+ {
365
+ title: "List Related Tags",
366
+ description: "List tags related to a tag, optionally restricted to one relation type.",
367
+ inputSchema: {
368
+ tagId: zod.z.string().describe("Tag ID"),
369
+ relationType: TagRelationTypeEnum.optional()
370
+ }
371
+ },
372
+ async ({ tagId, relationType }) => {
373
+ try {
374
+ const data = await ctx.gql.workspace.request(
375
+ TAG_RELATIONS,
376
+ { tagId, relationType }
377
+ );
378
+ return jsonResult(data.getRelatedTags);
379
+ } catch (error) {
380
+ ctx.logger.error("tags_relations_list failed", { error: String(error) });
381
+ return errorResult(`Failed to list related tags: ${message(error)}`);
382
+ }
383
+ }
384
+ );
385
+ server.registerTool(
386
+ track(mcpToolName(ctx.productName, "tags_relations_create")),
387
+ {
388
+ title: "Relate Two Tags",
389
+ description: "Create a semantic relation between two tags.",
390
+ inputSchema: {
391
+ fromTagId: zod.z.string().describe("Source tag ID"),
392
+ toTagId: zod.z.string().describe("Target tag ID"),
393
+ relationType: TagRelationTypeEnum,
394
+ bidirectional: zod.z.boolean().optional().describe("Also relate target to source")
395
+ }
396
+ },
397
+ async ({ fromTagId, toTagId, relationType, bidirectional }) => {
398
+ try {
399
+ const input = { fromTagId, toTagId, relationType };
400
+ if (bidirectional !== void 0) input.bidirectional = bidirectional;
401
+ const data = await ctx.gql.workspace.request(
402
+ CREATE_TAG_RELATION,
403
+ { input }
404
+ );
405
+ return jsonResult(data.createTagRelation);
406
+ } catch (error) {
407
+ ctx.logger.error("tags_relations_create failed", { error: String(error) });
408
+ return errorResult(`Failed to relate tags: ${message(error)}`);
409
+ }
410
+ }
411
+ );
412
+ server.registerTool(
413
+ track(mcpToolName(ctx.productName, "tags_relations_delete")),
414
+ {
415
+ title: "Delete Tag Relation",
416
+ description: "Delete a tag relation by its ID.",
417
+ inputSchema: { id: zod.z.string().describe("Relation ID") }
418
+ },
419
+ async ({ id }) => {
420
+ try {
421
+ const data = await ctx.gql.workspace.request(
422
+ DELETE_TAG_RELATION,
423
+ { id }
424
+ );
425
+ if (!data.deleteTagRelation) return errorResult(`Relation ${id} was not deleted`);
426
+ return jsonResult({ deleted: true, id });
427
+ } catch (error) {
428
+ ctx.logger.error("tags_relations_delete failed", { error: String(error) });
429
+ return errorResult(`Failed to delete tag relation: ${message(error)}`);
430
+ }
431
+ }
432
+ );
433
+ server.registerTool(
434
+ track(mcpToolName(ctx.productName, "tags_assign")),
435
+ {
436
+ title: "Tag an Entity",
437
+ description: 'Attach a tag to a workspace entity, for example a file (entityType "file") or a project.',
438
+ inputSchema: {
439
+ tagId: zod.z.string().describe("Tag ID"),
440
+ entityType: zod.z.string().min(1).describe("Entity type, e.g. file, folder, project"),
441
+ entityId: zod.z.string().describe("Entity ID")
442
+ }
443
+ },
444
+ async ({ tagId, entityType, entityId }) => {
445
+ try {
446
+ const data = await ctx.gql.workspace.request(ASSIGN_TAG, {
447
+ input: { tagId, entityType, entityId }
448
+ });
449
+ return jsonResult(data.assignTag);
450
+ } catch (error) {
451
+ ctx.logger.error("tags_assign failed", { error: String(error) });
452
+ return errorResult(`Failed to tag entity: ${message(error)}`);
453
+ }
454
+ }
455
+ );
456
+ server.registerTool(
457
+ track(mcpToolName(ctx.productName, "tags_entity_list")),
458
+ {
459
+ title: "List Tags on an Entity",
460
+ description: "List the tag assignments on one workspace entity.",
461
+ inputSchema: {
462
+ entityType: zod.z.string().min(1).describe("Entity type, e.g. file, folder, project"),
463
+ entityId: zod.z.string().describe("Entity ID")
464
+ }
465
+ },
466
+ async ({ entityType, entityId }) => {
467
+ try {
468
+ const data = await ctx.gql.workspace.request(
469
+ ENTITY_TAGS,
470
+ { entityType, entityId }
471
+ );
472
+ return jsonResult(data.getEntityTags);
473
+ } catch (error) {
474
+ ctx.logger.error("tags_entity_list failed", { error: String(error) });
475
+ return errorResult(`Failed to list entity tags: ${message(error)}`);
476
+ }
477
+ }
478
+ );
479
+ server.registerTool(
480
+ track(mcpToolName(ctx.productName, "tags_assignment_remove")),
481
+ {
482
+ title: "Remove a Tag Assignment",
483
+ description: "Remove one tag assignment (by assignment ID from tags_entity_list).",
484
+ inputSchema: { id: zod.z.string().describe("Tag assignment ID") }
485
+ },
486
+ async ({ id }) => {
487
+ try {
488
+ const data = await ctx.gql.workspace.request(
489
+ REMOVE_TAG_ASSIGNMENT,
490
+ { id }
491
+ );
492
+ if (!data.removeTagAssignment) return errorResult(`Assignment ${id} was not removed`);
493
+ return jsonResult({ removed: true, id });
494
+ } catch (error) {
495
+ ctx.logger.error("tags_assignment_remove failed", { error: String(error) });
496
+ return errorResult(`Failed to remove tag assignment: ${message(error)}`);
497
+ }
498
+ }
60
499
  );
61
- }
62
- function registerTagsTools(server, _ctx, track) {
63
- const featureNote = "Live alpha has `Query.tags` returning INTERNAL_SERVER_ERROR on even the simplest selection (`{ name }`). The whole tags surface is down until the service recovers.";
64
- const alts = [
65
- "the next alpha release that restores the tags surface",
66
- "the SDK tags API (which the MCP will mirror once it lands)"
67
- ];
68
- const tools = [
69
- ["tags_list", "List Tags", "List tags in the active workspace."],
70
- ["tags_get", "Get Tag", "Get a tag by ID."],
71
- ["tags_create", "Create Tag", "Create a new tag (requires `vocabularyId` on alpha)."],
72
- ["tags_update", "Update Tag", "Update an existing tag."],
73
- ["tags_delete", "Delete Tag", "Delete a tag by ID."],
74
- ["tags_analytics", "Tag Analytics", "Get analytics for a tag (assignment / usage counts)."],
75
- [
76
- "tags_permissions_list",
77
- "List Tag Permissions",
78
- "List tag-permission grants in the workspace."
79
- ],
80
- ["tags_permissions_grant", "Grant Tag Permission", "Grant a tag permission."],
81
- ["tags_permissions_revoke", "Revoke Tag Permission", "Revoke a tag permission."]
82
- ];
83
- for (const [tool, title, desc] of tools) {
84
- stubbedTool(
85
- server,
86
- track(mcpToolName(_ctx.productName, tool)),
87
- title,
88
- desc,
89
- featureNote,
90
- {},
91
- alts
92
- );
93
- }
94
500
  }
95
501
 
96
502
  // src/modules/tags/index.ts