@utaba/ucm-mcp-server 6.5.1 → 6.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/clients/UcmLocalApiClient.d.ts +221 -2
- package/dist/clients/UcmLocalApiClient.js +211 -3
- package/dist/index.js +1 -1
- package/dist/interfaces/IMcpTool.d.ts +2 -2
- package/dist/server/ToolRegistry.js +44 -8
- package/dist/tools/authorization/ListAuthorizationsTool.js +2 -2
- package/dist/tools/authorization/SignOutTool.js +2 -2
- package/dist/tools/base/BaseToolController.d.ts +7 -4
- package/dist/tools/base/BaseToolController.js +28 -11
- package/dist/tools/connections/AccessConnectionTool.js +2 -2
- package/dist/tools/connections/CallRemoteToolTool.js +3 -3
- 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.d.ts +1 -1
- package/dist/tools/core/MoveArtifactTool.js +2 -2
- 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 +14 -0
- package/dist/tools/memory-graph/GraphCreateEntitiesTool.js +58 -0
- package/dist/tools/memory-graph/GraphCreateRelationshipsTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphCreateRelationshipsTool.js +57 -0
- package/dist/tools/memory-graph/GraphCreateTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphCreateTool.js +64 -0
- package/dist/tools/memory-graph/GraphDeleteEntitiesTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphDeleteEntitiesTool.js +45 -0
- package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.js +45 -0
- package/dist/tools/memory-graph/GraphExploreTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphExploreTool.js +73 -0
- package/dist/tools/memory-graph/GraphFindEntitiesTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphFindEntitiesTool.js +68 -0
- package/dist/tools/memory-graph/GraphFindPathsTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphFindPathsTool.js +62 -0
- package/dist/tools/memory-graph/GraphGetEntityTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphGetEntityTool.js +49 -0
- package/dist/tools/memory-graph/GraphGetRelationshipsTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphGetRelationshipsTool.js +62 -0
- package/dist/tools/memory-graph/GraphListTemplatesTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphListTemplatesTool.js +34 -0
- package/dist/tools/memory-graph/GraphListTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphListTool.js +45 -0
- package/dist/tools/memory-graph/GraphOpenTool.d.ts +15 -0
- package/dist/tools/memory-graph/GraphOpenTool.js +50 -0
- package/dist/tools/memory-graph/GraphProposeVocabularyTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphProposeVocabularyTool.js +149 -0
- package/dist/tools/memory-graph/GraphSearchTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphSearchTool.js +94 -0
- package/dist/tools/memory-graph/GraphTraverseTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphTraverseTool.js +114 -0
- package/dist/tools/memory-graph/GraphUpdateEntitiesTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphUpdateEntitiesTool.js +58 -0
- package/dist/tools/memory-graph/GraphUpdateTool.d.ts +14 -0
- package/dist/tools/memory-graph/GraphUpdateTool.js +59 -0
- package/dist/tools/memory-graph/KnowledgeSetListTool.d.ts +14 -0
- package/dist/tools/memory-graph/KnowledgeSetListTool.js +25 -0
- package/dist/tools/memory-graph/KnowledgeSetOpenTool.d.ts +14 -0
- package/dist/tools/memory-graph/KnowledgeSetOpenTool.js +31 -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/ListRepositoriesTool.js +5 -4
- package/dist/utils/McpErrorHandler.js +1 -1
- package/package.json +1 -1
- package/package.json.backup +1 -1
- package/dist/clients/UcmApiClient.d.ts +0 -157
- package/dist/clients/UcmApiClient.js +0 -443
- package/dist/publish/package.json +0 -37
- package/dist/tools/artifacts/GetArtifactController.d.ts +0 -34
- package/dist/tools/artifacts/GetArtifactController.js +0 -397
- package/dist/tools/artifacts/GetLatestController.d.ts +0 -39
- package/dist/tools/artifacts/GetLatestController.js +0 -469
- package/dist/tools/artifacts/ListVersionsController.d.ts +0 -43
- package/dist/tools/artifacts/ListVersionsController.js +0 -530
- package/dist/tools/artifacts/PublishArtifactController.d.ts +0 -37
- package/dist/tools/artifacts/PublishArtifactController.js +0 -605
- package/dist/tools/discovery/BrowseCategoriesController.d.ts +0 -25
- package/dist/tools/discovery/BrowseCategoriesController.js +0 -400
- package/dist/tools/discovery/FindByPurposeController.d.ts +0 -12
- package/dist/tools/discovery/FindByPurposeController.js +0 -131
- package/dist/tools/discovery/ListAuthorsController.d.ts +0 -20
- package/dist/tools/discovery/ListAuthorsController.js +0 -274
- package/dist/tools/discovery/SearchArtifactsController.d.ts +0 -14
- package/dist/tools/discovery/SearchArtifactsController.js +0 -226
- package/dist/tools/navigation/ExploreNamespaceController.d.ts +0 -35
- package/dist/tools/navigation/ExploreNamespaceController.js +0 -548
- package/dist/tools/repository/DeleteRepositoryGuidanceTool.d.ts +0 -13
- package/dist/tools/repository/DeleteRepositoryGuidanceTool.js +0 -93
- package/dist/tools/sharepoint/SharePointSignOutTool.d.ts +0 -22
- package/dist/tools/sharepoint/SharePointSignOutTool.js +0 -114
- package/dist/tools/utility/HealthCheckController.d.ts +0 -11
- package/dist/tools/utility/HealthCheckController.js +0 -60
- package/dist/tools/utility/SubmitFeedbackTool.d.ts +0 -16
- package/dist/tools/utility/SubmitFeedbackTool.js +0 -68
- package/dist/tools/utility/ValidatePathController.d.ts +0 -30
- package/dist/tools/utility/ValidatePathController.js +0 -465
- package/dist/utils/HttpsAgentFactory.d.ts +0 -21
- package/dist/utils/HttpsAgentFactory.js +0 -50
- package/dist/utils/ValidationUtils.d.ts +0 -10
- package/dist/utils/ValidationUtils.js +0 -50
|
@@ -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
|
|
@@ -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, query instructions, usage 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
|