@utaba/ucm-mcp-server 6.5.1 → 6.7.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.
Files changed (108) hide show
  1. package/dist/clients/UcmLocalApiClient.d.ts +221 -2
  2. package/dist/clients/UcmLocalApiClient.js +211 -3
  3. package/dist/index.js +1 -1
  4. package/dist/interfaces/IMcpTool.d.ts +2 -2
  5. package/dist/server/ToolRegistry.js +44 -8
  6. package/dist/tools/authorization/ListAuthorizationsTool.js +2 -2
  7. package/dist/tools/authorization/SignOutTool.js +2 -2
  8. package/dist/tools/base/BaseToolController.d.ts +7 -4
  9. package/dist/tools/base/BaseToolController.js +28 -11
  10. package/dist/tools/connections/AccessConnectionTool.js +2 -2
  11. package/dist/tools/connections/CallRemoteToolTool.js +3 -3
  12. package/dist/tools/core/DeleteArtifactTool.js +5 -4
  13. package/dist/tools/core/EditArtifactMetadataTool.js +1 -1
  14. package/dist/tools/core/GetArtifactTool.js +1 -1
  15. package/dist/tools/core/GetArtifactVersionsTool.js +1 -1
  16. package/dist/tools/core/GetChunkTool.js +1 -1
  17. package/dist/tools/core/ListArtifactsTool.js +1 -1
  18. package/dist/tools/core/MoveArtifactTool.d.ts +1 -1
  19. package/dist/tools/core/MoveArtifactTool.js +2 -2
  20. package/dist/tools/core/PublishArtifactFromFileTool.js +1 -1
  21. package/dist/tools/core/PublishArtifactTool.js +2 -2
  22. package/dist/tools/core/SearchArtifactsTool.js +7 -6
  23. package/dist/tools/memory-graph/GraphCreateEntitiesTool.d.ts +14 -0
  24. package/dist/tools/memory-graph/GraphCreateEntitiesTool.js +58 -0
  25. package/dist/tools/memory-graph/GraphCreateRelationshipsTool.d.ts +14 -0
  26. package/dist/tools/memory-graph/GraphCreateRelationshipsTool.js +57 -0
  27. package/dist/tools/memory-graph/GraphCreateTool.d.ts +14 -0
  28. package/dist/tools/memory-graph/GraphCreateTool.js +64 -0
  29. package/dist/tools/memory-graph/GraphDeleteEntitiesTool.d.ts +14 -0
  30. package/dist/tools/memory-graph/GraphDeleteEntitiesTool.js +45 -0
  31. package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.d.ts +14 -0
  32. package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.js +45 -0
  33. package/dist/tools/memory-graph/GraphExploreTool.d.ts +14 -0
  34. package/dist/tools/memory-graph/GraphExploreTool.js +73 -0
  35. package/dist/tools/memory-graph/GraphFindEntitiesTool.d.ts +14 -0
  36. package/dist/tools/memory-graph/GraphFindEntitiesTool.js +68 -0
  37. package/dist/tools/memory-graph/GraphFindPathsTool.d.ts +14 -0
  38. package/dist/tools/memory-graph/GraphFindPathsTool.js +62 -0
  39. package/dist/tools/memory-graph/GraphGetEntityTool.d.ts +14 -0
  40. package/dist/tools/memory-graph/GraphGetEntityTool.js +49 -0
  41. package/dist/tools/memory-graph/GraphGetRelationshipsTool.d.ts +14 -0
  42. package/dist/tools/memory-graph/GraphGetRelationshipsTool.js +62 -0
  43. package/dist/tools/memory-graph/GraphListTemplatesTool.d.ts +14 -0
  44. package/dist/tools/memory-graph/GraphListTemplatesTool.js +34 -0
  45. package/dist/tools/memory-graph/GraphListTool.d.ts +14 -0
  46. package/dist/tools/memory-graph/GraphListTool.js +45 -0
  47. package/dist/tools/memory-graph/GraphOpenTool.d.ts +15 -0
  48. package/dist/tools/memory-graph/GraphOpenTool.js +50 -0
  49. package/dist/tools/memory-graph/GraphProposeVocabularyTool.d.ts +14 -0
  50. package/dist/tools/memory-graph/GraphProposeVocabularyTool.js +149 -0
  51. package/dist/tools/memory-graph/GraphSearchTool.d.ts +14 -0
  52. package/dist/tools/memory-graph/GraphSearchTool.js +94 -0
  53. package/dist/tools/memory-graph/GraphTraverseTool.d.ts +14 -0
  54. package/dist/tools/memory-graph/GraphTraverseTool.js +114 -0
  55. package/dist/tools/memory-graph/GraphUpdateEntitiesTool.d.ts +14 -0
  56. package/dist/tools/memory-graph/GraphUpdateEntitiesTool.js +58 -0
  57. package/dist/tools/memory-graph/GraphUpdateTool.d.ts +14 -0
  58. package/dist/tools/memory-graph/GraphUpdateTool.js +59 -0
  59. package/dist/tools/memory-graph/KnowledgeSetListTool.d.ts +14 -0
  60. package/dist/tools/memory-graph/KnowledgeSetListTool.js +25 -0
  61. package/dist/tools/memory-graph/KnowledgeSetOpenTool.d.ts +14 -0
  62. package/dist/tools/memory-graph/KnowledgeSetOpenTool.js +31 -0
  63. package/dist/tools/repository/CreateRepositoryTool.js +10 -9
  64. package/dist/tools/repository/GetRepositoryTool.js +15 -15
  65. package/dist/tools/repository/UpdateRepositoryTool.js +10 -9
  66. package/dist/tools/sharepoint/SharePointListConnectionsTool.js +1 -1
  67. package/dist/tools/sharepoint/SharePointListFoldersTool.js +1 -1
  68. package/dist/tools/utility/AuthorIndexTool.js +6 -5
  69. package/dist/tools/utility/AuthorRecentsTool.js +6 -5
  70. package/dist/tools/utility/ListRepositoriesTool.js +5 -4
  71. package/dist/utils/McpErrorHandler.js +1 -1
  72. package/package.json +1 -1
  73. package/package.json.backup +1 -1
  74. package/dist/clients/UcmApiClient.d.ts +0 -157
  75. package/dist/clients/UcmApiClient.js +0 -443
  76. package/dist/publish/package.json +0 -37
  77. package/dist/tools/artifacts/GetArtifactController.d.ts +0 -34
  78. package/dist/tools/artifacts/GetArtifactController.js +0 -397
  79. package/dist/tools/artifacts/GetLatestController.d.ts +0 -39
  80. package/dist/tools/artifacts/GetLatestController.js +0 -469
  81. package/dist/tools/artifacts/ListVersionsController.d.ts +0 -43
  82. package/dist/tools/artifacts/ListVersionsController.js +0 -530
  83. package/dist/tools/artifacts/PublishArtifactController.d.ts +0 -37
  84. package/dist/tools/artifacts/PublishArtifactController.js +0 -605
  85. package/dist/tools/discovery/BrowseCategoriesController.d.ts +0 -25
  86. package/dist/tools/discovery/BrowseCategoriesController.js +0 -400
  87. package/dist/tools/discovery/FindByPurposeController.d.ts +0 -12
  88. package/dist/tools/discovery/FindByPurposeController.js +0 -131
  89. package/dist/tools/discovery/ListAuthorsController.d.ts +0 -20
  90. package/dist/tools/discovery/ListAuthorsController.js +0 -274
  91. package/dist/tools/discovery/SearchArtifactsController.d.ts +0 -14
  92. package/dist/tools/discovery/SearchArtifactsController.js +0 -226
  93. package/dist/tools/navigation/ExploreNamespaceController.d.ts +0 -35
  94. package/dist/tools/navigation/ExploreNamespaceController.js +0 -548
  95. package/dist/tools/repository/DeleteRepositoryGuidanceTool.d.ts +0 -13
  96. package/dist/tools/repository/DeleteRepositoryGuidanceTool.js +0 -93
  97. package/dist/tools/sharepoint/SharePointSignOutTool.d.ts +0 -22
  98. package/dist/tools/sharepoint/SharePointSignOutTool.js +0 -114
  99. package/dist/tools/utility/HealthCheckController.d.ts +0 -11
  100. package/dist/tools/utility/HealthCheckController.js +0 -60
  101. package/dist/tools/utility/SubmitFeedbackTool.d.ts +0 -16
  102. package/dist/tools/utility/SubmitFeedbackTool.js +0 -68
  103. package/dist/tools/utility/ValidatePathController.d.ts +0 -30
  104. package/dist/tools/utility/ValidatePathController.js +0 -465
  105. package/dist/utils/HttpsAgentFactory.d.ts +0 -21
  106. package/dist/utils/HttpsAgentFactory.js +0 -50
  107. package/dist/utils/ValidationUtils.d.ts +0 -10
  108. package/dist/utils/ValidationUtils.js +0 -50
@@ -1,4 +1,5 @@
1
1
  import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
2
+ import { ZodError } from 'zod';
2
3
  export class BaseToolController {
3
4
  ucmClient;
4
5
  logger;
@@ -8,29 +9,45 @@ export class BaseToolController {
8
9
  this.logger = logger;
9
10
  this.publishingAuthorId = publishingAuthorId;
10
11
  }
12
+ /** Override to provide a zod schema for runtime validation */
13
+ get schema() { return undefined; }
11
14
  async execute(params) {
12
15
  try {
13
- this.validateParams(params);
14
- return await this.handleExecute(params);
16
+ let validated;
17
+ if (this.schema) {
18
+ validated = this.schema.parse(params);
19
+ }
20
+ else {
21
+ this.validateParams(params);
22
+ validated = params;
23
+ }
24
+ return await this.handleExecute(validated);
15
25
  }
16
26
  catch (error) {
27
+ if (error instanceof ZodError) {
28
+ throw new McpError(McpErrorCode.InvalidParams, `Invalid parameters: ${error.errors.map(e => `${e.path.join('.')}: ${e.message}`).join(', ')}`);
29
+ }
17
30
  // Sanitize error for logging to avoid circular reference issues with axios errors
31
+ const err = error;
32
+ const response = err?.response;
33
+ const config = err?.config;
18
34
  const sanitizedError = {
19
- message: error?.message,
20
- name: error?.name,
21
- status: error?.response?.status,
22
- statusText: error?.response?.statusText,
23
- data: error?.response?.data,
24
- url: error?.config?.url
35
+ message: err?.message,
36
+ name: err?.name,
37
+ status: response?.status,
38
+ statusText: response?.statusText,
39
+ data: response?.data,
40
+ url: config?.url
25
41
  };
26
42
  this.logger.error('BaseToolController', `Tool ${this.name} execution failed`, '', sanitizedError);
27
43
  throw error;
28
44
  }
29
45
  }
30
46
  validateParams(params) {
31
- // Basic validation - can be overridden by specific tools
32
- if (this.inputSchema.required) {
33
- for (const field of this.inputSchema.required) {
47
+ // Legacy validation for tools that haven't adopted zod schemas yet
48
+ const schema = this.inputSchema;
49
+ if (schema.required) {
50
+ for (const field of schema.required) {
34
51
  if (params[field] === undefined || params[field] === null) {
35
52
  throw new McpError(McpErrorCode.InvalidParams, `Required parameter '${field}' is missing`);
36
53
  }
@@ -11,7 +11,7 @@ export class AccessConnectionTool extends BaseToolController {
11
11
  super(ucmClient, logger, publishingAuthorId);
12
12
  }
13
13
  get name() {
14
- return 'ucm_access_connection';
14
+ return 'ucm_connection_access';
15
15
  }
16
16
  get description() {
17
17
  return 'Access a specific external connection, check auth status, and return available tool schemas. Call without toolNames to get a summary index of all available tools. Pass toolNames to retrieve full parameter schemas.';
@@ -22,7 +22,7 @@ export class AccessConnectionTool extends BaseToolController {
22
22
  properties: {
23
23
  connectionId: {
24
24
  type: 'string',
25
- description: 'Connection ID (SharePoint connection or Remote MCP Server) from ucm_list_connections',
25
+ description: 'Connection ID (SharePoint connection or Remote MCP Server) from ucm_connection_list',
26
26
  minLength: 36,
27
27
  maxLength: 36
28
28
  },
@@ -11,7 +11,7 @@ export class CallRemoteToolTool extends BaseToolController {
11
11
  super(ucmClient, logger, publishingAuthorId);
12
12
  }
13
13
  get name() {
14
- return 'ucm_call_remote_tool';
14
+ return 'ucm_connection_call_tool';
15
15
  }
16
16
  get description() {
17
17
  return 'Call a tool on an external connection.';
@@ -22,13 +22,13 @@ export class CallRemoteToolTool extends BaseToolController {
22
22
  properties: {
23
23
  connectionId: {
24
24
  type: 'string',
25
- description: 'Connection ID (SharePoint connection or Remote MCP Server) from ucm_list_connections',
25
+ description: 'Connection ID (SharePoint connection or Remote MCP Server) from ucm_connection_list',
26
26
  minLength: 36,
27
27
  maxLength: 36
28
28
  },
29
29
  toolName: {
30
30
  type: 'string',
31
- description: 'Name of the tool to call (see ucm_access_connection for available tools)',
31
+ description: 'Name of the tool to call (see ucm_connection_access for available tools)',
32
32
  minLength: 1
33
33
  },
34
34
  args: {
@@ -4,7 +4,7 @@ export class DeleteArtifactTool extends BaseToolController {
4
4
  super(ucmClient, logger, publishingAuthorId);
5
5
  }
6
6
  get name() {
7
- return 'ucm_delete_artifact';
7
+ return 'ucm_artifact_delete';
8
8
  }
9
9
  get description() {
10
10
  return 'Delete a UCM artifact by path and version. This action cannot be undone. Only the latest or specified version is deleted.';
@@ -13,7 +13,7 @@ export class DeleteArtifactTool extends BaseToolController {
13
13
  return {
14
14
  type: 'object',
15
15
  properties: {
16
- author: {
16
+ workspace: {
17
17
  type: 'string',
18
18
  description: `Author name (e.g., ${this.publishingAuthorId || '01234567890'})`,
19
19
  minLength: 1,
@@ -44,11 +44,12 @@ export class DeleteArtifactTool extends BaseToolController {
44
44
  maxLength: 150
45
45
  }
46
46
  },
47
- required: ['author', 'repository', 'category', 'subcategory', 'filename']
47
+ required: ['workspace', 'repository', 'category', 'subcategory', 'filename']
48
48
  };
49
49
  }
50
50
  async handleExecute(params) {
51
- const { author, repository, category, subcategory, filename } = params;
51
+ const { workspace, repository, category, subcategory, filename } = params;
52
+ const author = workspace;
52
53
  this.logger.debug('DeleteArtifactTool', `Deleting artifact: ${author}/${repository}/${category}/${subcategory}/${filename}`);
53
54
  try {
54
55
  // Parse filename to extract version if present
@@ -6,7 +6,7 @@ export class EditArtifactMetadataTool extends BaseToolController {
6
6
  super(ucmClient, logger, publishingAuthorId);
7
7
  }
8
8
  get name() {
9
- return 'ucm_edit_artifact_metadata';
9
+ return 'ucm_artifact_edit_metadata';
10
10
  }
11
11
  get description() {
12
12
  return 'Edit artifact metadata and move artifacts. Supports updating description, namespace, filename, MIME type, technology, and tags. Move operations affect all versions while metadata-only updates apply to latest version only.';
@@ -8,7 +8,7 @@ export class GetArtifactTool extends BaseToolController {
8
8
  this.trustedAuthors = trustedAuthors;
9
9
  }
10
10
  get name() {
11
- return 'ucm_get_artifact';
11
+ return 'ucm_artifact_get';
12
12
  }
13
13
  get description() {
14
14
  return 'Retrieve UCM artifact content with metadata. Large files are automatically chunked.';
@@ -5,7 +5,7 @@ export class GetArtifactVersionsTool extends BaseToolController {
5
5
  super(ucmClient, logger, publishingAuthorId);
6
6
  }
7
7
  get name() {
8
- return 'ucm_get_artifact_versions';
8
+ return 'ucm_artifact_get_versions';
9
9
  }
10
10
  get description() {
11
11
  return 'Get all available versions of a specific UCM artifact';
@@ -6,7 +6,7 @@ export class GetChunkTool extends BaseToolController {
6
6
  super(ucmClient, logger, publishingAuthorId);
7
7
  }
8
8
  get name() {
9
- return 'ucm_get_chunk';
9
+ return 'ucm_artifact_get_chunk';
10
10
  }
11
11
  get description() {
12
12
  return 'Retrieve the next chunk of a large UCM artifact response';
@@ -5,7 +5,7 @@ export class ListArtifactsTool extends BaseToolController {
5
5
  super(ucmClient, logger, publishingAuthorId);
6
6
  }
7
7
  get name() {
8
- return 'ucm_list_artifacts';
8
+ return 'ucm_artifact_list';
9
9
  }
10
10
  get description() {
11
11
  return `List artifacts with exploratory browsing support. Can list authors, repositories, categories, subcategories, or artifacts depending on path depth. ${this.publishingAuthorId ? "Your author value is '" + this.publishingAuthorId + "'" : ''}`;
@@ -6,7 +6,7 @@ export declare class MoveArtifactTool extends BaseToolController {
6
6
  get name(): string;
7
7
  get description(): string;
8
8
  get inputSchema(): Record<string, unknown>;
9
- protected handleExecute(params: Record<string, unknown>): Promise<Record<string, unknown>>;
9
+ protected handleExecute(params: Record<string, unknown>): Promise<string>;
10
10
  protected validateParams(params: Record<string, unknown>): void;
11
11
  }
12
12
  //# sourceMappingURL=MoveArtifactTool.d.ts.map
@@ -6,7 +6,7 @@ export class MoveArtifactTool extends BaseToolController {
6
6
  super(ucmClient, logger, publishingAuthorId);
7
7
  }
8
8
  get name() {
9
- return 'ucm_move_artifact';
9
+ return 'ucm_artifact_move';
10
10
  }
11
11
  get description() {
12
12
  return 'Move an artifact from one namespace location to another. All versions are moved. Requires read access on source and write access on destination.';
@@ -57,7 +57,7 @@ export class MoveArtifactTool extends BaseToolController {
57
57
  _links: responseData._links || {}
58
58
  };
59
59
  this.logger.info('MoveArtifactTool', `Artifact moved successfully: ${sourcePath} → ${destinationPath}`);
60
- return response;
60
+ return JSON.stringify(response);
61
61
  }
62
62
  catch (error) {
63
63
  this.logger.error('MoveArtifactTool', `Failed to move artifact: ${sourcePath} → ${destinationPath}`, '', error);
@@ -8,7 +8,7 @@ export class PublishArtifactFromFileTool extends BaseToolController {
8
8
  super(ucmClient, logger, publishingAuthorId);
9
9
  }
10
10
  get name() {
11
- return 'ucm_publish_artifact_fromfile';
11
+ return 'ucm_artifact_publish_from_file';
12
12
  }
13
13
  get description() {
14
14
  return 'Create or update UCM artifacts from a file URI. Supports versioning. PREFERRED METHOD: Use this tool for file-based content as it is much faster and more efficient. Pass the local file path as a file:// URI (e.g., "file:///path/to/file.txt").';
@@ -6,10 +6,10 @@ export class PublishArtifactTool extends BaseToolController {
6
6
  super(ucmClient, logger, publishingAuthorId);
7
7
  }
8
8
  get name() {
9
- return 'ucm_publish_artifact';
9
+ return 'ucm_artifact_publish';
10
10
  }
11
11
  get description() {
12
- return 'Create or update UCM artifacts with content and metadata. Supports versioning and automatic conflict detection. The API automatically detects whether to create or update based on existing artifacts. NOTE: Only use this tool for small data - use ucm_publish_artifact_fromfile for files as it is much faster and more efficient.';
12
+ return 'Create or update UCM artifacts with content and metadata. Supports versioning and automatic conflict detection. The API automatically detects whether to create or update based on existing artifacts. NOTE: Only use this tool for small data - use ucm_artifact_publish_from_file for files as it is much faster and more efficient.';
13
13
  }
14
14
  get inputSchema() {
15
15
  return {
@@ -4,10 +4,10 @@ export class SearchArtifactsTool extends BaseToolController {
4
4
  super(ucmClient, logger, publishingAuthorId);
5
5
  }
6
6
  get name() {
7
- return 'ucm_search_artifacts';
7
+ return 'ucm_artifact_search';
8
8
  }
9
9
  get description() {
10
- return `Search artifacts by text across multiple metadata fields with privacy filtering. Searches namespace, filename, description, and tags fields. ${this.publishingAuthorId ? "Your author value is '" + this.publishingAuthorId + "'" : ''}`;
10
+ return `Search your workspaces by text across multiple metadata fields. Searches namespace, filename, description, and tags fields. ${this.publishingAuthorId ? "Your workspace value is '" + this.publishingAuthorId + "'" : ''}`;
11
11
  }
12
12
  get inputSchema() {
13
13
  return {
@@ -21,12 +21,12 @@ export class SearchArtifactsTool extends BaseToolController {
21
21
  },
22
22
  namespace: {
23
23
  type: 'string',
24
- description: 'Optional namespace filter (e.g., "utaba/main/commands/user")',
24
+ description: 'Optional namespace filter (e.g., "main/commands/user")',
25
25
  maxLength: 200
26
26
  },
27
- author: {
27
+ workspace: {
28
28
  type: 'string',
29
- description: `Optional. Leave empty to search your own author and public authors. '(e.g., "' + this.publishingAuthorId + '")' : ''}`,
29
+ description: `Optional workspace filter. Leave empty to search your workspaces. ${this.publishingAuthorId ? '(e.g., "' + this.publishingAuthorId + '")' : ''}`,
30
30
  maxLength: 50
31
31
  },
32
32
  repository: {
@@ -70,7 +70,8 @@ export class SearchArtifactsTool extends BaseToolController {
70
70
  };
71
71
  }
72
72
  async handleExecute(params) {
73
- const { searchText, namespace, author, repository, category, subcategory, filename, tags, offset, limit } = params;
73
+ const { searchText, namespace, workspace, repository, category, subcategory, filename, tags, offset, limit } = params;
74
+ const author = workspace;
74
75
  this.logger.debug('SearchArtifactsTool', `Searching with filters`, '', {
75
76
  searchText,
76
77
  namespace,
@@ -0,0 +1,14 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
+ import { ILogger } from '../../interfaces/ILogger.js';
4
+ import { type GraphCreateEntitiesParams } from '../../../schemas/memory-graph-tool-schemas.js';
5
+ import { ZodSchema } from 'zod';
6
+ export declare class GraphCreateEntitiesTool extends BaseToolController {
7
+ constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
8
+ get name(): string;
9
+ get description(): string;
10
+ get schema(): ZodSchema;
11
+ get inputSchema(): Record<string, unknown>;
12
+ protected handleExecute(params: GraphCreateEntitiesParams): Promise<string>;
13
+ }
14
+ //# sourceMappingURL=GraphCreateEntitiesTool.d.ts.map
@@ -0,0 +1,58 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ import { GraphCreateEntitiesSchema } from '../../../schemas/memory-graph-tool-schemas.js';
4
+ export class GraphCreateEntitiesTool extends BaseToolController {
5
+ constructor(ucmClient, logger, publishingAuthorId) {
6
+ super(ucmClient, logger, publishingAuthorId);
7
+ }
8
+ get name() { return 'ucm_graph_create_entities'; }
9
+ get description() {
10
+ return 'Create one or more entities in a Memory Graph. Each entity requires a type (from vocabulary) and label. Properties are validated against the vocabulary schema. Pass a single item in the array for single operations.';
11
+ }
12
+ get schema() { return GraphCreateEntitiesSchema; }
13
+ get inputSchema() {
14
+ return {
15
+ type: 'object',
16
+ properties: {
17
+ memoryGraphId: {
18
+ type: 'string',
19
+ description: 'The Memory Graph ID'
20
+ },
21
+ entities: {
22
+ type: 'array',
23
+ description: 'Array of entities to create',
24
+ items: {
25
+ type: 'object',
26
+ properties: {
27
+ entityType: { type: 'string', description: 'Entity type (must exist in vocabulary)' },
28
+ label: { type: 'string', description: 'Human-readable label for the entity' },
29
+ summary: { type: 'string', description: 'Brief summary/description' },
30
+ properties: { type: 'object', description: 'Entity properties (validated against vocabulary schema)' },
31
+ data: { type: ['string', 'object'], description: 'Optional freeform data attached to the entity' }
32
+ },
33
+ required: ['entityType', 'label']
34
+ }
35
+ }
36
+ },
37
+ required: ['memoryGraphId', 'entities']
38
+ };
39
+ }
40
+ async handleExecute(params) {
41
+ const { memoryGraphId, entities } = params;
42
+ this.logger.info('GraphCreateEntitiesTool', `Creating ${entities.length} entities in graph: ${memoryGraphId}`);
43
+ try {
44
+ const result = await this.ucmClient.graphCreateEntities(memoryGraphId, entities);
45
+ return JSON.stringify(result);
46
+ }
47
+ catch (error) {
48
+ if (error.response?.status === 400) {
49
+ throw new McpError(McpErrorCode.InvalidParams, error.response.data?.message || 'Validation error');
50
+ }
51
+ if (error.response?.status === 404) {
52
+ throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
53
+ }
54
+ throw new McpError(McpErrorCode.InternalError, `Failed to create entities: ${error.message}`);
55
+ }
56
+ }
57
+ }
58
+ //# sourceMappingURL=GraphCreateEntitiesTool.js.map
@@ -0,0 +1,14 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
+ import { ILogger } from '../../interfaces/ILogger.js';
4
+ import { type GraphCreateRelationshipsParams } from '../../../schemas/memory-graph-tool-schemas.js';
5
+ import { ZodSchema } from 'zod';
6
+ export declare class GraphCreateRelationshipsTool extends BaseToolController {
7
+ constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
8
+ get name(): string;
9
+ get description(): string;
10
+ get schema(): ZodSchema;
11
+ get inputSchema(): Record<string, unknown>;
12
+ protected handleExecute(params: GraphCreateRelationshipsParams): Promise<string>;
13
+ }
14
+ //# sourceMappingURL=GraphCreateRelationshipsTool.d.ts.map
@@ -0,0 +1,57 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ import { GraphCreateRelationshipsSchema } from '../../../schemas/memory-graph-tool-schemas.js';
4
+ export class GraphCreateRelationshipsTool extends BaseToolController {
5
+ constructor(ucmClient, logger, publishingAuthorId) {
6
+ super(ucmClient, logger, publishingAuthorId);
7
+ }
8
+ get name() { return 'ucm_graph_create_relationships'; }
9
+ get description() {
10
+ return 'Create one or more relationships between entities in a Memory Graph. Each relationship requires a type (from vocabulary), source entity ID, and target entity ID. Pass a single item in the array for single operations.';
11
+ }
12
+ get schema() { return GraphCreateRelationshipsSchema; }
13
+ get inputSchema() {
14
+ return {
15
+ type: 'object',
16
+ properties: {
17
+ memoryGraphId: {
18
+ type: 'string',
19
+ description: 'The Memory Graph ID'
20
+ },
21
+ relationships: {
22
+ type: 'array',
23
+ description: 'Array of relationships to create',
24
+ items: {
25
+ type: 'object',
26
+ properties: {
27
+ relationshipType: { type: 'string', description: 'Relationship type (must exist in vocabulary)' },
28
+ sourceEntityId: { type: 'string', description: 'Source entity ID' },
29
+ targetEntityId: { type: 'string', description: 'Target entity ID' },
30
+ properties: { type: 'object', description: 'Optional relationship properties' }
31
+ },
32
+ required: ['relationshipType', 'sourceEntityId', 'targetEntityId']
33
+ }
34
+ }
35
+ },
36
+ required: ['memoryGraphId', 'relationships']
37
+ };
38
+ }
39
+ async handleExecute(params) {
40
+ const { memoryGraphId, relationships } = params;
41
+ this.logger.info('GraphCreateRelationshipsTool', `Creating ${relationships.length} relationships in graph: ${memoryGraphId}`);
42
+ try {
43
+ const result = await this.ucmClient.graphCreateRelationships(memoryGraphId, relationships);
44
+ return JSON.stringify(result);
45
+ }
46
+ catch (error) {
47
+ if (error.response?.status === 400) {
48
+ throw new McpError(McpErrorCode.InvalidParams, error.response.data?.message || 'Validation error');
49
+ }
50
+ if (error.response?.status === 404) {
51
+ throw new McpError(McpErrorCode.InvalidParams, `Entity or Memory Graph not found`);
52
+ }
53
+ throw new McpError(McpErrorCode.InternalError, `Failed to create relationships: ${error.message}`);
54
+ }
55
+ }
56
+ }
57
+ //# sourceMappingURL=GraphCreateRelationshipsTool.js.map
@@ -0,0 +1,14 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
+ import { ILogger } from '../../interfaces/ILogger.js';
4
+ import { type GraphCreateParams } from '../../../schemas/memory-graph-tool-schemas.js';
5
+ import { ZodSchema } from 'zod';
6
+ export declare class GraphCreateTool extends BaseToolController {
7
+ constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
8
+ get name(): string;
9
+ get description(): string;
10
+ get schema(): ZodSchema;
11
+ get inputSchema(): Record<string, unknown>;
12
+ protected handleExecute(params: GraphCreateParams): Promise<string>;
13
+ }
14
+ //# sourceMappingURL=GraphCreateTool.d.ts.map
@@ -0,0 +1,64 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ import { GraphCreateSchema } from '../../../schemas/memory-graph-tool-schemas.js';
4
+ export class GraphCreateTool extends BaseToolController {
5
+ constructor(ucmClient, logger, publishingAuthorId) {
6
+ super(ucmClient, logger, publishingAuthorId);
7
+ }
8
+ get name() { return 'ucm_graph_create'; }
9
+ get description() {
10
+ return 'Create a new Memory Graph with a vocabulary template. Defaults to a personal graph. Set scope to \'organization\' to create an org-wide graph (requires Owner role). Call ucm_graph_list_templates first to see available templates.';
11
+ }
12
+ get schema() { return GraphCreateSchema; }
13
+ get inputSchema() {
14
+ return {
15
+ type: 'object',
16
+ properties: {
17
+ label: {
18
+ type: 'string',
19
+ description: 'Display name for the new Memory Graph'
20
+ },
21
+ templateId: {
22
+ type: 'string',
23
+ description: 'Vocabulary template ID to use for the graph. Use ucm_graph_list_templates to see available templates.'
24
+ },
25
+ description: {
26
+ type: 'string',
27
+ description: 'Optional description of the Memory Graph purpose'
28
+ },
29
+ scope: {
30
+ type: 'string',
31
+ enum: ['personal', 'organization'],
32
+ description: 'Graph ownership scope. "personal" (default) creates a graph owned by you. "organization" creates an org-wide graph (requires Owner role).'
33
+ }
34
+ },
35
+ required: ['label', 'templateId']
36
+ };
37
+ }
38
+ async handleExecute(params) {
39
+ const { label, templateId, description, scope } = params;
40
+ const resolvedScope = scope || 'personal';
41
+ this.logger.info('GraphCreateTool', `Creating ${resolvedScope} memory graph: ${label}`);
42
+ try {
43
+ const result = await this.ucmClient.createMemoryGraph({ label, templateId, description, scope: resolvedScope });
44
+ return JSON.stringify(result);
45
+ }
46
+ catch (error) {
47
+ if (error.response?.status === 400) {
48
+ const detail = error.response?.data?.message || 'Invalid parameters for graph creation';
49
+ throw new McpError(McpErrorCode.InvalidParams, detail);
50
+ }
51
+ if (error.response?.status === 403) {
52
+ throw new McpError(McpErrorCode.InvalidParams, 'Creating an organisation graph requires Owner role on the organisation.');
53
+ }
54
+ if (error.response?.status === 404) {
55
+ throw new McpError(McpErrorCode.InvalidParams, `Template not found: ${templateId}`);
56
+ }
57
+ if (error.response?.status === 503) {
58
+ throw new McpError(McpErrorCode.InternalError, `Deep Memory service is not configured`);
59
+ }
60
+ throw new McpError(McpErrorCode.InternalError, `Failed to create memory graph: ${error.message}`);
61
+ }
62
+ }
63
+ }
64
+ //# sourceMappingURL=GraphCreateTool.js.map
@@ -0,0 +1,14 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
+ import { ILogger } from '../../interfaces/ILogger.js';
4
+ import { type GraphDeleteEntitiesParams } from '../../../schemas/memory-graph-tool-schemas.js';
5
+ import { ZodSchema } from 'zod';
6
+ export declare class GraphDeleteEntitiesTool extends BaseToolController {
7
+ constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
8
+ get name(): string;
9
+ get description(): string;
10
+ get schema(): ZodSchema;
11
+ get inputSchema(): Record<string, unknown>;
12
+ protected handleExecute(params: GraphDeleteEntitiesParams): Promise<string>;
13
+ }
14
+ //# sourceMappingURL=GraphDeleteEntitiesTool.d.ts.map
@@ -0,0 +1,45 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ import { GraphDeleteEntitiesSchema } from '../../../schemas/memory-graph-tool-schemas.js';
4
+ export class GraphDeleteEntitiesTool extends BaseToolController {
5
+ constructor(ucmClient, logger, publishingAuthorId) {
6
+ super(ucmClient, logger, publishingAuthorId);
7
+ }
8
+ get name() { return 'ucm_graph_delete_entities'; }
9
+ get description() {
10
+ return 'Delete one or more entities from a Memory Graph. Each deleted entity also has its relationships removed. Pass entity IDs as an array.';
11
+ }
12
+ get schema() { return GraphDeleteEntitiesSchema; }
13
+ get inputSchema() {
14
+ return {
15
+ type: 'object',
16
+ properties: {
17
+ memoryGraphId: {
18
+ type: 'string',
19
+ description: 'The Memory Graph ID'
20
+ },
21
+ entityIds: {
22
+ type: 'array',
23
+ items: { type: 'string' },
24
+ description: 'Array of entity IDs to delete'
25
+ }
26
+ },
27
+ required: ['memoryGraphId', 'entityIds']
28
+ };
29
+ }
30
+ async handleExecute(params) {
31
+ const { memoryGraphId, entityIds } = params;
32
+ this.logger.info('GraphDeleteEntitiesTool', `Deleting ${entityIds.length} entities from graph: ${memoryGraphId}`);
33
+ try {
34
+ const result = await this.ucmClient.graphDeleteEntities(memoryGraphId, entityIds);
35
+ return JSON.stringify(result);
36
+ }
37
+ catch (error) {
38
+ if (error.response?.status === 404) {
39
+ throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
40
+ }
41
+ throw new McpError(McpErrorCode.InternalError, `Failed to delete entities: ${error.message}`);
42
+ }
43
+ }
44
+ }
45
+ //# sourceMappingURL=GraphDeleteEntitiesTool.js.map
@@ -0,0 +1,14 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
+ import { ILogger } from '../../interfaces/ILogger.js';
4
+ import { type GraphDeleteRelationshipsParams } from '../../../schemas/memory-graph-tool-schemas.js';
5
+ import { ZodSchema } from 'zod';
6
+ export declare class GraphDeleteRelationshipsTool extends BaseToolController {
7
+ constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
8
+ get name(): string;
9
+ get description(): string;
10
+ get schema(): ZodSchema;
11
+ get inputSchema(): Record<string, unknown>;
12
+ protected handleExecute(params: GraphDeleteRelationshipsParams): Promise<string>;
13
+ }
14
+ //# sourceMappingURL=GraphDeleteRelationshipsTool.d.ts.map
@@ -0,0 +1,45 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ import { GraphDeleteRelationshipsSchema } from '../../../schemas/memory-graph-tool-schemas.js';
4
+ export class GraphDeleteRelationshipsTool extends BaseToolController {
5
+ constructor(ucmClient, logger, publishingAuthorId) {
6
+ super(ucmClient, logger, publishingAuthorId);
7
+ }
8
+ get name() { return 'ucm_graph_delete_relationships'; }
9
+ get description() {
10
+ return 'Delete one or more relationships from a Memory Graph by their IDs. Pass relationship IDs as an array.';
11
+ }
12
+ get schema() { return GraphDeleteRelationshipsSchema; }
13
+ get inputSchema() {
14
+ return {
15
+ type: 'object',
16
+ properties: {
17
+ memoryGraphId: {
18
+ type: 'string',
19
+ description: 'The Memory Graph ID'
20
+ },
21
+ relationshipIds: {
22
+ type: 'array',
23
+ items: { type: 'string' },
24
+ description: 'Array of relationship IDs to delete'
25
+ }
26
+ },
27
+ required: ['memoryGraphId', 'relationshipIds']
28
+ };
29
+ }
30
+ async handleExecute(params) {
31
+ const { memoryGraphId, relationshipIds } = params;
32
+ this.logger.info('GraphDeleteRelationshipsTool', `Deleting ${relationshipIds.length} relationships from graph: ${memoryGraphId}`);
33
+ try {
34
+ const result = await this.ucmClient.graphDeleteRelationships(memoryGraphId, relationshipIds);
35
+ return JSON.stringify(result);
36
+ }
37
+ catch (error) {
38
+ if (error.response?.status === 404) {
39
+ throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
40
+ }
41
+ throw new McpError(McpErrorCode.InternalError, `Failed to delete relationships: ${error.message}`);
42
+ }
43
+ }
44
+ }
45
+ //# sourceMappingURL=GraphDeleteRelationshipsTool.js.map