@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.
- package/dist/clients/UcmLocalApiClient.d.ts +175 -2
- package/dist/clients/UcmLocalApiClient.js +203 -3
- package/dist/index.js +1 -1
- package/dist/mcp-server/clients/UcmLocalApiClient.d.ts +399 -0
- package/dist/mcp-server/clients/UcmLocalApiClient.js +719 -0
- package/dist/mcp-server/index.d.ts +3 -0
- package/dist/mcp-server/index.js +68 -0
- package/dist/mcp-server/interfaces/ILogger.d.ts +8 -0
- package/dist/mcp-server/interfaces/ILogger.js +4 -0
- package/dist/mcp-server/interfaces/IMcpTool.d.ts +7 -0
- package/dist/mcp-server/interfaces/IMcpTool.js +3 -0
- package/dist/mcp-server/logging/ConsoleLogger.d.ts +16 -0
- package/dist/mcp-server/logging/ConsoleLogger.js +45 -0
- package/dist/mcp-server/logging/LoggerFactory.d.ts +9 -0
- package/dist/mcp-server/logging/LoggerFactory.js +12 -0
- package/dist/mcp-server/server/McpConfig.d.ts +26 -0
- package/dist/mcp-server/server/McpConfig.js +90 -0
- package/dist/mcp-server/server/McpHandler.d.ts +12 -0
- package/dist/mcp-server/server/McpHandler.js +84 -0
- package/dist/mcp-server/server/McpServer.d.ts +15 -0
- package/dist/mcp-server/server/McpServer.js +49 -0
- package/dist/mcp-server/server/ToolRegistry.d.ts +23 -0
- package/dist/mcp-server/server/ToolRegistry.js +169 -0
- package/dist/mcp-server/tools/authorization/ListAuthorizationsTool.d.ts +21 -0
- package/dist/mcp-server/tools/authorization/ListAuthorizationsTool.js +146 -0
- package/dist/mcp-server/tools/authorization/SignOutTool.d.ts +23 -0
- package/dist/mcp-server/tools/authorization/SignOutTool.js +128 -0
- package/dist/mcp-server/tools/base/BaseToolController.d.ts +19 -0
- package/dist/mcp-server/tools/base/BaseToolController.js +58 -0
- package/dist/mcp-server/tools/connections/AccessConnectionTool.d.ts +21 -0
- package/dist/mcp-server/tools/connections/AccessConnectionTool.js +107 -0
- package/dist/mcp-server/tools/connections/CallRemoteToolTool.d.ts +22 -0
- package/dist/mcp-server/tools/connections/CallRemoteToolTool.js +124 -0
- package/dist/mcp-server/tools/core/DeleteArtifactTool.d.ts +11 -0
- package/dist/mcp-server/tools/core/DeleteArtifactTool.js +83 -0
- package/dist/mcp-server/tools/core/EditArtifactMetadataTool.d.ts +12 -0
- package/dist/mcp-server/tools/core/EditArtifactMetadataTool.js +173 -0
- package/dist/mcp-server/tools/core/GetArtifactTool.d.ts +13 -0
- package/dist/mcp-server/tools/core/GetArtifactTool.js +124 -0
- package/dist/mcp-server/tools/core/GetArtifactVersionsTool.d.ts +11 -0
- package/dist/mcp-server/tools/core/GetArtifactVersionsTool.js +63 -0
- package/dist/mcp-server/tools/core/GetChunkTool.d.ts +11 -0
- package/dist/mcp-server/tools/core/GetChunkTool.js +56 -0
- package/dist/mcp-server/tools/core/ListArtifactsTool.d.ts +11 -0
- package/dist/mcp-server/tools/core/ListArtifactsTool.js +84 -0
- package/dist/mcp-server/tools/core/MoveArtifactTool.d.ts +12 -0
- package/dist/mcp-server/tools/core/MoveArtifactTool.js +104 -0
- package/dist/mcp-server/tools/core/PublishArtifactFromFileTool.d.ts +15 -0
- package/dist/mcp-server/tools/core/PublishArtifactFromFileTool.js +277 -0
- package/dist/mcp-server/tools/core/PublishArtifactTool.d.ts +13 -0
- package/dist/mcp-server/tools/core/PublishArtifactTool.js +218 -0
- package/dist/mcp-server/tools/core/SearchArtifactsTool.d.ts +11 -0
- package/dist/mcp-server/tools/core/SearchArtifactsTool.js +137 -0
- package/dist/mcp-server/tools/list/ListNamespaceController.d.ts +1 -0
- package/dist/mcp-server/tools/list/ListNamespaceController.js +8 -0
- package/dist/mcp-server/tools/memory-graph/GraphCreateEntitiesTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphCreateEntitiesTool.js +58 -0
- package/dist/mcp-server/tools/memory-graph/GraphCreateRelationshipsTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphCreateRelationshipsTool.js +57 -0
- package/dist/mcp-server/tools/memory-graph/GraphCreateTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphCreateTool.js +64 -0
- package/dist/mcp-server/tools/memory-graph/GraphDeleteEntitiesTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphDeleteEntitiesTool.js +45 -0
- package/dist/mcp-server/tools/memory-graph/GraphDeleteRelationshipsTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphDeleteRelationshipsTool.js +45 -0
- package/dist/mcp-server/tools/memory-graph/GraphExploreTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphExploreTool.js +73 -0
- package/dist/mcp-server/tools/memory-graph/GraphFindEntitiesTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphFindEntitiesTool.js +68 -0
- package/dist/mcp-server/tools/memory-graph/GraphFindPathsTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphFindPathsTool.js +62 -0
- package/dist/mcp-server/tools/memory-graph/GraphGetEntityTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphGetEntityTool.js +49 -0
- package/dist/mcp-server/tools/memory-graph/GraphGetRelationshipsTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphGetRelationshipsTool.js +62 -0
- package/dist/mcp-server/tools/memory-graph/GraphListTemplatesTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphListTemplatesTool.js +34 -0
- package/dist/mcp-server/tools/memory-graph/GraphListTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphListTool.js +45 -0
- package/dist/mcp-server/tools/memory-graph/GraphOpenTool.d.ts +15 -0
- package/dist/mcp-server/tools/memory-graph/GraphOpenTool.js +50 -0
- package/dist/mcp-server/tools/memory-graph/GraphProposeVocabularyTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphProposeVocabularyTool.js +108 -0
- package/dist/mcp-server/tools/memory-graph/GraphSearchTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphSearchTool.js +94 -0
- package/dist/mcp-server/tools/memory-graph/GraphTraverseTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphTraverseTool.js +114 -0
- package/dist/mcp-server/tools/memory-graph/GraphUpdateEntitiesTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/GraphUpdateEntitiesTool.js +58 -0
- package/dist/mcp-server/tools/memory-graph/KnowledgeSetListTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/KnowledgeSetListTool.js +25 -0
- package/dist/mcp-server/tools/memory-graph/KnowledgeSetOpenTool.d.ts +14 -0
- package/dist/mcp-server/tools/memory-graph/KnowledgeSetOpenTool.js +31 -0
- package/dist/mcp-server/tools/repository/CreateRepositoryTool.d.ts +12 -0
- package/dist/mcp-server/tools/repository/CreateRepositoryTool.js +116 -0
- package/dist/mcp-server/tools/repository/GetRepositoryTool.d.ts +12 -0
- package/dist/mcp-server/tools/repository/GetRepositoryTool.js +85 -0
- package/dist/mcp-server/tools/repository/UpdateRepositoryTool.d.ts +12 -0
- package/dist/mcp-server/tools/repository/UpdateRepositoryTool.js +115 -0
- package/dist/mcp-server/tools/sharepoint/SharePointListConnectionsTool.d.ts +19 -0
- package/dist/mcp-server/tools/sharepoint/SharePointListConnectionsTool.js +90 -0
- package/dist/mcp-server/tools/sharepoint/SharePointListFoldersTool.d.ts +21 -0
- package/dist/mcp-server/tools/sharepoint/SharePointListFoldersTool.js +133 -0
- package/dist/mcp-server/tools/sharepoint/SharePointReadFileTool.d.ts +22 -0
- package/dist/mcp-server/tools/sharepoint/SharePointReadFileTool.js +146 -0
- package/dist/mcp-server/tools/sharepoint/SharePointReadRelatedFileTool.d.ts +18 -0
- package/dist/mcp-server/tools/sharepoint/SharePointReadRelatedFileTool.js +108 -0
- package/dist/mcp-server/tools/sharepoint/SharePointSearchTool.d.ts +22 -0
- package/dist/mcp-server/tools/sharepoint/SharePointSearchTool.js +125 -0
- package/dist/mcp-server/tools/utility/AuthorIndexTool.d.ts +11 -0
- package/dist/mcp-server/tools/utility/AuthorIndexTool.js +49 -0
- package/dist/mcp-server/tools/utility/AuthorRecentsTool.d.ts +11 -0
- package/dist/mcp-server/tools/utility/AuthorRecentsTool.js +49 -0
- package/dist/mcp-server/tools/utility/ListRepositoriesTool.d.ts +11 -0
- package/dist/mcp-server/tools/utility/ListRepositoriesTool.js +68 -0
- package/dist/mcp-server/tools/utility/QuickstartTool.d.ts +11 -0
- package/dist/mcp-server/tools/utility/QuickstartTool.js +36 -0
- package/dist/mcp-server/types/UcmApiTypes.d.ts +40 -0
- package/dist/mcp-server/types/UcmApiTypes.js +4 -0
- package/dist/mcp-server/utils/McpErrorHandler.d.ts +25 -0
- package/dist/mcp-server/utils/McpErrorHandler.js +67 -0
- package/dist/mcp-server/utils/PathUtils.d.ts +61 -0
- package/dist/mcp-server/utils/PathUtils.js +178 -0
- package/dist/mcp-server/utils/ResponseChunker.d.ts +25 -0
- package/dist/mcp-server/utils/ResponseChunker.js +79 -0
- package/dist/mcp-server/utils/SharePointErrorHandler.d.ts +34 -0
- package/dist/mcp-server/utils/SharePointErrorHandler.js +55 -0
- package/dist/schemas/memory-graph-tool-schemas.d.ts +789 -0
- package/dist/schemas/memory-graph-tool-schemas.js +181 -0
- package/dist/server/ToolRegistry.js +42 -8
- package/dist/tools/authorization/ListAuthorizationsTool.js +2 -2
- package/dist/tools/authorization/SignOutTool.js +2 -2
- package/dist/tools/connections/AccessConnectionTool.js +8 -6
- package/dist/tools/connections/CallRemoteToolTool.js +4 -4
- package/dist/tools/core/DeleteArtifactTool.js +5 -4
- package/dist/tools/core/EditArtifactMetadataTool.js +1 -1
- package/dist/tools/core/GetArtifactTool.js +1 -1
- package/dist/tools/core/GetArtifactVersionsTool.js +1 -1
- package/dist/tools/core/GetChunkTool.js +1 -1
- package/dist/tools/core/ListArtifactsTool.js +1 -1
- package/dist/tools/core/MoveArtifactTool.js +1 -1
- package/dist/tools/core/PublishArtifactFromFileTool.js +1 -1
- package/dist/tools/core/PublishArtifactTool.js +2 -2
- package/dist/tools/core/SearchArtifactsTool.js +7 -6
- package/dist/tools/memory-graph/GraphCreateEntitiesTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphCreateEntitiesTool.js +56 -0
- package/dist/tools/memory-graph/GraphCreateRelationshipsTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphCreateRelationshipsTool.js +55 -0
- package/dist/tools/memory-graph/GraphCreateTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphCreateTool.js +62 -0
- package/dist/tools/memory-graph/GraphDeleteEntitiesTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphDeleteEntitiesTool.js +43 -0
- package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.js +43 -0
- package/dist/tools/memory-graph/GraphExploreTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphExploreTool.js +71 -0
- package/dist/tools/memory-graph/GraphFindEntitiesTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphFindEntitiesTool.js +66 -0
- package/dist/tools/memory-graph/GraphFindPathsTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphFindPathsTool.js +60 -0
- package/dist/tools/memory-graph/GraphGetEntityTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphGetEntityTool.js +47 -0
- package/dist/tools/memory-graph/GraphGetRelationshipsTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphGetRelationshipsTool.js +60 -0
- package/dist/tools/memory-graph/GraphGetStatsTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphGetStatsTool.js +42 -0
- package/dist/tools/memory-graph/GraphListTemplatesTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphListTemplatesTool.js +32 -0
- package/dist/tools/memory-graph/GraphListTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphListTool.js +43 -0
- package/dist/tools/memory-graph/GraphOpenTool.d.ts +12 -0
- package/dist/tools/memory-graph/GraphOpenTool.js +48 -0
- package/dist/tools/memory-graph/GraphProposeVocabularyTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphProposeVocabularyTool.js +104 -0
- package/dist/tools/memory-graph/GraphRemoveRelationshipsTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphRemoveRelationshipsTool.js +47 -0
- package/dist/tools/memory-graph/GraphSearchTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphSearchTool.js +92 -0
- package/dist/tools/memory-graph/GraphTraverseTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphTraverseTool.js +112 -0
- package/dist/tools/memory-graph/GraphUpdateEntitiesTool.d.ts +11 -0
- package/dist/tools/memory-graph/GraphUpdateEntitiesTool.js +56 -0
- package/dist/tools/memory-graph/KnowledgeSetListTool.d.ts +11 -0
- package/dist/tools/memory-graph/KnowledgeSetListTool.js +23 -0
- package/dist/tools/memory-graph/KnowledgeSetOpenTool.d.ts +11 -0
- package/dist/tools/memory-graph/KnowledgeSetOpenTool.js +29 -0
- package/dist/tools/repository/CreateRepositoryTool.js +10 -9
- package/dist/tools/repository/GetRepositoryTool.js +15 -15
- package/dist/tools/repository/UpdateRepositoryTool.js +10 -9
- package/dist/tools/sharepoint/SharePointListConnectionsTool.js +1 -1
- package/dist/tools/sharepoint/SharePointListFoldersTool.js +1 -1
- package/dist/tools/utility/AuthorIndexTool.js +6 -5
- package/dist/tools/utility/AuthorRecentsTool.js +6 -5
- package/dist/tools/utility/HealthCheckController.js +1 -1
- package/dist/tools/utility/ListRepositoriesTool.js +5 -4
- package/dist/utils/McpErrorHandler.js +1 -1
- package/package.json +1 -1
- package/package.json.backup +1 -1
|
@@ -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
|
|
@@ -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 GraphExploreParams } from '@/schemas/memory-graph-tool-schemas.js';
|
|
5
|
+
import { ZodSchema } from 'zod';
|
|
6
|
+
export declare class GraphExploreTool 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: GraphExploreParams): Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=GraphExploreTool.d.ts.map
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
+
import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
|
|
3
|
+
import { GraphExploreSchema } from '@/schemas/memory-graph-tool-schemas.js';
|
|
4
|
+
export class GraphExploreTool extends BaseToolController {
|
|
5
|
+
constructor(ucmClient, logger, publishingAuthorId) {
|
|
6
|
+
super(ucmClient, logger, publishingAuthorId);
|
|
7
|
+
}
|
|
8
|
+
get name() { return 'ucm_graph_explore'; }
|
|
9
|
+
get description() {
|
|
10
|
+
return 'Explore the neighbourhood around an entity using BFS traversal (1-3 hops). Returns connected entities grouped by distance, with optional relationship/entity type filters.';
|
|
11
|
+
}
|
|
12
|
+
get schema() { return GraphExploreSchema; }
|
|
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: 'Starting entity ID for exploration'
|
|
24
|
+
},
|
|
25
|
+
depth: {
|
|
26
|
+
type: 'number',
|
|
27
|
+
description: 'Exploration depth: 1, 2, or 3 hops (default: 1)'
|
|
28
|
+
},
|
|
29
|
+
relationshipTypes: {
|
|
30
|
+
type: 'array',
|
|
31
|
+
items: { type: 'string' },
|
|
32
|
+
description: 'Filter by relationship types'
|
|
33
|
+
},
|
|
34
|
+
entityTypes: {
|
|
35
|
+
type: 'array',
|
|
36
|
+
items: { type: 'string' },
|
|
37
|
+
description: 'Filter by entity types'
|
|
38
|
+
},
|
|
39
|
+
direction: {
|
|
40
|
+
type: 'string',
|
|
41
|
+
enum: ['outbound', 'inbound', 'both'],
|
|
42
|
+
description: 'Traversal direction (default: both)'
|
|
43
|
+
},
|
|
44
|
+
limitPerType: {
|
|
45
|
+
type: 'number',
|
|
46
|
+
description: 'Maximum results per relationship type (default: 10)'
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
required: ['memoryGraphId', 'entityId']
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
async handleExecute(params) {
|
|
53
|
+
const { memoryGraphId, entityId, depth, relationshipTypes, entityTypes, direction, limitPerType } = params;
|
|
54
|
+
this.logger.info('GraphExploreTool', `Exploring from entity ${entityId} in graph: ${memoryGraphId}`);
|
|
55
|
+
try {
|
|
56
|
+
const result = await this.ucmClient.graphExplore(memoryGraphId, {
|
|
57
|
+
entityId,
|
|
58
|
+
maxDepth: depth,
|
|
59
|
+
relationshipTypes,
|
|
60
|
+
entityTypes,
|
|
61
|
+
limit: limitPerType
|
|
62
|
+
});
|
|
63
|
+
return JSON.stringify(result);
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
if (error.response?.status === 404) {
|
|
67
|
+
throw new McpError(McpErrorCode.InvalidParams, `Entity or Memory Graph not found`);
|
|
68
|
+
}
|
|
69
|
+
throw new McpError(McpErrorCode.InternalError, `Failed to explore neighbourhood: ${error.message}`);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
//# sourceMappingURL=GraphExploreTool.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 GraphFindEntitiesParams } from '@/schemas/memory-graph-tool-schemas.js';
|
|
5
|
+
import { ZodSchema } from 'zod';
|
|
6
|
+
export declare class GraphFindEntitiesTool 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: GraphFindEntitiesParams): Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=GraphFindEntitiesTool.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
+
import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
|
|
3
|
+
import { GraphFindEntitiesSchema } from '@/schemas/memory-graph-tool-schemas.js';
|
|
4
|
+
export class GraphFindEntitiesTool extends BaseToolController {
|
|
5
|
+
constructor(ucmClient, logger, publishingAuthorId) {
|
|
6
|
+
super(ucmClient, logger, publishingAuthorId);
|
|
7
|
+
}
|
|
8
|
+
get name() { return 'ucm_graph_find_entities'; }
|
|
9
|
+
get description() {
|
|
10
|
+
return 'Find entities in a Memory Graph by label, type, or property filters. Supports pagination and detail levels (brief/summary/full).';
|
|
11
|
+
}
|
|
12
|
+
get schema() { return GraphFindEntitiesSchema; }
|
|
13
|
+
get inputSchema() {
|
|
14
|
+
return {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
memoryGraphId: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'The Memory Graph ID'
|
|
20
|
+
},
|
|
21
|
+
searchTerm: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'Search term to match against entity labels (partial match)'
|
|
24
|
+
},
|
|
25
|
+
entityTypes: {
|
|
26
|
+
type: 'array',
|
|
27
|
+
items: { type: 'string' },
|
|
28
|
+
description: 'Filter by entity types (from vocabulary)'
|
|
29
|
+
},
|
|
30
|
+
detailLevel: {
|
|
31
|
+
type: 'string',
|
|
32
|
+
enum: ['brief', 'summary', 'full'],
|
|
33
|
+
description: 'Detail level for returned entities (default: summary)'
|
|
34
|
+
},
|
|
35
|
+
limit: {
|
|
36
|
+
type: 'number',
|
|
37
|
+
description: 'Maximum results to return (default: 20, max: 100)'
|
|
38
|
+
},
|
|
39
|
+
offset: {
|
|
40
|
+
type: 'number',
|
|
41
|
+
description: 'Pagination offset (default: 0)'
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
required: ['memoryGraphId']
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
async handleExecute(params) {
|
|
48
|
+
const { memoryGraphId, searchTerm, entityTypes, detailLevel, limit, offset } = params;
|
|
49
|
+
this.logger.info('GraphFindEntitiesTool', `Finding entities in graph: ${memoryGraphId}`);
|
|
50
|
+
try {
|
|
51
|
+
const result = await this.ucmClient.graphFindEntities(memoryGraphId, {
|
|
52
|
+
entityTypes,
|
|
53
|
+
searchTerm,
|
|
54
|
+
detailLevel,
|
|
55
|
+
offset,
|
|
56
|
+
limit
|
|
57
|
+
});
|
|
58
|
+
return JSON.stringify(result);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
if (error.response?.status === 404) {
|
|
62
|
+
throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
|
|
63
|
+
}
|
|
64
|
+
throw new McpError(McpErrorCode.InternalError, `Failed to find entities: ${error.message}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=GraphFindEntitiesTool.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 GraphFindPathsParams } from '@/schemas/memory-graph-tool-schemas.js';
|
|
5
|
+
import { ZodSchema } from 'zod';
|
|
6
|
+
export declare class GraphFindPathsTool 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: GraphFindPathsParams): Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=GraphFindPathsTool.d.ts.map
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
+
import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
|
|
3
|
+
import { GraphFindPathsSchema } from '@/schemas/memory-graph-tool-schemas.js';
|
|
4
|
+
export class GraphFindPathsTool extends BaseToolController {
|
|
5
|
+
constructor(ucmClient, logger, publishingAuthorId) {
|
|
6
|
+
super(ucmClient, logger, publishingAuthorId);
|
|
7
|
+
}
|
|
8
|
+
get name() { return 'ucm_graph_find_paths'; }
|
|
9
|
+
get description() {
|
|
10
|
+
return 'Find paths between two entities in a Memory Graph. Returns all paths up to the specified max depth with optional relationship/entity type filtering.';
|
|
11
|
+
}
|
|
12
|
+
get schema() { return GraphFindPathsSchema; }
|
|
13
|
+
get inputSchema() {
|
|
14
|
+
return {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
memoryGraphId: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'The Memory Graph ID'
|
|
20
|
+
},
|
|
21
|
+
sourceEntityId: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'Starting entity ID'
|
|
24
|
+
},
|
|
25
|
+
targetEntityId: {
|
|
26
|
+
type: 'string',
|
|
27
|
+
description: 'Target entity ID'
|
|
28
|
+
},
|
|
29
|
+
maxDepth: {
|
|
30
|
+
type: 'number',
|
|
31
|
+
description: 'Maximum path depth (3-5, default: 3)'
|
|
32
|
+
},
|
|
33
|
+
relationshipTypes: {
|
|
34
|
+
type: 'array',
|
|
35
|
+
items: { type: 'string' },
|
|
36
|
+
description: 'Filter by relationship types'
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
required: ['memoryGraphId', 'sourceEntityId', 'targetEntityId']
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
async handleExecute(params) {
|
|
43
|
+
const { memoryGraphId, sourceEntityId, targetEntityId, maxDepth, relationshipTypes } = params;
|
|
44
|
+
this.logger.info('GraphFindPathsTool', `Finding paths in graph: ${memoryGraphId}`);
|
|
45
|
+
try {
|
|
46
|
+
const result = await this.ucmClient.graphFindPaths(memoryGraphId, {
|
|
47
|
+
sourceEntityId,
|
|
48
|
+
targetEntityId,
|
|
49
|
+
maxDepth,
|
|
50
|
+
relationshipTypes
|
|
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 find paths: ${error.message}`);
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=GraphFindPathsTool.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 GraphGetEntityParams } from '@/schemas/memory-graph-tool-schemas.js';
|
|
5
|
+
import { ZodSchema } from 'zod';
|
|
6
|
+
export declare class GraphGetEntityTool 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: GraphGetEntityParams): Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=GraphGetEntityTool.d.ts.map
|