@utaba/ucm-mcp-server 6.5.1 → 6.6.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 (196) hide show
  1. package/dist/clients/UcmLocalApiClient.d.ts +174 -2
  2. package/dist/clients/UcmLocalApiClient.js +203 -3
  3. package/dist/mcp-server/clients/UcmLocalApiClient.d.ts +399 -0
  4. package/dist/mcp-server/clients/UcmLocalApiClient.js +719 -0
  5. package/dist/mcp-server/index.d.ts +3 -0
  6. package/dist/mcp-server/index.js +68 -0
  7. package/dist/mcp-server/interfaces/ILogger.d.ts +8 -0
  8. package/dist/mcp-server/interfaces/ILogger.js +4 -0
  9. package/dist/mcp-server/interfaces/IMcpTool.d.ts +7 -0
  10. package/dist/mcp-server/interfaces/IMcpTool.js +3 -0
  11. package/dist/mcp-server/logging/ConsoleLogger.d.ts +16 -0
  12. package/dist/mcp-server/logging/ConsoleLogger.js +45 -0
  13. package/dist/mcp-server/logging/LoggerFactory.d.ts +9 -0
  14. package/dist/mcp-server/logging/LoggerFactory.js +12 -0
  15. package/dist/mcp-server/server/McpConfig.d.ts +26 -0
  16. package/dist/mcp-server/server/McpConfig.js +90 -0
  17. package/dist/mcp-server/server/McpHandler.d.ts +12 -0
  18. package/dist/mcp-server/server/McpHandler.js +84 -0
  19. package/dist/mcp-server/server/McpServer.d.ts +15 -0
  20. package/dist/mcp-server/server/McpServer.js +49 -0
  21. package/dist/mcp-server/server/ToolRegistry.d.ts +23 -0
  22. package/dist/mcp-server/server/ToolRegistry.js +169 -0
  23. package/dist/mcp-server/tools/authorization/ListAuthorizationsTool.d.ts +21 -0
  24. package/dist/mcp-server/tools/authorization/ListAuthorizationsTool.js +146 -0
  25. package/dist/mcp-server/tools/authorization/SignOutTool.d.ts +23 -0
  26. package/dist/mcp-server/tools/authorization/SignOutTool.js +128 -0
  27. package/dist/mcp-server/tools/base/BaseToolController.d.ts +19 -0
  28. package/dist/mcp-server/tools/base/BaseToolController.js +58 -0
  29. package/dist/mcp-server/tools/connections/AccessConnectionTool.d.ts +21 -0
  30. package/dist/mcp-server/tools/connections/AccessConnectionTool.js +107 -0
  31. package/dist/mcp-server/tools/connections/CallRemoteToolTool.d.ts +22 -0
  32. package/dist/mcp-server/tools/connections/CallRemoteToolTool.js +124 -0
  33. package/dist/mcp-server/tools/core/DeleteArtifactTool.d.ts +11 -0
  34. package/dist/mcp-server/tools/core/DeleteArtifactTool.js +83 -0
  35. package/dist/mcp-server/tools/core/EditArtifactMetadataTool.d.ts +12 -0
  36. package/dist/mcp-server/tools/core/EditArtifactMetadataTool.js +173 -0
  37. package/dist/mcp-server/tools/core/GetArtifactTool.d.ts +13 -0
  38. package/dist/mcp-server/tools/core/GetArtifactTool.js +124 -0
  39. package/dist/mcp-server/tools/core/GetArtifactVersionsTool.d.ts +11 -0
  40. package/dist/mcp-server/tools/core/GetArtifactVersionsTool.js +63 -0
  41. package/dist/mcp-server/tools/core/GetChunkTool.d.ts +11 -0
  42. package/dist/mcp-server/tools/core/GetChunkTool.js +56 -0
  43. package/dist/mcp-server/tools/core/ListArtifactsTool.d.ts +11 -0
  44. package/dist/mcp-server/tools/core/ListArtifactsTool.js +84 -0
  45. package/dist/mcp-server/tools/core/MoveArtifactTool.d.ts +12 -0
  46. package/dist/mcp-server/tools/core/MoveArtifactTool.js +104 -0
  47. package/dist/mcp-server/tools/core/PublishArtifactFromFileTool.d.ts +15 -0
  48. package/dist/mcp-server/tools/core/PublishArtifactFromFileTool.js +277 -0
  49. package/dist/mcp-server/tools/core/PublishArtifactTool.d.ts +13 -0
  50. package/dist/mcp-server/tools/core/PublishArtifactTool.js +218 -0
  51. package/dist/mcp-server/tools/core/SearchArtifactsTool.d.ts +11 -0
  52. package/dist/mcp-server/tools/core/SearchArtifactsTool.js +137 -0
  53. package/dist/mcp-server/tools/list/ListNamespaceController.d.ts +1 -0
  54. package/dist/mcp-server/tools/list/ListNamespaceController.js +8 -0
  55. package/dist/mcp-server/tools/memory-graph/GraphCreateEntitiesTool.d.ts +14 -0
  56. package/dist/mcp-server/tools/memory-graph/GraphCreateEntitiesTool.js +58 -0
  57. package/dist/mcp-server/tools/memory-graph/GraphCreateRelationshipsTool.d.ts +14 -0
  58. package/dist/mcp-server/tools/memory-graph/GraphCreateRelationshipsTool.js +57 -0
  59. package/dist/mcp-server/tools/memory-graph/GraphCreateTool.d.ts +14 -0
  60. package/dist/mcp-server/tools/memory-graph/GraphCreateTool.js +64 -0
  61. package/dist/mcp-server/tools/memory-graph/GraphDeleteEntitiesTool.d.ts +14 -0
  62. package/dist/mcp-server/tools/memory-graph/GraphDeleteEntitiesTool.js +45 -0
  63. package/dist/mcp-server/tools/memory-graph/GraphDeleteRelationshipsTool.d.ts +14 -0
  64. package/dist/mcp-server/tools/memory-graph/GraphDeleteRelationshipsTool.js +45 -0
  65. package/dist/mcp-server/tools/memory-graph/GraphExploreTool.d.ts +14 -0
  66. package/dist/mcp-server/tools/memory-graph/GraphExploreTool.js +73 -0
  67. package/dist/mcp-server/tools/memory-graph/GraphFindEntitiesTool.d.ts +14 -0
  68. package/dist/mcp-server/tools/memory-graph/GraphFindEntitiesTool.js +68 -0
  69. package/dist/mcp-server/tools/memory-graph/GraphFindPathsTool.d.ts +14 -0
  70. package/dist/mcp-server/tools/memory-graph/GraphFindPathsTool.js +62 -0
  71. package/dist/mcp-server/tools/memory-graph/GraphGetEntityTool.d.ts +14 -0
  72. package/dist/mcp-server/tools/memory-graph/GraphGetEntityTool.js +49 -0
  73. package/dist/mcp-server/tools/memory-graph/GraphGetRelationshipsTool.d.ts +14 -0
  74. package/dist/mcp-server/tools/memory-graph/GraphGetRelationshipsTool.js +62 -0
  75. package/dist/mcp-server/tools/memory-graph/GraphListTemplatesTool.d.ts +14 -0
  76. package/dist/mcp-server/tools/memory-graph/GraphListTemplatesTool.js +34 -0
  77. package/dist/mcp-server/tools/memory-graph/GraphListTool.d.ts +14 -0
  78. package/dist/mcp-server/tools/memory-graph/GraphListTool.js +45 -0
  79. package/dist/mcp-server/tools/memory-graph/GraphOpenTool.d.ts +15 -0
  80. package/dist/mcp-server/tools/memory-graph/GraphOpenTool.js +50 -0
  81. package/dist/mcp-server/tools/memory-graph/GraphProposeVocabularyTool.d.ts +14 -0
  82. package/dist/mcp-server/tools/memory-graph/GraphProposeVocabularyTool.js +108 -0
  83. package/dist/mcp-server/tools/memory-graph/GraphSearchTool.d.ts +14 -0
  84. package/dist/mcp-server/tools/memory-graph/GraphSearchTool.js +94 -0
  85. package/dist/mcp-server/tools/memory-graph/GraphTraverseTool.d.ts +14 -0
  86. package/dist/mcp-server/tools/memory-graph/GraphTraverseTool.js +114 -0
  87. package/dist/mcp-server/tools/memory-graph/GraphUpdateEntitiesTool.d.ts +14 -0
  88. package/dist/mcp-server/tools/memory-graph/GraphUpdateEntitiesTool.js +58 -0
  89. package/dist/mcp-server/tools/memory-graph/KnowledgeSetListTool.d.ts +14 -0
  90. package/dist/mcp-server/tools/memory-graph/KnowledgeSetListTool.js +25 -0
  91. package/dist/mcp-server/tools/memory-graph/KnowledgeSetOpenTool.d.ts +14 -0
  92. package/dist/mcp-server/tools/memory-graph/KnowledgeSetOpenTool.js +31 -0
  93. package/dist/mcp-server/tools/repository/CreateRepositoryTool.d.ts +12 -0
  94. package/dist/mcp-server/tools/repository/CreateRepositoryTool.js +116 -0
  95. package/dist/mcp-server/tools/repository/GetRepositoryTool.d.ts +12 -0
  96. package/dist/mcp-server/tools/repository/GetRepositoryTool.js +85 -0
  97. package/dist/mcp-server/tools/repository/UpdateRepositoryTool.d.ts +12 -0
  98. package/dist/mcp-server/tools/repository/UpdateRepositoryTool.js +115 -0
  99. package/dist/mcp-server/tools/sharepoint/SharePointListConnectionsTool.d.ts +19 -0
  100. package/dist/mcp-server/tools/sharepoint/SharePointListConnectionsTool.js +90 -0
  101. package/dist/mcp-server/tools/sharepoint/SharePointListFoldersTool.d.ts +21 -0
  102. package/dist/mcp-server/tools/sharepoint/SharePointListFoldersTool.js +133 -0
  103. package/dist/mcp-server/tools/sharepoint/SharePointReadFileTool.d.ts +22 -0
  104. package/dist/mcp-server/tools/sharepoint/SharePointReadFileTool.js +146 -0
  105. package/dist/mcp-server/tools/sharepoint/SharePointReadRelatedFileTool.d.ts +18 -0
  106. package/dist/mcp-server/tools/sharepoint/SharePointReadRelatedFileTool.js +108 -0
  107. package/dist/mcp-server/tools/sharepoint/SharePointSearchTool.d.ts +22 -0
  108. package/dist/mcp-server/tools/sharepoint/SharePointSearchTool.js +125 -0
  109. package/dist/mcp-server/tools/utility/AuthorIndexTool.d.ts +11 -0
  110. package/dist/mcp-server/tools/utility/AuthorIndexTool.js +49 -0
  111. package/dist/mcp-server/tools/utility/AuthorRecentsTool.d.ts +11 -0
  112. package/dist/mcp-server/tools/utility/AuthorRecentsTool.js +49 -0
  113. package/dist/mcp-server/tools/utility/ListRepositoriesTool.d.ts +11 -0
  114. package/dist/mcp-server/tools/utility/ListRepositoriesTool.js +68 -0
  115. package/dist/mcp-server/tools/utility/QuickstartTool.d.ts +11 -0
  116. package/dist/mcp-server/tools/utility/QuickstartTool.js +36 -0
  117. package/dist/mcp-server/types/UcmApiTypes.d.ts +40 -0
  118. package/dist/mcp-server/types/UcmApiTypes.js +4 -0
  119. package/dist/mcp-server/utils/McpErrorHandler.d.ts +25 -0
  120. package/dist/mcp-server/utils/McpErrorHandler.js +67 -0
  121. package/dist/mcp-server/utils/PathUtils.d.ts +61 -0
  122. package/dist/mcp-server/utils/PathUtils.js +178 -0
  123. package/dist/mcp-server/utils/ResponseChunker.d.ts +25 -0
  124. package/dist/mcp-server/utils/ResponseChunker.js +79 -0
  125. package/dist/mcp-server/utils/SharePointErrorHandler.d.ts +34 -0
  126. package/dist/mcp-server/utils/SharePointErrorHandler.js +55 -0
  127. package/dist/schemas/memory-graph-tool-schemas.d.ts +789 -0
  128. package/dist/schemas/memory-graph-tool-schemas.js +181 -0
  129. package/dist/server/ToolRegistry.js +42 -8
  130. package/dist/tools/authorization/ListAuthorizationsTool.js +2 -2
  131. package/dist/tools/authorization/SignOutTool.js +2 -2
  132. package/dist/tools/connections/AccessConnectionTool.js +2 -2
  133. package/dist/tools/connections/CallRemoteToolTool.js +3 -3
  134. package/dist/tools/core/DeleteArtifactTool.js +5 -4
  135. package/dist/tools/core/EditArtifactMetadataTool.js +1 -1
  136. package/dist/tools/core/GetArtifactTool.js +1 -1
  137. package/dist/tools/core/GetArtifactVersionsTool.js +1 -1
  138. package/dist/tools/core/GetChunkTool.js +1 -1
  139. package/dist/tools/core/ListArtifactsTool.js +1 -1
  140. package/dist/tools/core/MoveArtifactTool.js +1 -1
  141. package/dist/tools/core/PublishArtifactFromFileTool.js +1 -1
  142. package/dist/tools/core/PublishArtifactTool.js +2 -2
  143. package/dist/tools/core/SearchArtifactsTool.js +7 -6
  144. package/dist/tools/memory-graph/GraphCreateEntitiesTool.d.ts +11 -0
  145. package/dist/tools/memory-graph/GraphCreateEntitiesTool.js +56 -0
  146. package/dist/tools/memory-graph/GraphCreateRelationshipsTool.d.ts +11 -0
  147. package/dist/tools/memory-graph/GraphCreateRelationshipsTool.js +55 -0
  148. package/dist/tools/memory-graph/GraphCreateTool.d.ts +11 -0
  149. package/dist/tools/memory-graph/GraphCreateTool.js +62 -0
  150. package/dist/tools/memory-graph/GraphDeleteEntitiesTool.d.ts +11 -0
  151. package/dist/tools/memory-graph/GraphDeleteEntitiesTool.js +43 -0
  152. package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.d.ts +11 -0
  153. package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.js +43 -0
  154. package/dist/tools/memory-graph/GraphExploreTool.d.ts +11 -0
  155. package/dist/tools/memory-graph/GraphExploreTool.js +71 -0
  156. package/dist/tools/memory-graph/GraphFindEntitiesTool.d.ts +11 -0
  157. package/dist/tools/memory-graph/GraphFindEntitiesTool.js +66 -0
  158. package/dist/tools/memory-graph/GraphFindPathsTool.d.ts +11 -0
  159. package/dist/tools/memory-graph/GraphFindPathsTool.js +60 -0
  160. package/dist/tools/memory-graph/GraphGetEntityTool.d.ts +11 -0
  161. package/dist/tools/memory-graph/GraphGetEntityTool.js +47 -0
  162. package/dist/tools/memory-graph/GraphGetRelationshipsTool.d.ts +11 -0
  163. package/dist/tools/memory-graph/GraphGetRelationshipsTool.js +60 -0
  164. package/dist/tools/memory-graph/GraphGetStatsTool.d.ts +11 -0
  165. package/dist/tools/memory-graph/GraphGetStatsTool.js +42 -0
  166. package/dist/tools/memory-graph/GraphListTemplatesTool.d.ts +11 -0
  167. package/dist/tools/memory-graph/GraphListTemplatesTool.js +32 -0
  168. package/dist/tools/memory-graph/GraphListTool.d.ts +11 -0
  169. package/dist/tools/memory-graph/GraphListTool.js +43 -0
  170. package/dist/tools/memory-graph/GraphOpenTool.d.ts +12 -0
  171. package/dist/tools/memory-graph/GraphOpenTool.js +48 -0
  172. package/dist/tools/memory-graph/GraphProposeVocabularyTool.d.ts +11 -0
  173. package/dist/tools/memory-graph/GraphProposeVocabularyTool.js +104 -0
  174. package/dist/tools/memory-graph/GraphRemoveRelationshipsTool.d.ts +11 -0
  175. package/dist/tools/memory-graph/GraphRemoveRelationshipsTool.js +47 -0
  176. package/dist/tools/memory-graph/GraphSearchTool.d.ts +11 -0
  177. package/dist/tools/memory-graph/GraphSearchTool.js +92 -0
  178. package/dist/tools/memory-graph/GraphTraverseTool.d.ts +11 -0
  179. package/dist/tools/memory-graph/GraphTraverseTool.js +112 -0
  180. package/dist/tools/memory-graph/GraphUpdateEntitiesTool.d.ts +11 -0
  181. package/dist/tools/memory-graph/GraphUpdateEntitiesTool.js +56 -0
  182. package/dist/tools/memory-graph/KnowledgeSetListTool.d.ts +11 -0
  183. package/dist/tools/memory-graph/KnowledgeSetListTool.js +23 -0
  184. package/dist/tools/memory-graph/KnowledgeSetOpenTool.d.ts +11 -0
  185. package/dist/tools/memory-graph/KnowledgeSetOpenTool.js +29 -0
  186. package/dist/tools/repository/CreateRepositoryTool.js +10 -9
  187. package/dist/tools/repository/GetRepositoryTool.js +15 -15
  188. package/dist/tools/repository/UpdateRepositoryTool.js +10 -9
  189. package/dist/tools/sharepoint/SharePointListConnectionsTool.js +1 -1
  190. package/dist/tools/sharepoint/SharePointListFoldersTool.js +1 -1
  191. package/dist/tools/utility/AuthorIndexTool.js +6 -5
  192. package/dist/tools/utility/AuthorRecentsTool.js +6 -5
  193. package/dist/tools/utility/ListRepositoriesTool.js +5 -4
  194. package/dist/utils/McpErrorHandler.js +1 -1
  195. package/package.json +1 -1
  196. package/package.json.backup +1 -1
@@ -0,0 +1,42 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ export class GraphGetStatsTool extends BaseToolController {
4
+ constructor(ucmClient, logger, publishingAuthorId) {
5
+ super(ucmClient, logger, publishingAuthorId);
6
+ }
7
+ get name() { return 'ucm_graph_get_stats'; }
8
+ get description() {
9
+ return 'Get statistics for a Memory Graph — entity count, relationship count, and vocabulary summary.';
10
+ }
11
+ get inputSchema() {
12
+ return {
13
+ type: 'object',
14
+ properties: {
15
+ organizationId: {
16
+ type: 'string',
17
+ description: 'The organization ID'
18
+ },
19
+ memoryGraphId: {
20
+ type: 'string',
21
+ description: 'The Memory Graph ID'
22
+ }
23
+ },
24
+ required: ['organizationId', 'memoryGraphId']
25
+ };
26
+ }
27
+ async handleExecute(params) {
28
+ const { organizationId, memoryGraphId } = params;
29
+ this.logger.info('GraphGetStatsTool', `Getting stats for graph: ${memoryGraphId}`);
30
+ try {
31
+ const result = await this.ucmClient.graphGetStats(organizationId, memoryGraphId);
32
+ return JSON.stringify(result);
33
+ }
34
+ catch (error) {
35
+ if (error.response?.status === 404) {
36
+ throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
37
+ }
38
+ throw new McpError(McpErrorCode.InternalError, `Failed to get graph stats: ${error.message}`);
39
+ }
40
+ }
41
+ }
42
+ //# sourceMappingURL=GraphGetStatsTool.js.map
@@ -0,0 +1,11 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
+ import { ILogger } from '../../interfaces/ILogger.js';
4
+ export declare class GraphListTemplatesTool extends BaseToolController {
5
+ constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
6
+ get name(): string;
7
+ get description(): string;
8
+ get inputSchema(): any;
9
+ protected handleExecute(_params: any): Promise<any>;
10
+ }
11
+ //# sourceMappingURL=GraphListTemplatesTool.d.ts.map
@@ -0,0 +1,32 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ export class GraphListTemplatesTool extends BaseToolController {
4
+ constructor(ucmClient, logger, publishingAuthorId) {
5
+ super(ucmClient, logger, publishingAuthorId);
6
+ }
7
+ get name() { return 'ucm_graph_list_templates'; }
8
+ get description() {
9
+ return 'List available vocabulary templates for creating Memory Graphs. Each template defines entity types, relationship types, and property definitions for a specific domain. Use the templateId when calling ucm_graph_create.';
10
+ }
11
+ get inputSchema() {
12
+ return {
13
+ type: 'object',
14
+ properties: {},
15
+ required: []
16
+ };
17
+ }
18
+ async handleExecute(_params) {
19
+ this.logger.info('GraphListTemplatesTool', 'Listing vocabulary templates');
20
+ try {
21
+ const result = await this.ucmClient.listMemoryGraphTemplates();
22
+ return JSON.stringify(result);
23
+ }
24
+ catch (error) {
25
+ if (error.response?.status === 503) {
26
+ throw new McpError(McpErrorCode.InternalError, `Deep Memory service is not configured`);
27
+ }
28
+ throw new McpError(McpErrorCode.InternalError, `Failed to list templates: ${error.message}`);
29
+ }
30
+ }
31
+ }
32
+ //# sourceMappingURL=GraphListTemplatesTool.js.map
@@ -0,0 +1,11 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
+ import { ILogger } from '../../interfaces/ILogger.js';
4
+ export declare class GraphListTool extends BaseToolController {
5
+ constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
6
+ get name(): string;
7
+ get description(): string;
8
+ get inputSchema(): any;
9
+ protected handleExecute(params: any): Promise<any>;
10
+ }
11
+ //# sourceMappingURL=GraphListTool.d.ts.map
@@ -0,0 +1,43 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ export class GraphListTool extends BaseToolController {
3
+ constructor(ucmClient, logger, publishingAuthorId) {
4
+ super(ucmClient, logger, publishingAuthorId);
5
+ }
6
+ get name() { return 'ucm_graph_list'; }
7
+ get description() {
8
+ return 'List all Memory Graphs you have access to (including those not in a Knowledge Set). Returns graph metadata, embedding status, descriptions, and ownership scope (personal or organization).';
9
+ }
10
+ get inputSchema() {
11
+ return {
12
+ type: 'object',
13
+ properties: {
14
+ scope: {
15
+ type: 'string',
16
+ enum: ['organization', 'personal', 'all'],
17
+ description: 'Filter graphs by ownership scope. "organization" returns only org graphs, "personal" returns only your personal graphs, "all" (default) returns both.'
18
+ }
19
+ },
20
+ required: []
21
+ };
22
+ }
23
+ async handleExecute(params) {
24
+ const { scope } = params;
25
+ this.logger.info('GraphListTool', `Listing memory graphs (scope: ${scope ?? 'all'})`);
26
+ const result = await this.ucmClient.listMemoryGraphs(scope ?? 'all');
27
+ // Annotate each graph with a scope field based on which owner field is set
28
+ if (result && Array.isArray(result.data)) {
29
+ result.data = result.data.map((graph) => ({
30
+ ...graph,
31
+ scope: graph.userId ? 'personal' : 'organization'
32
+ }));
33
+ }
34
+ else if (Array.isArray(result)) {
35
+ return JSON.stringify(result.map((graph) => ({
36
+ ...graph,
37
+ scope: graph.userId ? 'personal' : 'organization'
38
+ })));
39
+ }
40
+ return JSON.stringify(result);
41
+ }
42
+ }
43
+ //# sourceMappingURL=GraphListTool.js.map
@@ -0,0 +1,12 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
+ import { ILogger } from '../../interfaces/ILogger.js';
4
+ export declare class GraphOpenTool extends BaseToolController {
5
+ constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
6
+ get name(): string;
7
+ get description(): string;
8
+ get inputSchema(): any;
9
+ protected handleExecute(params: any): Promise<any>;
10
+ private handleApiError;
11
+ }
12
+ //# sourceMappingURL=GraphOpenTool.d.ts.map
@@ -0,0 +1,48 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ export class GraphOpenTool extends BaseToolController {
4
+ constructor(ucmClient, logger, publishingAuthorId) {
5
+ super(ucmClient, logger, publishingAuthorId);
6
+ }
7
+ get name() { return 'ucm_graph_open'; }
8
+ get description() {
9
+ return 'Open a Memory Graph and get its vocabulary, statistics, instructions, and policies. Call this FIRST before querying a graph — it returns the schema (entity types, relationship types, property definitions) needed to construct queries.';
10
+ }
11
+ get inputSchema() {
12
+ return {
13
+ type: 'object',
14
+ properties: {
15
+ memoryGraphId: {
16
+ type: 'string',
17
+ description: 'The Memory Graph ID to open'
18
+ }
19
+ },
20
+ required: ['memoryGraphId']
21
+ };
22
+ }
23
+ async handleExecute(params) {
24
+ const { memoryGraphId } = params;
25
+ this.logger.info('GraphOpenTool', `Opening graph: ${memoryGraphId}`);
26
+ try {
27
+ const result = await this.ucmClient.graphOpen(memoryGraphId);
28
+ // scope is now returned directly by the OpenGraphCommand — no annotation needed
29
+ return JSON.stringify(result);
30
+ }
31
+ catch (error) {
32
+ this.handleApiError(error, 'open memory graph');
33
+ }
34
+ }
35
+ handleApiError(error, action) {
36
+ if (error.response?.status === 403) {
37
+ throw new McpError(McpErrorCode.InvalidParams, `Access denied: you do not have permission to open this Memory Graph`);
38
+ }
39
+ if (error.response?.status === 404) {
40
+ throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
41
+ }
42
+ if (error.response?.status === 503) {
43
+ throw new McpError(McpErrorCode.InternalError, `Deep Memory service is not configured`);
44
+ }
45
+ throw new McpError(McpErrorCode.InternalError, `Failed to ${action}: ${error.message}`);
46
+ }
47
+ }
48
+ //# sourceMappingURL=GraphOpenTool.js.map
@@ -0,0 +1,11 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
+ import { ILogger } from '../../interfaces/ILogger.js';
4
+ export declare class GraphProposeVocabularyTool extends BaseToolController {
5
+ constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
6
+ get name(): string;
7
+ get description(): string;
8
+ get inputSchema(): any;
9
+ protected handleExecute(params: any): Promise<any>;
10
+ }
11
+ //# sourceMappingURL=GraphProposeVocabularyTool.d.ts.map
@@ -0,0 +1,104 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ export class GraphProposeVocabularyTool extends BaseToolController {
4
+ constructor(ucmClient, logger, publishingAuthorId) {
5
+ super(ucmClient, logger, publishingAuthorId);
6
+ }
7
+ get name() { return 'ucm_graph_propose_vocabulary'; }
8
+ get description() {
9
+ return 'Propose new entity types or relationship types for a Memory Graph vocabulary. Behaviour depends on the governance mode: auto-approved in "open" mode, queued for review in "managed" mode, rejected in "locked" mode.';
10
+ }
11
+ get inputSchema() {
12
+ return {
13
+ type: 'object',
14
+ properties: {
15
+ memoryGraphId: {
16
+ type: 'string',
17
+ description: 'The Memory Graph ID'
18
+ },
19
+ entityTypes: {
20
+ type: 'array',
21
+ description: 'New entity types to propose',
22
+ items: {
23
+ type: 'object',
24
+ properties: {
25
+ type: { type: 'string', description: 'Entity type name (PascalCase)' },
26
+ description: { type: 'string', description: 'Description of the entity type' },
27
+ justification: { type: 'string', description: 'Why this entity type is needed' },
28
+ properties: {
29
+ type: 'array',
30
+ items: {
31
+ type: 'object',
32
+ properties: {
33
+ name: { type: 'string', description: 'Property name' },
34
+ type: { type: 'string', description: 'Property type: string, number, boolean, date, enum' },
35
+ required: { type: 'boolean', description: 'Whether the property is required' },
36
+ description: { type: 'string', description: 'Property description' }
37
+ },
38
+ required: ['name', 'type', 'required']
39
+ },
40
+ description: 'Property schemas for the entity type'
41
+ }
42
+ },
43
+ required: ['type', 'description', 'justification']
44
+ }
45
+ },
46
+ relationshipTypes: {
47
+ type: 'array',
48
+ description: 'New relationship types to propose',
49
+ items: {
50
+ type: 'object',
51
+ properties: {
52
+ type: { type: 'string', description: 'Relationship type name (SCREAMING_SNAKE_CASE)' },
53
+ description: { type: 'string', description: 'Description of the relationship type' },
54
+ justification: { type: 'string', description: 'Why this relationship type is needed' },
55
+ allowedSourceTypes: { type: 'array', items: { type: 'string' }, description: 'Allowed source entity types' },
56
+ allowedTargetTypes: { type: 'array', items: { type: 'string' }, description: 'Allowed target entity types' },
57
+ bidirectional: { type: 'boolean', description: 'Whether the relationship is symmetric (default: false)' },
58
+ properties: {
59
+ type: 'array',
60
+ items: {
61
+ type: 'object',
62
+ properties: {
63
+ name: { type: 'string', description: 'Property name' },
64
+ type: { type: 'string', description: 'Property type: string, number, boolean, date, enum' },
65
+ required: { type: 'boolean', description: 'Whether the property is required' },
66
+ description: { type: 'string', description: 'Property description' }
67
+ },
68
+ required: ['name', 'type', 'required']
69
+ },
70
+ description: 'Property schemas for the relationship type'
71
+ }
72
+ },
73
+ required: ['type', 'description', 'justification', 'allowedSourceTypes', 'allowedTargetTypes']
74
+ }
75
+ }
76
+ },
77
+ required: ['memoryGraphId']
78
+ };
79
+ }
80
+ async handleExecute(params) {
81
+ const { memoryGraphId, entityTypes, relationshipTypes } = params;
82
+ if ((!entityTypes || entityTypes.length === 0) && (!relationshipTypes || relationshipTypes.length === 0)) {
83
+ throw new McpError(McpErrorCode.InvalidParams, 'At least one of entityTypes or relationshipTypes must be provided');
84
+ }
85
+ this.logger.info('GraphProposeVocabularyTool', `Proposing vocabulary for graph: ${memoryGraphId}`);
86
+ try {
87
+ const result = await this.ucmClient.graphProposeVocabulary(memoryGraphId, {
88
+ entityTypes,
89
+ relationshipTypes
90
+ });
91
+ return JSON.stringify(result);
92
+ }
93
+ catch (error) {
94
+ if (error.response?.status === 400) {
95
+ throw new McpError(McpErrorCode.InvalidParams, error.response.data?.message || 'Validation error');
96
+ }
97
+ if (error.response?.status === 404) {
98
+ throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
99
+ }
100
+ throw new McpError(McpErrorCode.InternalError, `Failed to propose vocabulary: ${error.message}`);
101
+ }
102
+ }
103
+ }
104
+ //# sourceMappingURL=GraphProposeVocabularyTool.js.map
@@ -0,0 +1,11 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
+ import { ILogger } from '../../interfaces/ILogger.js';
4
+ export declare class GraphRemoveRelationshipsTool extends BaseToolController {
5
+ constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
6
+ get name(): string;
7
+ get description(): string;
8
+ get inputSchema(): any;
9
+ protected handleExecute(params: any): Promise<any>;
10
+ }
11
+ //# sourceMappingURL=GraphRemoveRelationshipsTool.d.ts.map
@@ -0,0 +1,47 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ export class GraphRemoveRelationshipsTool extends BaseToolController {
4
+ constructor(ucmClient, logger, publishingAuthorId) {
5
+ super(ucmClient, logger, publishingAuthorId);
6
+ }
7
+ get name() { return 'ucm_graph_remove_relationships'; }
8
+ get description() {
9
+ return 'Remove one or more relationships from a Memory Graph by their IDs. Pass relationship IDs as an array.';
10
+ }
11
+ get inputSchema() {
12
+ return {
13
+ type: 'object',
14
+ properties: {
15
+ organizationId: {
16
+ type: 'string',
17
+ description: 'The organization ID'
18
+ },
19
+ memoryGraphId: {
20
+ type: 'string',
21
+ description: 'The Memory Graph ID'
22
+ },
23
+ relationshipIds: {
24
+ type: 'array',
25
+ items: { type: 'string' },
26
+ description: 'Array of relationship IDs to remove'
27
+ }
28
+ },
29
+ required: ['organizationId', 'memoryGraphId', 'relationshipIds']
30
+ };
31
+ }
32
+ async handleExecute(params) {
33
+ const { organizationId, memoryGraphId, relationshipIds } = params;
34
+ this.logger.info('GraphRemoveRelationshipsTool', `Removing ${relationshipIds.length} relationships from graph: ${memoryGraphId}`);
35
+ try {
36
+ const result = await this.ucmClient.graphRemoveRelationships(organizationId, memoryGraphId, relationshipIds);
37
+ return JSON.stringify(result);
38
+ }
39
+ catch (error) {
40
+ if (error.response?.status === 404) {
41
+ throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
42
+ }
43
+ throw new McpError(McpErrorCode.InternalError, `Failed to remove relationships: ${error.message}`);
44
+ }
45
+ }
46
+ }
47
+ //# sourceMappingURL=GraphRemoveRelationshipsTool.js.map
@@ -0,0 +1,11 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
+ import { ILogger } from '../../interfaces/ILogger.js';
4
+ export declare class GraphSearchTool extends BaseToolController {
5
+ constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
6
+ get name(): string;
7
+ get description(): string;
8
+ get inputSchema(): any;
9
+ protected handleExecute(params: any): Promise<any>;
10
+ }
11
+ //# sourceMappingURL=GraphSearchTool.d.ts.map
@@ -0,0 +1,92 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ export class GraphSearchTool extends BaseToolController {
4
+ constructor(ucmClient, logger, publishingAuthorId) {
5
+ super(ucmClient, logger, publishingAuthorId);
6
+ }
7
+ get name() { return 'ucm_graph_search'; }
8
+ get description() {
9
+ return 'Semantic search across one or more Memory Graphs using vector similarity. Uses embeddings if available. Returns entities ranked by relevance to the query concept. Provide memoryGraphId for single-graph search, graphIds (array) for multi-graph search, or omit both to search all accessible graphs.';
10
+ }
11
+ get inputSchema() {
12
+ return {
13
+ type: 'object',
14
+ properties: {
15
+ memoryGraphId: {
16
+ type: 'string',
17
+ description: 'Single Memory Graph ID to search (use this for single-graph search)'
18
+ },
19
+ graphIds: {
20
+ type: 'array',
21
+ items: { type: 'string' },
22
+ description: 'Multiple Memory Graph IDs to search across (use this for multi-graph search)'
23
+ },
24
+ query: {
25
+ type: 'string',
26
+ description: 'Natural language query to search for (will be embedded and compared against entity embeddings)'
27
+ },
28
+ entityTypes: {
29
+ type: 'array',
30
+ items: { type: 'string' },
31
+ description: 'Filter results by entity types'
32
+ },
33
+ limit: {
34
+ type: 'number',
35
+ description: 'Maximum results (default: 10, max: 50)'
36
+ },
37
+ similarityThreshold: {
38
+ type: 'number',
39
+ description: 'Minimum similarity score threshold (0-1, default: 0.7)'
40
+ }
41
+ },
42
+ required: ['query']
43
+ };
44
+ }
45
+ async handleExecute(params) {
46
+ const { memoryGraphId, graphIds, query, entityTypes, limit, similarityThreshold } = params;
47
+ // Use single-graph search only when memoryGraphId is provided and graphIds is not
48
+ if (memoryGraphId && !graphIds) {
49
+ this.logger.info('GraphSearchTool', `Searching single graph: ${memoryGraphId}`);
50
+ try {
51
+ const result = await this.ucmClient.graphSearch(memoryGraphId, query, {
52
+ entityTypes,
53
+ limit,
54
+ similarityThreshold
55
+ });
56
+ return JSON.stringify(result);
57
+ }
58
+ catch (error) {
59
+ if (error.response?.status === 422) {
60
+ const detail = error.response?.data?.message || 'Embeddings are not configured for this Memory Graph';
61
+ throw new McpError(McpErrorCode.InvalidRequest, detail);
62
+ }
63
+ if (error.response?.status === 404) {
64
+ throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
65
+ }
66
+ throw new McpError(McpErrorCode.InternalError, `Failed to search graph: ${error.message}`);
67
+ }
68
+ }
69
+ // Multi-graph search: graphIds provided, or neither memoryGraphId nor graphIds provided
70
+ this.logger.info('GraphSearchTool', `Searching multiple graphs`);
71
+ try {
72
+ const result = await this.ucmClient.graphSearchMultiple(query, {
73
+ graphIds,
74
+ entityTypes,
75
+ limit,
76
+ similarityThreshold
77
+ });
78
+ return JSON.stringify(result);
79
+ }
80
+ catch (error) {
81
+ if (error.response?.status === 422) {
82
+ const detail = error.response?.data?.message || 'Embeddings are not configured for one or more Memory Graphs';
83
+ throw new McpError(McpErrorCode.InvalidRequest, detail);
84
+ }
85
+ if (error.response?.status === 404) {
86
+ throw new McpError(McpErrorCode.InvalidParams, `One or more Memory Graphs not found`);
87
+ }
88
+ throw new McpError(McpErrorCode.InternalError, `Failed to search graphs: ${error.message}`);
89
+ }
90
+ }
91
+ }
92
+ //# sourceMappingURL=GraphSearchTool.js.map
@@ -0,0 +1,11 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
+ import { ILogger } from '../../interfaces/ILogger.js';
4
+ export declare class GraphTraverseTool extends BaseToolController {
5
+ constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
6
+ get name(): string;
7
+ get description(): string;
8
+ get inputSchema(): any;
9
+ protected handleExecute(params: any): Promise<any>;
10
+ }
11
+ //# sourceMappingURL=GraphTraverseTool.d.ts.map
@@ -0,0 +1,112 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ export class GraphTraverseTool extends BaseToolController {
4
+ constructor(ucmClient, logger, publishingAuthorId) {
5
+ super(ucmClient, logger, publishingAuthorId);
6
+ }
7
+ get name() { return 'ucm_graph_traverse'; }
8
+ get description() {
9
+ return 'Execute a structured graph traversal using a JSON spec. Supports start point selection, ordered hop steps with relationship/entity type filters, property filters, repeat loops, and multiple return modes (terminal, all, paths). The most powerful query tool for complex graph navigation.';
10
+ }
11
+ get inputSchema() {
12
+ return {
13
+ type: 'object',
14
+ properties: {
15
+ memoryGraphId: {
16
+ type: 'string',
17
+ description: 'The Memory Graph ID'
18
+ },
19
+ start: {
20
+ type: 'object',
21
+ description: 'Start point specification',
22
+ properties: {
23
+ entityId: { type: 'string', description: 'Start from a specific entity ID or slug' },
24
+ entityType: { type: 'string', description: 'Start from all entities of this type' },
25
+ filter: {
26
+ type: 'array',
27
+ items: {
28
+ type: 'object',
29
+ properties: {
30
+ key: { type: 'string' },
31
+ operator: { type: 'string', description: 'eq, neq, gt, gte, lt, lte, contains, isNull, isNotNull' },
32
+ value: {}
33
+ },
34
+ required: ['key', 'operator']
35
+ },
36
+ description: 'Property filters on start entities'
37
+ }
38
+ }
39
+ },
40
+ steps: {
41
+ type: 'array',
42
+ description: 'Ordered traversal steps (hops)',
43
+ items: {
44
+ type: 'object',
45
+ properties: {
46
+ direction: { type: 'string', enum: ['out', 'in', 'both'], description: 'Hop direction' },
47
+ relationshipTypes: { type: 'array', items: { type: 'string' }, description: 'Filter by relationship types' },
48
+ entityTypes: { type: 'array', items: { type: 'string' }, description: 'Filter by entity types at this step' },
49
+ entityFilter: {
50
+ type: 'array',
51
+ items: {
52
+ type: 'object',
53
+ properties: {
54
+ key: { type: 'string' },
55
+ operator: { type: 'string' },
56
+ value: {}
57
+ },
58
+ required: ['key', 'operator']
59
+ },
60
+ description: 'Property filters on entities at this step'
61
+ },
62
+ repeat: {
63
+ type: 'object',
64
+ properties: {
65
+ maxDepth: { type: 'number', description: 'Maximum repeat depth' },
66
+ emitIntermediates: { type: 'boolean', description: 'Include intermediate results' }
67
+ },
68
+ description: 'Repeat this step up to maxDepth times'
69
+ }
70
+ }
71
+ }
72
+ },
73
+ returnMode: {
74
+ type: 'string',
75
+ enum: ['terminal', 'all', 'path'],
76
+ description: 'What to return: terminal (only final step entities), all (every visited entity), path (full traversal paths with relationships). Default: terminal'
77
+ },
78
+ limit: {
79
+ type: 'number',
80
+ description: 'Maximum results (default: 50, max: 200)'
81
+ },
82
+ detailLevel: {
83
+ type: 'string',
84
+ enum: ['brief', 'summary', 'full'],
85
+ description: 'Detail level for returned entities (default: summary)'
86
+ }
87
+ },
88
+ required: ['memoryGraphId', 'start', 'steps']
89
+ };
90
+ }
91
+ async handleExecute(params) {
92
+ const { memoryGraphId, start, steps, returnMode, limit, detailLevel } = params;
93
+ this.logger.info('GraphTraverseTool', `Traversing graph: ${memoryGraphId}`);
94
+ try {
95
+ const result = await this.ucmClient.graphTraverse(memoryGraphId, {
96
+ start,
97
+ steps,
98
+ returnMode,
99
+ limit,
100
+ detailLevel
101
+ });
102
+ return JSON.stringify(result);
103
+ }
104
+ catch (error) {
105
+ if (error.response?.status === 404) {
106
+ throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
107
+ }
108
+ throw new McpError(McpErrorCode.InternalError, `Failed to traverse graph: ${error.message}`);
109
+ }
110
+ }
111
+ }
112
+ //# sourceMappingURL=GraphTraverseTool.js.map
@@ -0,0 +1,11 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
+ import { ILogger } from '../../interfaces/ILogger.js';
4
+ export declare class GraphUpdateEntitiesTool extends BaseToolController {
5
+ constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
6
+ get name(): string;
7
+ get description(): string;
8
+ get inputSchema(): any;
9
+ protected handleExecute(params: any): Promise<any>;
10
+ }
11
+ //# sourceMappingURL=GraphUpdateEntitiesTool.d.ts.map