@utaba/ucm-mcp-server 6.5.0 → 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 (198) hide show
  1. package/dist/clients/UcmLocalApiClient.d.ts +175 -2
  2. package/dist/clients/UcmLocalApiClient.js +203 -3
  3. package/dist/index.js +1 -1
  4. package/dist/mcp-server/clients/UcmLocalApiClient.d.ts +399 -0
  5. package/dist/mcp-server/clients/UcmLocalApiClient.js +719 -0
  6. package/dist/mcp-server/index.d.ts +3 -0
  7. package/dist/mcp-server/index.js +68 -0
  8. package/dist/mcp-server/interfaces/ILogger.d.ts +8 -0
  9. package/dist/mcp-server/interfaces/ILogger.js +4 -0
  10. package/dist/mcp-server/interfaces/IMcpTool.d.ts +7 -0
  11. package/dist/mcp-server/interfaces/IMcpTool.js +3 -0
  12. package/dist/mcp-server/logging/ConsoleLogger.d.ts +16 -0
  13. package/dist/mcp-server/logging/ConsoleLogger.js +45 -0
  14. package/dist/mcp-server/logging/LoggerFactory.d.ts +9 -0
  15. package/dist/mcp-server/logging/LoggerFactory.js +12 -0
  16. package/dist/mcp-server/server/McpConfig.d.ts +26 -0
  17. package/dist/mcp-server/server/McpConfig.js +90 -0
  18. package/dist/mcp-server/server/McpHandler.d.ts +12 -0
  19. package/dist/mcp-server/server/McpHandler.js +84 -0
  20. package/dist/mcp-server/server/McpServer.d.ts +15 -0
  21. package/dist/mcp-server/server/McpServer.js +49 -0
  22. package/dist/mcp-server/server/ToolRegistry.d.ts +23 -0
  23. package/dist/mcp-server/server/ToolRegistry.js +169 -0
  24. package/dist/mcp-server/tools/authorization/ListAuthorizationsTool.d.ts +21 -0
  25. package/dist/mcp-server/tools/authorization/ListAuthorizationsTool.js +146 -0
  26. package/dist/mcp-server/tools/authorization/SignOutTool.d.ts +23 -0
  27. package/dist/mcp-server/tools/authorization/SignOutTool.js +128 -0
  28. package/dist/mcp-server/tools/base/BaseToolController.d.ts +19 -0
  29. package/dist/mcp-server/tools/base/BaseToolController.js +58 -0
  30. package/dist/mcp-server/tools/connections/AccessConnectionTool.d.ts +21 -0
  31. package/dist/mcp-server/tools/connections/AccessConnectionTool.js +107 -0
  32. package/dist/mcp-server/tools/connections/CallRemoteToolTool.d.ts +22 -0
  33. package/dist/mcp-server/tools/connections/CallRemoteToolTool.js +124 -0
  34. package/dist/mcp-server/tools/core/DeleteArtifactTool.d.ts +11 -0
  35. package/dist/mcp-server/tools/core/DeleteArtifactTool.js +83 -0
  36. package/dist/mcp-server/tools/core/EditArtifactMetadataTool.d.ts +12 -0
  37. package/dist/mcp-server/tools/core/EditArtifactMetadataTool.js +173 -0
  38. package/dist/mcp-server/tools/core/GetArtifactTool.d.ts +13 -0
  39. package/dist/mcp-server/tools/core/GetArtifactTool.js +124 -0
  40. package/dist/mcp-server/tools/core/GetArtifactVersionsTool.d.ts +11 -0
  41. package/dist/mcp-server/tools/core/GetArtifactVersionsTool.js +63 -0
  42. package/dist/mcp-server/tools/core/GetChunkTool.d.ts +11 -0
  43. package/dist/mcp-server/tools/core/GetChunkTool.js +56 -0
  44. package/dist/mcp-server/tools/core/ListArtifactsTool.d.ts +11 -0
  45. package/dist/mcp-server/tools/core/ListArtifactsTool.js +84 -0
  46. package/dist/mcp-server/tools/core/MoveArtifactTool.d.ts +12 -0
  47. package/dist/mcp-server/tools/core/MoveArtifactTool.js +104 -0
  48. package/dist/mcp-server/tools/core/PublishArtifactFromFileTool.d.ts +15 -0
  49. package/dist/mcp-server/tools/core/PublishArtifactFromFileTool.js +277 -0
  50. package/dist/mcp-server/tools/core/PublishArtifactTool.d.ts +13 -0
  51. package/dist/mcp-server/tools/core/PublishArtifactTool.js +218 -0
  52. package/dist/mcp-server/tools/core/SearchArtifactsTool.d.ts +11 -0
  53. package/dist/mcp-server/tools/core/SearchArtifactsTool.js +137 -0
  54. package/dist/mcp-server/tools/list/ListNamespaceController.d.ts +1 -0
  55. package/dist/mcp-server/tools/list/ListNamespaceController.js +8 -0
  56. package/dist/mcp-server/tools/memory-graph/GraphCreateEntitiesTool.d.ts +14 -0
  57. package/dist/mcp-server/tools/memory-graph/GraphCreateEntitiesTool.js +58 -0
  58. package/dist/mcp-server/tools/memory-graph/GraphCreateRelationshipsTool.d.ts +14 -0
  59. package/dist/mcp-server/tools/memory-graph/GraphCreateRelationshipsTool.js +57 -0
  60. package/dist/mcp-server/tools/memory-graph/GraphCreateTool.d.ts +14 -0
  61. package/dist/mcp-server/tools/memory-graph/GraphCreateTool.js +64 -0
  62. package/dist/mcp-server/tools/memory-graph/GraphDeleteEntitiesTool.d.ts +14 -0
  63. package/dist/mcp-server/tools/memory-graph/GraphDeleteEntitiesTool.js +45 -0
  64. package/dist/mcp-server/tools/memory-graph/GraphDeleteRelationshipsTool.d.ts +14 -0
  65. package/dist/mcp-server/tools/memory-graph/GraphDeleteRelationshipsTool.js +45 -0
  66. package/dist/mcp-server/tools/memory-graph/GraphExploreTool.d.ts +14 -0
  67. package/dist/mcp-server/tools/memory-graph/GraphExploreTool.js +73 -0
  68. package/dist/mcp-server/tools/memory-graph/GraphFindEntitiesTool.d.ts +14 -0
  69. package/dist/mcp-server/tools/memory-graph/GraphFindEntitiesTool.js +68 -0
  70. package/dist/mcp-server/tools/memory-graph/GraphFindPathsTool.d.ts +14 -0
  71. package/dist/mcp-server/tools/memory-graph/GraphFindPathsTool.js +62 -0
  72. package/dist/mcp-server/tools/memory-graph/GraphGetEntityTool.d.ts +14 -0
  73. package/dist/mcp-server/tools/memory-graph/GraphGetEntityTool.js +49 -0
  74. package/dist/mcp-server/tools/memory-graph/GraphGetRelationshipsTool.d.ts +14 -0
  75. package/dist/mcp-server/tools/memory-graph/GraphGetRelationshipsTool.js +62 -0
  76. package/dist/mcp-server/tools/memory-graph/GraphListTemplatesTool.d.ts +14 -0
  77. package/dist/mcp-server/tools/memory-graph/GraphListTemplatesTool.js +34 -0
  78. package/dist/mcp-server/tools/memory-graph/GraphListTool.d.ts +14 -0
  79. package/dist/mcp-server/tools/memory-graph/GraphListTool.js +45 -0
  80. package/dist/mcp-server/tools/memory-graph/GraphOpenTool.d.ts +15 -0
  81. package/dist/mcp-server/tools/memory-graph/GraphOpenTool.js +50 -0
  82. package/dist/mcp-server/tools/memory-graph/GraphProposeVocabularyTool.d.ts +14 -0
  83. package/dist/mcp-server/tools/memory-graph/GraphProposeVocabularyTool.js +108 -0
  84. package/dist/mcp-server/tools/memory-graph/GraphSearchTool.d.ts +14 -0
  85. package/dist/mcp-server/tools/memory-graph/GraphSearchTool.js +94 -0
  86. package/dist/mcp-server/tools/memory-graph/GraphTraverseTool.d.ts +14 -0
  87. package/dist/mcp-server/tools/memory-graph/GraphTraverseTool.js +114 -0
  88. package/dist/mcp-server/tools/memory-graph/GraphUpdateEntitiesTool.d.ts +14 -0
  89. package/dist/mcp-server/tools/memory-graph/GraphUpdateEntitiesTool.js +58 -0
  90. package/dist/mcp-server/tools/memory-graph/KnowledgeSetListTool.d.ts +14 -0
  91. package/dist/mcp-server/tools/memory-graph/KnowledgeSetListTool.js +25 -0
  92. package/dist/mcp-server/tools/memory-graph/KnowledgeSetOpenTool.d.ts +14 -0
  93. package/dist/mcp-server/tools/memory-graph/KnowledgeSetOpenTool.js +31 -0
  94. package/dist/mcp-server/tools/repository/CreateRepositoryTool.d.ts +12 -0
  95. package/dist/mcp-server/tools/repository/CreateRepositoryTool.js +116 -0
  96. package/dist/mcp-server/tools/repository/GetRepositoryTool.d.ts +12 -0
  97. package/dist/mcp-server/tools/repository/GetRepositoryTool.js +85 -0
  98. package/dist/mcp-server/tools/repository/UpdateRepositoryTool.d.ts +12 -0
  99. package/dist/mcp-server/tools/repository/UpdateRepositoryTool.js +115 -0
  100. package/dist/mcp-server/tools/sharepoint/SharePointListConnectionsTool.d.ts +19 -0
  101. package/dist/mcp-server/tools/sharepoint/SharePointListConnectionsTool.js +90 -0
  102. package/dist/mcp-server/tools/sharepoint/SharePointListFoldersTool.d.ts +21 -0
  103. package/dist/mcp-server/tools/sharepoint/SharePointListFoldersTool.js +133 -0
  104. package/dist/mcp-server/tools/sharepoint/SharePointReadFileTool.d.ts +22 -0
  105. package/dist/mcp-server/tools/sharepoint/SharePointReadFileTool.js +146 -0
  106. package/dist/mcp-server/tools/sharepoint/SharePointReadRelatedFileTool.d.ts +18 -0
  107. package/dist/mcp-server/tools/sharepoint/SharePointReadRelatedFileTool.js +108 -0
  108. package/dist/mcp-server/tools/sharepoint/SharePointSearchTool.d.ts +22 -0
  109. package/dist/mcp-server/tools/sharepoint/SharePointSearchTool.js +125 -0
  110. package/dist/mcp-server/tools/utility/AuthorIndexTool.d.ts +11 -0
  111. package/dist/mcp-server/tools/utility/AuthorIndexTool.js +49 -0
  112. package/dist/mcp-server/tools/utility/AuthorRecentsTool.d.ts +11 -0
  113. package/dist/mcp-server/tools/utility/AuthorRecentsTool.js +49 -0
  114. package/dist/mcp-server/tools/utility/ListRepositoriesTool.d.ts +11 -0
  115. package/dist/mcp-server/tools/utility/ListRepositoriesTool.js +68 -0
  116. package/dist/mcp-server/tools/utility/QuickstartTool.d.ts +11 -0
  117. package/dist/mcp-server/tools/utility/QuickstartTool.js +36 -0
  118. package/dist/mcp-server/types/UcmApiTypes.d.ts +40 -0
  119. package/dist/mcp-server/types/UcmApiTypes.js +4 -0
  120. package/dist/mcp-server/utils/McpErrorHandler.d.ts +25 -0
  121. package/dist/mcp-server/utils/McpErrorHandler.js +67 -0
  122. package/dist/mcp-server/utils/PathUtils.d.ts +61 -0
  123. package/dist/mcp-server/utils/PathUtils.js +178 -0
  124. package/dist/mcp-server/utils/ResponseChunker.d.ts +25 -0
  125. package/dist/mcp-server/utils/ResponseChunker.js +79 -0
  126. package/dist/mcp-server/utils/SharePointErrorHandler.d.ts +34 -0
  127. package/dist/mcp-server/utils/SharePointErrorHandler.js +55 -0
  128. package/dist/schemas/memory-graph-tool-schemas.d.ts +789 -0
  129. package/dist/schemas/memory-graph-tool-schemas.js +181 -0
  130. package/dist/server/ToolRegistry.js +42 -8
  131. package/dist/tools/authorization/ListAuthorizationsTool.js +2 -2
  132. package/dist/tools/authorization/SignOutTool.js +2 -2
  133. package/dist/tools/connections/AccessConnectionTool.js +8 -6
  134. package/dist/tools/connections/CallRemoteToolTool.js +4 -4
  135. package/dist/tools/core/DeleteArtifactTool.js +5 -4
  136. package/dist/tools/core/EditArtifactMetadataTool.js +1 -1
  137. package/dist/tools/core/GetArtifactTool.js +1 -1
  138. package/dist/tools/core/GetArtifactVersionsTool.js +1 -1
  139. package/dist/tools/core/GetChunkTool.js +1 -1
  140. package/dist/tools/core/ListArtifactsTool.js +1 -1
  141. package/dist/tools/core/MoveArtifactTool.js +1 -1
  142. package/dist/tools/core/PublishArtifactFromFileTool.js +1 -1
  143. package/dist/tools/core/PublishArtifactTool.js +2 -2
  144. package/dist/tools/core/SearchArtifactsTool.js +7 -6
  145. package/dist/tools/memory-graph/GraphCreateEntitiesTool.d.ts +11 -0
  146. package/dist/tools/memory-graph/GraphCreateEntitiesTool.js +56 -0
  147. package/dist/tools/memory-graph/GraphCreateRelationshipsTool.d.ts +11 -0
  148. package/dist/tools/memory-graph/GraphCreateRelationshipsTool.js +55 -0
  149. package/dist/tools/memory-graph/GraphCreateTool.d.ts +11 -0
  150. package/dist/tools/memory-graph/GraphCreateTool.js +62 -0
  151. package/dist/tools/memory-graph/GraphDeleteEntitiesTool.d.ts +11 -0
  152. package/dist/tools/memory-graph/GraphDeleteEntitiesTool.js +43 -0
  153. package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.d.ts +11 -0
  154. package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.js +43 -0
  155. package/dist/tools/memory-graph/GraphExploreTool.d.ts +11 -0
  156. package/dist/tools/memory-graph/GraphExploreTool.js +71 -0
  157. package/dist/tools/memory-graph/GraphFindEntitiesTool.d.ts +11 -0
  158. package/dist/tools/memory-graph/GraphFindEntitiesTool.js +66 -0
  159. package/dist/tools/memory-graph/GraphFindPathsTool.d.ts +11 -0
  160. package/dist/tools/memory-graph/GraphFindPathsTool.js +60 -0
  161. package/dist/tools/memory-graph/GraphGetEntityTool.d.ts +11 -0
  162. package/dist/tools/memory-graph/GraphGetEntityTool.js +47 -0
  163. package/dist/tools/memory-graph/GraphGetRelationshipsTool.d.ts +11 -0
  164. package/dist/tools/memory-graph/GraphGetRelationshipsTool.js +60 -0
  165. package/dist/tools/memory-graph/GraphGetStatsTool.d.ts +11 -0
  166. package/dist/tools/memory-graph/GraphGetStatsTool.js +42 -0
  167. package/dist/tools/memory-graph/GraphListTemplatesTool.d.ts +11 -0
  168. package/dist/tools/memory-graph/GraphListTemplatesTool.js +32 -0
  169. package/dist/tools/memory-graph/GraphListTool.d.ts +11 -0
  170. package/dist/tools/memory-graph/GraphListTool.js +43 -0
  171. package/dist/tools/memory-graph/GraphOpenTool.d.ts +12 -0
  172. package/dist/tools/memory-graph/GraphOpenTool.js +48 -0
  173. package/dist/tools/memory-graph/GraphProposeVocabularyTool.d.ts +11 -0
  174. package/dist/tools/memory-graph/GraphProposeVocabularyTool.js +104 -0
  175. package/dist/tools/memory-graph/GraphRemoveRelationshipsTool.d.ts +11 -0
  176. package/dist/tools/memory-graph/GraphRemoveRelationshipsTool.js +47 -0
  177. package/dist/tools/memory-graph/GraphSearchTool.d.ts +11 -0
  178. package/dist/tools/memory-graph/GraphSearchTool.js +92 -0
  179. package/dist/tools/memory-graph/GraphTraverseTool.d.ts +11 -0
  180. package/dist/tools/memory-graph/GraphTraverseTool.js +112 -0
  181. package/dist/tools/memory-graph/GraphUpdateEntitiesTool.d.ts +11 -0
  182. package/dist/tools/memory-graph/GraphUpdateEntitiesTool.js +56 -0
  183. package/dist/tools/memory-graph/KnowledgeSetListTool.d.ts +11 -0
  184. package/dist/tools/memory-graph/KnowledgeSetListTool.js +23 -0
  185. package/dist/tools/memory-graph/KnowledgeSetOpenTool.d.ts +11 -0
  186. package/dist/tools/memory-graph/KnowledgeSetOpenTool.js +29 -0
  187. package/dist/tools/repository/CreateRepositoryTool.js +10 -9
  188. package/dist/tools/repository/GetRepositoryTool.js +15 -15
  189. package/dist/tools/repository/UpdateRepositoryTool.js +10 -9
  190. package/dist/tools/sharepoint/SharePointListConnectionsTool.js +1 -1
  191. package/dist/tools/sharepoint/SharePointListFoldersTool.js +1 -1
  192. package/dist/tools/utility/AuthorIndexTool.js +6 -5
  193. package/dist/tools/utility/AuthorRecentsTool.js +6 -5
  194. package/dist/tools/utility/HealthCheckController.js +1 -1
  195. package/dist/tools/utility/ListRepositoriesTool.js +5 -4
  196. package/dist/utils/McpErrorHandler.js +1 -1
  197. package/package.json +1 -1
  198. package/package.json.backup +1 -1
@@ -0,0 +1,49 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ import { GraphGetEntitySchema } from '@/schemas/memory-graph-tool-schemas.js';
4
+ export class GraphGetEntityTool extends BaseToolController {
5
+ constructor(ucmClient, logger, publishingAuthorId) {
6
+ super(ucmClient, logger, publishingAuthorId);
7
+ }
8
+ get name() { return 'ucm_graph_get_entity'; }
9
+ get description() {
10
+ return 'Get full details of an entity including all properties, data, and provenance. Use the entityId from find_entities or explore results.';
11
+ }
12
+ get schema() { return GraphGetEntitySchema; }
13
+ get inputSchema() {
14
+ return {
15
+ type: 'object',
16
+ properties: {
17
+ memoryGraphId: {
18
+ type: 'string',
19
+ description: 'The Memory Graph ID'
20
+ },
21
+ entityId: {
22
+ type: 'string',
23
+ description: 'The entity ID or slug to retrieve'
24
+ },
25
+ detailLevel: {
26
+ type: 'string',
27
+ enum: ['brief', 'summary', 'full'],
28
+ description: 'Detail level (default: full)'
29
+ }
30
+ },
31
+ required: ['memoryGraphId', 'entityId']
32
+ };
33
+ }
34
+ async handleExecute(params) {
35
+ const { memoryGraphId, entityId, detailLevel } = params;
36
+ this.logger.info('GraphGetEntityTool', `Getting entity ${entityId} from graph: ${memoryGraphId}`);
37
+ try {
38
+ const result = await this.ucmClient.graphGetEntity(memoryGraphId, entityId, detailLevel);
39
+ return JSON.stringify(result);
40
+ }
41
+ catch (error) {
42
+ if (error.response?.status === 404) {
43
+ throw new McpError(McpErrorCode.InvalidParams, `Entity or Memory Graph not found`);
44
+ }
45
+ throw new McpError(McpErrorCode.InternalError, `Failed to get entity: ${error.message}`);
46
+ }
47
+ }
48
+ }
49
+ //# sourceMappingURL=GraphGetEntityTool.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 GraphGetRelationshipsParams } from '@/schemas/memory-graph-tool-schemas.js';
5
+ import { ZodSchema } from 'zod';
6
+ export declare class GraphGetRelationshipsTool 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: GraphGetRelationshipsParams): Promise<string>;
13
+ }
14
+ //# sourceMappingURL=GraphGetRelationshipsTool.d.ts.map
@@ -0,0 +1,62 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ import { GraphGetRelationshipsSchema } from '@/schemas/memory-graph-tool-schemas.js';
4
+ export class GraphGetRelationshipsTool extends BaseToolController {
5
+ constructor(ucmClient, logger, publishingAuthorId) {
6
+ super(ucmClient, logger, publishingAuthorId);
7
+ }
8
+ get name() { return 'ucm_graph_get_relationships'; }
9
+ get description() {
10
+ return 'Get relationships for an entity with optional type filtering and direction control (outbound, inbound, or both).';
11
+ }
12
+ get schema() { return GraphGetRelationshipsSchema; }
13
+ get inputSchema() {
14
+ return {
15
+ type: 'object',
16
+ properties: {
17
+ memoryGraphId: {
18
+ type: 'string',
19
+ description: 'The Memory Graph ID'
20
+ },
21
+ entityId: {
22
+ type: 'string',
23
+ description: 'The entity ID to get relationships for'
24
+ },
25
+ relationshipTypes: {
26
+ type: 'array',
27
+ items: { type: 'string' },
28
+ description: 'Filter by relationship types (from vocabulary)'
29
+ },
30
+ direction: {
31
+ type: 'string',
32
+ enum: ['outbound', 'inbound', 'both'],
33
+ description: 'Relationship direction (default: both)'
34
+ },
35
+ limit: {
36
+ type: 'number',
37
+ description: 'Maximum results (default: 50)'
38
+ }
39
+ },
40
+ required: ['memoryGraphId', 'entityId']
41
+ };
42
+ }
43
+ async handleExecute(params) {
44
+ const { memoryGraphId, entityId, relationshipTypes, direction, limit } = params;
45
+ this.logger.info('GraphGetRelationshipsTool', `Getting relationships for entity ${entityId}`);
46
+ try {
47
+ const result = await this.ucmClient.graphGetRelationships(memoryGraphId, entityId, {
48
+ direction,
49
+ relationshipTypes,
50
+ limit
51
+ });
52
+ return JSON.stringify(result);
53
+ }
54
+ catch (error) {
55
+ if (error.response?.status === 404) {
56
+ throw new McpError(McpErrorCode.InvalidParams, `Entity or Memory Graph not found`);
57
+ }
58
+ throw new McpError(McpErrorCode.InternalError, `Failed to get relationships: ${error.message}`);
59
+ }
60
+ }
61
+ }
62
+ //# sourceMappingURL=GraphGetRelationshipsTool.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 GraphListTemplatesParams } from '@/schemas/memory-graph-tool-schemas.js';
5
+ import { ZodSchema } from 'zod';
6
+ export declare class GraphListTemplatesTool 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: GraphListTemplatesParams): Promise<string>;
13
+ }
14
+ //# sourceMappingURL=GraphListTemplatesTool.d.ts.map
@@ -0,0 +1,34 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ import { GraphListTemplatesSchema } from '@/schemas/memory-graph-tool-schemas.js';
4
+ export class GraphListTemplatesTool extends BaseToolController {
5
+ constructor(ucmClient, logger, publishingAuthorId) {
6
+ super(ucmClient, logger, publishingAuthorId);
7
+ }
8
+ get name() { return 'ucm_graph_list_templates'; }
9
+ get description() {
10
+ 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.';
11
+ }
12
+ get schema() { return GraphListTemplatesSchema; }
13
+ get inputSchema() {
14
+ return {
15
+ type: 'object',
16
+ properties: {},
17
+ required: []
18
+ };
19
+ }
20
+ async handleExecute(_params) {
21
+ this.logger.info('GraphListTemplatesTool', 'Listing vocabulary templates');
22
+ try {
23
+ const result = await this.ucmClient.listMemoryGraphTemplates();
24
+ return JSON.stringify(result);
25
+ }
26
+ catch (error) {
27
+ if (error.response?.status === 503) {
28
+ throw new McpError(McpErrorCode.InternalError, `Deep Memory service is not configured`);
29
+ }
30
+ throw new McpError(McpErrorCode.InternalError, `Failed to list templates: ${error.message}`);
31
+ }
32
+ }
33
+ }
34
+ //# sourceMappingURL=GraphListTemplatesTool.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 GraphListParams } from '@/schemas/memory-graph-tool-schemas.js';
5
+ import { ZodSchema } from 'zod';
6
+ export declare class GraphListTool 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: GraphListParams): Promise<string>;
13
+ }
14
+ //# sourceMappingURL=GraphListTool.d.ts.map
@@ -0,0 +1,45 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { GraphListSchema } from '@/schemas/memory-graph-tool-schemas.js';
3
+ export class GraphListTool extends BaseToolController {
4
+ constructor(ucmClient, logger, publishingAuthorId) {
5
+ super(ucmClient, logger, publishingAuthorId);
6
+ }
7
+ get name() { return 'ucm_graph_list'; }
8
+ get description() {
9
+ 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).';
10
+ }
11
+ get schema() { return GraphListSchema; }
12
+ get inputSchema() {
13
+ return {
14
+ type: 'object',
15
+ properties: {
16
+ scope: {
17
+ type: 'string',
18
+ enum: ['organization', 'personal', 'all'],
19
+ description: 'Filter graphs by ownership scope. "organization" returns only org graphs, "personal" returns only your personal graphs, "all" (default) returns both.'
20
+ }
21
+ },
22
+ required: []
23
+ };
24
+ }
25
+ async handleExecute(params) {
26
+ const { scope } = params;
27
+ this.logger.info('GraphListTool', `Listing memory graphs (scope: ${scope ?? 'all'})`);
28
+ const result = await this.ucmClient.listMemoryGraphs(scope ?? 'all');
29
+ // Annotate each graph with a scope field based on which owner field is set
30
+ if (result && Array.isArray(result.data)) {
31
+ result.data = result.data.map((graph) => ({
32
+ ...graph,
33
+ scope: graph.userId ? 'personal' : 'organization'
34
+ }));
35
+ }
36
+ else if (Array.isArray(result)) {
37
+ return JSON.stringify(result.map((graph) => ({
38
+ ...graph,
39
+ scope: graph.userId ? 'personal' : 'organization'
40
+ })));
41
+ }
42
+ return JSON.stringify(result);
43
+ }
44
+ }
45
+ //# sourceMappingURL=GraphListTool.js.map
@@ -0,0 +1,15 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
3
+ import { ILogger } from '../../interfaces/ILogger.js';
4
+ import { type GraphOpenParams } from '@/schemas/memory-graph-tool-schemas.js';
5
+ import { ZodSchema } from 'zod';
6
+ export declare class GraphOpenTool 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: GraphOpenParams): Promise<string>;
13
+ private handleApiError;
14
+ }
15
+ //# sourceMappingURL=GraphOpenTool.d.ts.map
@@ -0,0 +1,50 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ import { GraphOpenSchema } from '@/schemas/memory-graph-tool-schemas.js';
4
+ export class GraphOpenTool extends BaseToolController {
5
+ constructor(ucmClient, logger, publishingAuthorId) {
6
+ super(ucmClient, logger, publishingAuthorId);
7
+ }
8
+ get name() { return 'ucm_graph_open'; }
9
+ get description() {
10
+ 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.';
11
+ }
12
+ get schema() { return GraphOpenSchema; }
13
+ get inputSchema() {
14
+ return {
15
+ type: 'object',
16
+ properties: {
17
+ memoryGraphId: {
18
+ type: 'string',
19
+ description: 'The Memory Graph ID to open'
20
+ }
21
+ },
22
+ required: ['memoryGraphId']
23
+ };
24
+ }
25
+ async handleExecute(params) {
26
+ const { memoryGraphId } = params;
27
+ this.logger.info('GraphOpenTool', `Opening graph: ${memoryGraphId}`);
28
+ try {
29
+ const result = await this.ucmClient.graphOpen(memoryGraphId);
30
+ // scope is now returned directly by the OpenGraphCommand — no annotation needed
31
+ return JSON.stringify(result);
32
+ }
33
+ catch (error) {
34
+ this.handleApiError(error, 'open memory graph');
35
+ }
36
+ }
37
+ handleApiError(error, action) {
38
+ if (error.response?.status === 403) {
39
+ throw new McpError(McpErrorCode.InvalidParams, `Access denied: you do not have permission to open this Memory Graph`);
40
+ }
41
+ if (error.response?.status === 404) {
42
+ throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
43
+ }
44
+ if (error.response?.status === 503) {
45
+ throw new McpError(McpErrorCode.InternalError, `Deep Memory service is not configured`);
46
+ }
47
+ throw new McpError(McpErrorCode.InternalError, `Failed to ${action}: ${error.message}`);
48
+ }
49
+ }
50
+ //# sourceMappingURL=GraphOpenTool.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 GraphProposeVocabularyParams } from '@/schemas/memory-graph-tool-schemas.js';
5
+ import { ZodSchema } from 'zod';
6
+ export declare class GraphProposeVocabularyTool 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: GraphProposeVocabularyParams): Promise<string>;
13
+ }
14
+ //# sourceMappingURL=GraphProposeVocabularyTool.d.ts.map
@@ -0,0 +1,108 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ import { GraphProposeVocabularySchema } from '@/schemas/memory-graph-tool-schemas.js';
4
+ export class GraphProposeVocabularyTool extends BaseToolController {
5
+ constructor(ucmClient, logger, publishingAuthorId) {
6
+ super(ucmClient, logger, publishingAuthorId);
7
+ }
8
+ get name() { return 'ucm_graph_propose_vocabulary'; }
9
+ get description() {
10
+ 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.';
11
+ }
12
+ get schema() { return GraphProposeVocabularySchema; }
13
+ get inputSchema() {
14
+ return {
15
+ type: 'object',
16
+ properties: {
17
+ memoryGraphId: {
18
+ type: 'string',
19
+ description: 'The Memory Graph ID'
20
+ },
21
+ entityTypes: {
22
+ type: 'array',
23
+ description: 'New entity types to propose',
24
+ items: {
25
+ type: 'object',
26
+ properties: {
27
+ type: { type: 'string', description: 'Entity type name (PascalCase)' },
28
+ description: { type: 'string', description: 'Description of the entity type' },
29
+ justification: { type: 'string', description: 'Why this entity type is needed' },
30
+ properties: {
31
+ type: 'array',
32
+ items: {
33
+ type: 'object',
34
+ properties: {
35
+ name: { type: 'string', description: 'Property name' },
36
+ type: { type: 'string', description: 'Property type: string, number, boolean, date, enum' },
37
+ required: { type: 'boolean', description: 'Whether the property is required' },
38
+ description: { type: 'string', description: 'Property description' }
39
+ },
40
+ required: ['name', 'type', 'required']
41
+ },
42
+ description: 'Property schemas for the entity type'
43
+ }
44
+ },
45
+ required: ['type', 'description', 'justification']
46
+ }
47
+ },
48
+ relationshipTypes: {
49
+ type: 'array',
50
+ description: 'New relationship types to propose',
51
+ items: {
52
+ type: 'object',
53
+ properties: {
54
+ type: { type: 'string', description: 'Relationship type name (SCREAMING_SNAKE_CASE)' },
55
+ description: { type: 'string', description: 'Description of the relationship type' },
56
+ justification: { type: 'string', description: 'Why this relationship type is needed' },
57
+ allowedSourceTypes: { type: 'array', items: { type: 'string' }, description: 'Allowed source entity types' },
58
+ allowedTargetTypes: { type: 'array', items: { type: 'string' }, description: 'Allowed target entity types' },
59
+ bidirectional: { type: 'boolean', description: 'Whether the relationship is symmetric (default: false)' },
60
+ properties: {
61
+ type: 'array',
62
+ items: {
63
+ type: 'object',
64
+ properties: {
65
+ name: { type: 'string', description: 'Property name' },
66
+ type: { type: 'string', description: 'Property type: string, number, boolean, date, enum' },
67
+ required: { type: 'boolean', description: 'Whether the property is required' },
68
+ description: { type: 'string', description: 'Property description' }
69
+ },
70
+ required: ['name', 'type', 'required']
71
+ },
72
+ description: 'Property schemas for the relationship type'
73
+ }
74
+ },
75
+ required: ['type', 'description', 'justification', 'allowedSourceTypes', 'allowedTargetTypes']
76
+ }
77
+ }
78
+ },
79
+ required: ['memoryGraphId']
80
+ };
81
+ }
82
+ async handleExecute(params) {
83
+ const { memoryGraphId, entityTypes, relationshipTypes } = params;
84
+ if ((!entityTypes || entityTypes.length === 0) && (!relationshipTypes || relationshipTypes.length === 0)) {
85
+ throw new McpError(McpErrorCode.InvalidParams, 'At least one of entityTypes or relationshipTypes must be provided');
86
+ }
87
+ this.logger.info('GraphProposeVocabularyTool', `Proposing vocabulary for graph: ${memoryGraphId}`);
88
+ try {
89
+ const result = await this.ucmClient.graphProposeVocabulary(memoryGraphId, {
90
+ // TYPE-EXCEPTION: Zod infers `required?: boolean` but API client expects `required: boolean`;
91
+ // runtime values are always valid — cast to satisfy the client signature.
92
+ entityTypes: entityTypes,
93
+ relationshipTypes: relationshipTypes,
94
+ });
95
+ return JSON.stringify(result);
96
+ }
97
+ catch (error) {
98
+ if (error.response?.status === 400) {
99
+ throw new McpError(McpErrorCode.InvalidParams, error.response.data?.message || 'Validation error');
100
+ }
101
+ if (error.response?.status === 404) {
102
+ throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
103
+ }
104
+ throw new McpError(McpErrorCode.InternalError, `Failed to propose vocabulary: ${error.message}`);
105
+ }
106
+ }
107
+ }
108
+ //# sourceMappingURL=GraphProposeVocabularyTool.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 GraphSearchParams } from '@/schemas/memory-graph-tool-schemas.js';
5
+ import { ZodSchema } from 'zod';
6
+ export declare class GraphSearchTool 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: GraphSearchParams): Promise<string>;
13
+ }
14
+ //# sourceMappingURL=GraphSearchTool.d.ts.map
@@ -0,0 +1,94 @@
1
+ import { BaseToolController } from '../base/BaseToolController.js';
2
+ import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
3
+ import { GraphSearchSchema } from '@/schemas/memory-graph-tool-schemas.js';
4
+ export class GraphSearchTool extends BaseToolController {
5
+ constructor(ucmClient, logger, publishingAuthorId) {
6
+ super(ucmClient, logger, publishingAuthorId);
7
+ }
8
+ get name() { return 'ucm_graph_search'; }
9
+ get description() {
10
+ 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.';
11
+ }
12
+ get schema() { return GraphSearchSchema; }
13
+ get inputSchema() {
14
+ return {
15
+ type: 'object',
16
+ properties: {
17
+ memoryGraphId: {
18
+ type: 'string',
19
+ description: 'Single Memory Graph ID to search (use this for single-graph search)'
20
+ },
21
+ graphIds: {
22
+ type: 'array',
23
+ items: { type: 'string' },
24
+ description: 'Multiple Memory Graph IDs to search across (use this for multi-graph search)'
25
+ },
26
+ query: {
27
+ type: 'string',
28
+ description: 'Natural language query to search for (will be embedded and compared against entity embeddings)'
29
+ },
30
+ entityTypes: {
31
+ type: 'array',
32
+ items: { type: 'string' },
33
+ description: 'Filter results by entity types'
34
+ },
35
+ limit: {
36
+ type: 'number',
37
+ description: 'Maximum results (default: 10, max: 50)'
38
+ },
39
+ similarityThreshold: {
40
+ type: 'number',
41
+ description: 'Minimum similarity score threshold (0-1, default: 0.7)'
42
+ }
43
+ },
44
+ required: ['query']
45
+ };
46
+ }
47
+ async handleExecute(params) {
48
+ const { memoryGraphId, graphIds, query, entityTypes, limit, similarityThreshold } = params;
49
+ // Use single-graph search only when memoryGraphId is provided and graphIds is not
50
+ if (memoryGraphId && !graphIds) {
51
+ this.logger.info('GraphSearchTool', `Searching single graph: ${memoryGraphId}`);
52
+ try {
53
+ const result = await this.ucmClient.graphSearch(memoryGraphId, query, {
54
+ entityTypes,
55
+ limit,
56
+ similarityThreshold
57
+ });
58
+ return JSON.stringify(result);
59
+ }
60
+ catch (error) {
61
+ if (error.response?.status === 422) {
62
+ const detail = error.response?.data?.message || 'Embeddings are not configured for this Memory Graph';
63
+ throw new McpError(McpErrorCode.InvalidRequest, detail);
64
+ }
65
+ if (error.response?.status === 404) {
66
+ throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
67
+ }
68
+ throw new McpError(McpErrorCode.InternalError, `Failed to search graph: ${error.message}`);
69
+ }
70
+ }
71
+ // Multi-graph search: graphIds provided, or neither memoryGraphId nor graphIds provided
72
+ this.logger.info('GraphSearchTool', `Searching multiple graphs`);
73
+ try {
74
+ const result = await this.ucmClient.graphSearchMultiple(query, {
75
+ graphIds,
76
+ entityTypes,
77
+ limit,
78
+ similarityThreshold
79
+ });
80
+ return JSON.stringify(result);
81
+ }
82
+ catch (error) {
83
+ if (error.response?.status === 422) {
84
+ const detail = error.response?.data?.message || 'Embeddings are not configured for one or more Memory Graphs';
85
+ throw new McpError(McpErrorCode.InvalidRequest, detail);
86
+ }
87
+ if (error.response?.status === 404) {
88
+ throw new McpError(McpErrorCode.InvalidParams, `One or more Memory Graphs not found`);
89
+ }
90
+ throw new McpError(McpErrorCode.InternalError, `Failed to search graphs: ${error.message}`);
91
+ }
92
+ }
93
+ }
94
+ //# sourceMappingURL=GraphSearchTool.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 GraphTraverseParams } from '@/schemas/memory-graph-tool-schemas.js';
5
+ import { ZodSchema } from 'zod';
6
+ export declare class GraphTraverseTool 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: GraphTraverseParams): Promise<string>;
13
+ }
14
+ //# sourceMappingURL=GraphTraverseTool.d.ts.map