@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,149 @@
|
|
|
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 or relationship types, or edit existing types (add/remove/update properties) 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
|
+
editEntityTypes: {
|
|
79
|
+
type: 'array',
|
|
80
|
+
description: 'Edits to existing entity types — add, remove, or update properties',
|
|
81
|
+
items: {
|
|
82
|
+
type: 'object',
|
|
83
|
+
properties: {
|
|
84
|
+
type: { type: 'string', description: 'Existing entity type name to modify' },
|
|
85
|
+
description: { type: 'string', description: 'New description (omit to keep current)' },
|
|
86
|
+
justification: { type: 'string', description: 'Why this change is needed' },
|
|
87
|
+
addProperties: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, type: { type: 'string', description: 'string, number, boolean, date' }, required: { type: 'boolean' }, description: { type: 'string' } }, required: ['name', 'type', 'required'] }, description: 'New properties to add' },
|
|
88
|
+
removeProperties: { type: 'array', items: { type: 'string' }, description: 'Property names to remove' },
|
|
89
|
+
updateProperties: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, type: { type: 'string', description: 'string, number, boolean, date' }, required: { type: 'boolean' }, description: { type: 'string' } }, required: ['name', 'type', 'required'] }, description: 'Existing properties to update (matched by name)' }
|
|
90
|
+
},
|
|
91
|
+
required: ['type', 'justification']
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
editRelationshipTypes: {
|
|
95
|
+
type: 'array',
|
|
96
|
+
description: 'Edits to existing relationship types',
|
|
97
|
+
items: {
|
|
98
|
+
type: 'object',
|
|
99
|
+
properties: {
|
|
100
|
+
type: { type: 'string', description: 'Existing relationship type name to modify' },
|
|
101
|
+
description: { type: 'string', description: 'New description (omit to keep current)' },
|
|
102
|
+
justification: { type: 'string', description: 'Why this change is needed' },
|
|
103
|
+
allowedSourceTypes: { type: 'array', items: { type: 'string' }, description: 'Replace allowed source entity types' },
|
|
104
|
+
allowedTargetTypes: { type: 'array', items: { type: 'string' }, description: 'Replace allowed target entity types' },
|
|
105
|
+
bidirectional: { type: 'boolean', description: 'Change bidirectional flag' },
|
|
106
|
+
addProperties: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, type: { type: 'string' }, required: { type: 'boolean' }, description: { type: 'string' } }, required: ['name', 'type', 'required'] }, description: 'New properties to add' },
|
|
107
|
+
removeProperties: { type: 'array', items: { type: 'string' }, description: 'Property names to remove' },
|
|
108
|
+
updateProperties: { type: 'array', items: { type: 'object', properties: { name: { type: 'string' }, type: { type: 'string' }, required: { type: 'boolean' }, description: { type: 'string' } }, required: ['name', 'type', 'required'] }, description: 'Existing properties to update (matched by name)' }
|
|
109
|
+
},
|
|
110
|
+
required: ['type', 'justification']
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
},
|
|
114
|
+
required: ['memoryGraphId']
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
async handleExecute(params) {
|
|
118
|
+
const { memoryGraphId, entityTypes, relationshipTypes, editEntityTypes, editRelationshipTypes } = params;
|
|
119
|
+
const hasAny = (entityTypes && entityTypes.length > 0) ||
|
|
120
|
+
(relationshipTypes && relationshipTypes.length > 0) ||
|
|
121
|
+
(editEntityTypes && editEntityTypes.length > 0) ||
|
|
122
|
+
(editRelationshipTypes && editRelationshipTypes.length > 0);
|
|
123
|
+
if (!hasAny) {
|
|
124
|
+
throw new McpError(McpErrorCode.InvalidParams, 'At least one of entityTypes, relationshipTypes, editEntityTypes, or editRelationshipTypes must be provided');
|
|
125
|
+
}
|
|
126
|
+
this.logger.info('GraphProposeVocabularyTool', `Proposing vocabulary for graph: ${memoryGraphId}`);
|
|
127
|
+
try {
|
|
128
|
+
const result = await this.ucmClient.graphProposeVocabulary(memoryGraphId, {
|
|
129
|
+
// TYPE-EXCEPTION: Zod infers `required?: boolean` but API client expects `required: boolean`;
|
|
130
|
+
// runtime values are always valid — cast to satisfy the client signature.
|
|
131
|
+
entityTypes: entityTypes,
|
|
132
|
+
relationshipTypes: relationshipTypes,
|
|
133
|
+
editEntityTypes: editEntityTypes,
|
|
134
|
+
editRelationshipTypes: editRelationshipTypes,
|
|
135
|
+
});
|
|
136
|
+
return JSON.stringify(result);
|
|
137
|
+
}
|
|
138
|
+
catch (error) {
|
|
139
|
+
if (error.response?.status === 400) {
|
|
140
|
+
throw new McpError(McpErrorCode.InvalidParams, error.response.data?.message || 'Validation error');
|
|
141
|
+
}
|
|
142
|
+
if (error.response?.status === 404) {
|
|
143
|
+
throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
|
|
144
|
+
}
|
|
145
|
+
throw new McpError(McpErrorCode.InternalError, `Failed to propose vocabulary: ${error.message}`);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
//# 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
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
+
import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
|
|
3
|
+
import { GraphTraverseSchema } from '../../../schemas/memory-graph-tool-schemas.js';
|
|
4
|
+
export class GraphTraverseTool extends BaseToolController {
|
|
5
|
+
constructor(ucmClient, logger, publishingAuthorId) {
|
|
6
|
+
super(ucmClient, logger, publishingAuthorId);
|
|
7
|
+
}
|
|
8
|
+
get name() { return 'ucm_graph_traverse'; }
|
|
9
|
+
get description() {
|
|
10
|
+
return 'Execute a structured graph traversal using a JSON spec. Supports start point selection, ordered hop steps with relationship/entity type filters, property filters, repeat loops, and multiple return modes (terminal, all, paths). The most powerful query tool for complex graph navigation.';
|
|
11
|
+
}
|
|
12
|
+
get schema() { return GraphTraverseSchema; }
|
|
13
|
+
get inputSchema() {
|
|
14
|
+
return {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
memoryGraphId: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'The Memory Graph ID'
|
|
20
|
+
},
|
|
21
|
+
start: {
|
|
22
|
+
type: 'object',
|
|
23
|
+
description: 'Start point specification',
|
|
24
|
+
properties: {
|
|
25
|
+
entityId: { type: 'string', description: 'Start from a specific entity ID or slug' },
|
|
26
|
+
entityType: { type: 'string', description: 'Start from all entities of this type' },
|
|
27
|
+
filter: {
|
|
28
|
+
type: 'array',
|
|
29
|
+
items: {
|
|
30
|
+
type: 'object',
|
|
31
|
+
properties: {
|
|
32
|
+
key: { type: 'string' },
|
|
33
|
+
operator: { type: 'string', description: 'eq, neq, gt, gte, lt, lte, contains, isNull, isNotNull' },
|
|
34
|
+
value: {}
|
|
35
|
+
},
|
|
36
|
+
required: ['key', 'operator']
|
|
37
|
+
},
|
|
38
|
+
description: 'Property filters on start entities'
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
steps: {
|
|
43
|
+
type: 'array',
|
|
44
|
+
description: 'Ordered traversal steps (hops)',
|
|
45
|
+
items: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
properties: {
|
|
48
|
+
direction: { type: 'string', enum: ['out', 'in', 'both'], description: 'Hop direction' },
|
|
49
|
+
relationshipTypes: { type: 'array', items: { type: 'string' }, description: 'Filter by relationship types' },
|
|
50
|
+
entityTypes: { type: 'array', items: { type: 'string' }, description: 'Filter by entity types at this step' },
|
|
51
|
+
entityFilter: {
|
|
52
|
+
type: 'array',
|
|
53
|
+
items: {
|
|
54
|
+
type: 'object',
|
|
55
|
+
properties: {
|
|
56
|
+
key: { type: 'string' },
|
|
57
|
+
operator: { type: 'string' },
|
|
58
|
+
value: {}
|
|
59
|
+
},
|
|
60
|
+
required: ['key', 'operator']
|
|
61
|
+
},
|
|
62
|
+
description: 'Property filters on entities at this step'
|
|
63
|
+
},
|
|
64
|
+
repeat: {
|
|
65
|
+
type: 'object',
|
|
66
|
+
properties: {
|
|
67
|
+
maxDepth: { type: 'number', description: 'Maximum repeat depth' },
|
|
68
|
+
emitIntermediates: { type: 'boolean', description: 'Include intermediate results' }
|
|
69
|
+
},
|
|
70
|
+
description: 'Repeat this step up to maxDepth times'
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
},
|
|
75
|
+
returnMode: {
|
|
76
|
+
type: 'string',
|
|
77
|
+
enum: ['terminal', 'all', 'path'],
|
|
78
|
+
description: 'What to return: terminal (only final step entities), all (every visited entity), path (full traversal paths with relationships). Default: terminal'
|
|
79
|
+
},
|
|
80
|
+
limit: {
|
|
81
|
+
type: 'number',
|
|
82
|
+
description: 'Maximum results (default: 50, max: 200)'
|
|
83
|
+
},
|
|
84
|
+
detailLevel: {
|
|
85
|
+
type: 'string',
|
|
86
|
+
enum: ['brief', 'summary', 'full'],
|
|
87
|
+
description: 'Detail level for returned entities (default: summary)'
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
required: ['memoryGraphId', 'start', 'steps']
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
async handleExecute(params) {
|
|
94
|
+
const { memoryGraphId, start, steps, returnMode, limit, detailLevel } = params;
|
|
95
|
+
this.logger.info('GraphTraverseTool', `Traversing graph: ${memoryGraphId}`);
|
|
96
|
+
try {
|
|
97
|
+
const result = await this.ucmClient.graphTraverse(memoryGraphId, {
|
|
98
|
+
start,
|
|
99
|
+
steps,
|
|
100
|
+
returnMode,
|
|
101
|
+
limit,
|
|
102
|
+
detailLevel
|
|
103
|
+
});
|
|
104
|
+
return JSON.stringify(result);
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
if (error.response?.status === 404) {
|
|
108
|
+
throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found`);
|
|
109
|
+
}
|
|
110
|
+
throw new McpError(McpErrorCode.InternalError, `Failed to traverse graph: ${error.message}`);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=GraphTraverseTool.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 GraphUpdateEntitiesParams } from '../../../schemas/memory-graph-tool-schemas.js';
|
|
5
|
+
import { ZodSchema } from 'zod';
|
|
6
|
+
export declare class GraphUpdateEntitiesTool 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: GraphUpdateEntitiesParams): Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=GraphUpdateEntitiesTool.d.ts.map
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
+
import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
|
|
3
|
+
import { GraphUpdateEntitiesSchema } from '../../../schemas/memory-graph-tool-schemas.js';
|
|
4
|
+
export class GraphUpdateEntitiesTool extends BaseToolController {
|
|
5
|
+
constructor(ucmClient, logger, publishingAuthorId) {
|
|
6
|
+
super(ucmClient, logger, publishingAuthorId);
|
|
7
|
+
}
|
|
8
|
+
get name() { return 'ucm_graph_update_entities'; }
|
|
9
|
+
get description() {
|
|
10
|
+
return 'Update one or more entities in a Memory Graph. Each update specifies an entityId and the fields to change (label, summary, properties, data). Pass a single item in the array for single operations.';
|
|
11
|
+
}
|
|
12
|
+
get schema() { return GraphUpdateEntitiesSchema; }
|
|
13
|
+
get inputSchema() {
|
|
14
|
+
return {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
memoryGraphId: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'The Memory Graph ID'
|
|
20
|
+
},
|
|
21
|
+
updates: {
|
|
22
|
+
type: 'array',
|
|
23
|
+
description: 'Array of entity updates',
|
|
24
|
+
items: {
|
|
25
|
+
type: 'object',
|
|
26
|
+
properties: {
|
|
27
|
+
entityId: { type: 'string', description: 'The entity ID to update' },
|
|
28
|
+
label: { type: 'string', description: 'New label' },
|
|
29
|
+
summary: { type: 'string', description: 'New summary' },
|
|
30
|
+
properties: { type: 'object', description: 'Properties to update (merged with existing)' },
|
|
31
|
+
data: { type: 'object', description: 'Data to update (merged with existing)' }
|
|
32
|
+
},
|
|
33
|
+
required: ['entityId']
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
required: ['memoryGraphId', 'updates']
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
async handleExecute(params) {
|
|
41
|
+
const { memoryGraphId, updates } = params;
|
|
42
|
+
this.logger.info('GraphUpdateEntitiesTool', `Updating ${updates.length} entities in graph: ${memoryGraphId}`);
|
|
43
|
+
try {
|
|
44
|
+
const result = await this.ucmClient.graphUpdateEntities(memoryGraphId, updates);
|
|
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, `Entity or Memory Graph not found`);
|
|
53
|
+
}
|
|
54
|
+
throw new McpError(McpErrorCode.InternalError, `Failed to update entities: ${error.message}`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=GraphUpdateEntitiesTool.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 GraphUpdateParams } from '../../../schemas/memory-graph-tool-schemas.js';
|
|
5
|
+
import { ZodSchema } from 'zod';
|
|
6
|
+
export declare class GraphUpdateTool 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: GraphUpdateParams): Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=GraphUpdateTool.d.ts.map
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
+
import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
|
|
3
|
+
import { GraphUpdateSchema } from '../../../schemas/memory-graph-tool-schemas.js';
|
|
4
|
+
export class GraphUpdateTool extends BaseToolController {
|
|
5
|
+
constructor(ucmClient, logger, publishingAuthorId) {
|
|
6
|
+
super(ucmClient, logger, publishingAuthorId);
|
|
7
|
+
}
|
|
8
|
+
get name() { return 'ucm_graph_update'; }
|
|
9
|
+
get description() {
|
|
10
|
+
return 'Update a Memory Graph\'s metadata — label, description, or usage instructions. Use this to update usage instructions with per-graph behavioural rules. Whole-document replacement for usageInstructions.';
|
|
11
|
+
}
|
|
12
|
+
get schema() { return GraphUpdateSchema; }
|
|
13
|
+
get inputSchema() {
|
|
14
|
+
return {
|
|
15
|
+
type: 'object',
|
|
16
|
+
properties: {
|
|
17
|
+
memoryGraphId: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
description: 'The ID of the Memory Graph to update'
|
|
20
|
+
},
|
|
21
|
+
label: {
|
|
22
|
+
type: 'string',
|
|
23
|
+
description: 'New display name for the Memory Graph'
|
|
24
|
+
},
|
|
25
|
+
description: {
|
|
26
|
+
type: ['string', 'null'],
|
|
27
|
+
description: 'New description of the Memory Graph purpose'
|
|
28
|
+
},
|
|
29
|
+
usageInstructions: {
|
|
30
|
+
type: ['string', 'null'],
|
|
31
|
+
description: 'Per-graph behavioural rules and usage instructions. Whole-document replacement.'
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
required: ['memoryGraphId']
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
async handleExecute(params) {
|
|
38
|
+
const { memoryGraphId, label, description, usageInstructions } = params;
|
|
39
|
+
this.logger.info('GraphUpdateTool', `Updating memory graph: ${memoryGraphId}`);
|
|
40
|
+
try {
|
|
41
|
+
const result = await this.ucmClient.updateMemoryGraph(memoryGraphId, { label, description, usageInstructions });
|
|
42
|
+
return JSON.stringify(result);
|
|
43
|
+
}
|
|
44
|
+
catch (error) {
|
|
45
|
+
if (error.response?.status === 400) {
|
|
46
|
+
const detail = error.response?.data?.message || 'Invalid parameters for graph update';
|
|
47
|
+
throw new McpError(McpErrorCode.InvalidParams, detail);
|
|
48
|
+
}
|
|
49
|
+
if (error.response?.status === 403) {
|
|
50
|
+
throw new McpError(McpErrorCode.InvalidParams, 'Access denied: you do not have permission to update this Memory Graph.');
|
|
51
|
+
}
|
|
52
|
+
if (error.response?.status === 404) {
|
|
53
|
+
throw new McpError(McpErrorCode.InvalidParams, `Memory Graph not found: ${memoryGraphId}`);
|
|
54
|
+
}
|
|
55
|
+
throw new McpError(McpErrorCode.InternalError, `Failed to update memory graph: ${error.message}`);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=GraphUpdateTool.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 KnowledgeSetListParams } from '../../../schemas/memory-graph-tool-schemas.js';
|
|
5
|
+
import { ZodSchema } from 'zod';
|
|
6
|
+
export declare class KnowledgeSetListTool 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: KnowledgeSetListParams): Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=KnowledgeSetListTool.d.ts.map
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
+
import { KnowledgeSetListSchema } from '../../../schemas/memory-graph-tool-schemas.js';
|
|
3
|
+
export class KnowledgeSetListTool extends BaseToolController {
|
|
4
|
+
constructor(ucmClient, logger, publishingAuthorId) {
|
|
5
|
+
super(ucmClient, logger, publishingAuthorId);
|
|
6
|
+
}
|
|
7
|
+
get name() { return 'ucm_knowledge_set_list'; }
|
|
8
|
+
get description() {
|
|
9
|
+
return 'List Knowledge Sets you have access to. Use `ucm_knowledge_set_open` with a Knowledge Set ID to explore its contents.';
|
|
10
|
+
}
|
|
11
|
+
get schema() { return KnowledgeSetListSchema; }
|
|
12
|
+
get inputSchema() {
|
|
13
|
+
return {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {},
|
|
16
|
+
required: []
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async handleExecute(_params) {
|
|
20
|
+
this.logger.info('KnowledgeSetListTool', 'Listing knowledge sets');
|
|
21
|
+
const result = await this.ucmClient.listKnowledgeSetSummary();
|
|
22
|
+
return result;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=KnowledgeSetListTool.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 KnowledgeSetOpenParams } from '../../../schemas/memory-graph-tool-schemas.js';
|
|
5
|
+
import { ZodSchema } from 'zod';
|
|
6
|
+
export declare class KnowledgeSetOpenTool 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: KnowledgeSetOpenParams): Promise<string>;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=KnowledgeSetOpenTool.d.ts.map
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
+
import { KnowledgeSetOpenSchema } from '../../../schemas/memory-graph-tool-schemas.js';
|
|
3
|
+
export class KnowledgeSetOpenTool extends BaseToolController {
|
|
4
|
+
constructor(ucmClient, logger, publishingAuthorId) {
|
|
5
|
+
super(ucmClient, logger, publishingAuthorId);
|
|
6
|
+
}
|
|
7
|
+
get name() { return 'ucm_knowledge_set_open'; }
|
|
8
|
+
get description() {
|
|
9
|
+
return 'Open a Knowledge Set to see its contents — Memory Graphs, artifact repositories, and artifact namespaces — with guidance on which tools to use for each.';
|
|
10
|
+
}
|
|
11
|
+
get schema() { return KnowledgeSetOpenSchema; }
|
|
12
|
+
get inputSchema() {
|
|
13
|
+
return {
|
|
14
|
+
type: 'object',
|
|
15
|
+
properties: {
|
|
16
|
+
knowledgeSetId: {
|
|
17
|
+
type: 'string',
|
|
18
|
+
description: 'The Knowledge Set ID to open'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
required: ['knowledgeSetId']
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
async handleExecute(_params) {
|
|
25
|
+
const { knowledgeSetId } = _params;
|
|
26
|
+
this.logger.info('KnowledgeSetOpenTool', `Opening knowledge set ${knowledgeSetId}`);
|
|
27
|
+
const result = await this.ucmClient.openKnowledgeSet(knowledgeSetId);
|
|
28
|
+
return result;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=KnowledgeSetOpenTool.js.map
|