@utaba/ucm-mcp-server 6.6.0 → 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 +48 -1
- package/dist/clients/UcmLocalApiClient.js +8 -0
- package/dist/index.js +1 -1
- package/dist/interfaces/IMcpTool.d.ts +2 -2
- package/dist/server/ToolRegistry.js +2 -0
- package/dist/tools/base/BaseToolController.d.ts +7 -4
- package/dist/tools/base/BaseToolController.js +28 -11
- package/dist/tools/core/MoveArtifactTool.d.ts +1 -1
- package/dist/tools/core/MoveArtifactTool.js +1 -1
- package/dist/tools/memory-graph/GraphCreateEntitiesTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphCreateEntitiesTool.js +2 -0
- package/dist/tools/memory-graph/GraphCreateRelationshipsTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphCreateRelationshipsTool.js +2 -0
- package/dist/tools/memory-graph/GraphCreateTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphCreateTool.js +2 -0
- package/dist/tools/memory-graph/GraphDeleteEntitiesTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphDeleteEntitiesTool.js +2 -0
- package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphDeleteRelationshipsTool.js +2 -0
- package/dist/tools/memory-graph/GraphExploreTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphExploreTool.js +2 -0
- package/dist/tools/memory-graph/GraphFindEntitiesTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphFindEntitiesTool.js +2 -0
- package/dist/tools/memory-graph/GraphFindPathsTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphFindPathsTool.js +2 -0
- package/dist/tools/memory-graph/GraphGetEntityTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphGetEntityTool.js +2 -0
- package/dist/tools/memory-graph/GraphGetRelationshipsTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphGetRelationshipsTool.js +2 -0
- package/dist/tools/memory-graph/GraphListTemplatesTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphListTemplatesTool.js +2 -0
- package/dist/tools/memory-graph/GraphListTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphListTool.js +2 -0
- package/dist/tools/memory-graph/GraphOpenTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphOpenTool.js +3 -1
- package/dist/tools/memory-graph/GraphProposeVocabularyTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphProposeVocabularyTool.js +51 -6
- package/dist/tools/memory-graph/GraphSearchTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphSearchTool.js +2 -0
- package/dist/tools/memory-graph/GraphTraverseTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphTraverseTool.js +2 -0
- package/dist/tools/memory-graph/GraphUpdateEntitiesTool.d.ts +5 -2
- package/dist/tools/memory-graph/GraphUpdateEntitiesTool.js +2 -0
- package/dist/{mcp-server/tools/memory-graph/GraphSearchTool.d.ts → tools/memory-graph/GraphUpdateTool.d.ts} +4 -4
- package/dist/tools/memory-graph/GraphUpdateTool.js +59 -0
- package/dist/tools/memory-graph/KnowledgeSetListTool.d.ts +5 -2
- package/dist/tools/memory-graph/KnowledgeSetListTool.js +2 -0
- package/dist/tools/memory-graph/KnowledgeSetOpenTool.d.ts +5 -2
- package/dist/tools/memory-graph/KnowledgeSetOpenTool.js +2 -0
- 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/mcp-server/clients/UcmLocalApiClient.d.ts +0 -399
- package/dist/mcp-server/clients/UcmLocalApiClient.js +0 -719
- package/dist/mcp-server/index.d.ts +0 -3
- package/dist/mcp-server/index.js +0 -68
- package/dist/mcp-server/interfaces/ILogger.d.ts +0 -8
- package/dist/mcp-server/interfaces/ILogger.js +0 -4
- package/dist/mcp-server/interfaces/IMcpTool.d.ts +0 -7
- package/dist/mcp-server/interfaces/IMcpTool.js +0 -3
- package/dist/mcp-server/logging/ConsoleLogger.d.ts +0 -16
- package/dist/mcp-server/logging/ConsoleLogger.js +0 -45
- package/dist/mcp-server/logging/LoggerFactory.d.ts +0 -9
- package/dist/mcp-server/logging/LoggerFactory.js +0 -12
- package/dist/mcp-server/server/McpConfig.d.ts +0 -26
- package/dist/mcp-server/server/McpConfig.js +0 -90
- package/dist/mcp-server/server/McpHandler.d.ts +0 -12
- package/dist/mcp-server/server/McpHandler.js +0 -84
- package/dist/mcp-server/server/McpServer.d.ts +0 -15
- package/dist/mcp-server/server/McpServer.js +0 -49
- package/dist/mcp-server/server/ToolRegistry.d.ts +0 -23
- package/dist/mcp-server/server/ToolRegistry.js +0 -169
- package/dist/mcp-server/tools/authorization/ListAuthorizationsTool.d.ts +0 -21
- package/dist/mcp-server/tools/authorization/ListAuthorizationsTool.js +0 -146
- package/dist/mcp-server/tools/authorization/SignOutTool.d.ts +0 -23
- package/dist/mcp-server/tools/authorization/SignOutTool.js +0 -128
- package/dist/mcp-server/tools/base/BaseToolController.d.ts +0 -19
- package/dist/mcp-server/tools/base/BaseToolController.js +0 -58
- package/dist/mcp-server/tools/connections/AccessConnectionTool.d.ts +0 -21
- package/dist/mcp-server/tools/connections/AccessConnectionTool.js +0 -107
- package/dist/mcp-server/tools/connections/CallRemoteToolTool.d.ts +0 -22
- package/dist/mcp-server/tools/connections/CallRemoteToolTool.js +0 -124
- package/dist/mcp-server/tools/core/DeleteArtifactTool.d.ts +0 -11
- package/dist/mcp-server/tools/core/DeleteArtifactTool.js +0 -83
- package/dist/mcp-server/tools/core/EditArtifactMetadataTool.d.ts +0 -12
- package/dist/mcp-server/tools/core/EditArtifactMetadataTool.js +0 -173
- package/dist/mcp-server/tools/core/GetArtifactTool.d.ts +0 -13
- package/dist/mcp-server/tools/core/GetArtifactTool.js +0 -124
- package/dist/mcp-server/tools/core/GetArtifactVersionsTool.d.ts +0 -11
- package/dist/mcp-server/tools/core/GetArtifactVersionsTool.js +0 -63
- package/dist/mcp-server/tools/core/GetChunkTool.d.ts +0 -11
- package/dist/mcp-server/tools/core/GetChunkTool.js +0 -56
- package/dist/mcp-server/tools/core/ListArtifactsTool.d.ts +0 -11
- package/dist/mcp-server/tools/core/ListArtifactsTool.js +0 -84
- package/dist/mcp-server/tools/core/MoveArtifactTool.d.ts +0 -12
- package/dist/mcp-server/tools/core/MoveArtifactTool.js +0 -104
- package/dist/mcp-server/tools/core/PublishArtifactFromFileTool.d.ts +0 -15
- package/dist/mcp-server/tools/core/PublishArtifactFromFileTool.js +0 -277
- package/dist/mcp-server/tools/core/PublishArtifactTool.d.ts +0 -13
- package/dist/mcp-server/tools/core/PublishArtifactTool.js +0 -218
- package/dist/mcp-server/tools/core/SearchArtifactsTool.d.ts +0 -11
- package/dist/mcp-server/tools/core/SearchArtifactsTool.js +0 -137
- package/dist/mcp-server/tools/list/ListNamespaceController.d.ts +0 -1
- package/dist/mcp-server/tools/list/ListNamespaceController.js +0 -8
- package/dist/mcp-server/tools/memory-graph/GraphCreateEntitiesTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphCreateEntitiesTool.js +0 -58
- package/dist/mcp-server/tools/memory-graph/GraphCreateRelationshipsTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphCreateRelationshipsTool.js +0 -57
- package/dist/mcp-server/tools/memory-graph/GraphCreateTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphCreateTool.js +0 -64
- package/dist/mcp-server/tools/memory-graph/GraphDeleteEntitiesTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphDeleteEntitiesTool.js +0 -45
- package/dist/mcp-server/tools/memory-graph/GraphDeleteRelationshipsTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphDeleteRelationshipsTool.js +0 -45
- package/dist/mcp-server/tools/memory-graph/GraphExploreTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphExploreTool.js +0 -73
- package/dist/mcp-server/tools/memory-graph/GraphFindEntitiesTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphFindEntitiesTool.js +0 -68
- package/dist/mcp-server/tools/memory-graph/GraphFindPathsTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphFindPathsTool.js +0 -62
- package/dist/mcp-server/tools/memory-graph/GraphGetEntityTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphGetEntityTool.js +0 -49
- package/dist/mcp-server/tools/memory-graph/GraphGetRelationshipsTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphGetRelationshipsTool.js +0 -62
- package/dist/mcp-server/tools/memory-graph/GraphListTemplatesTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphListTemplatesTool.js +0 -34
- package/dist/mcp-server/tools/memory-graph/GraphListTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphListTool.js +0 -45
- package/dist/mcp-server/tools/memory-graph/GraphOpenTool.d.ts +0 -15
- package/dist/mcp-server/tools/memory-graph/GraphOpenTool.js +0 -50
- package/dist/mcp-server/tools/memory-graph/GraphProposeVocabularyTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphProposeVocabularyTool.js +0 -108
- package/dist/mcp-server/tools/memory-graph/GraphSearchTool.js +0 -94
- package/dist/mcp-server/tools/memory-graph/GraphTraverseTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphTraverseTool.js +0 -114
- package/dist/mcp-server/tools/memory-graph/GraphUpdateEntitiesTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/GraphUpdateEntitiesTool.js +0 -58
- package/dist/mcp-server/tools/memory-graph/KnowledgeSetListTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/KnowledgeSetListTool.js +0 -25
- package/dist/mcp-server/tools/memory-graph/KnowledgeSetOpenTool.d.ts +0 -14
- package/dist/mcp-server/tools/memory-graph/KnowledgeSetOpenTool.js +0 -31
- package/dist/mcp-server/tools/repository/CreateRepositoryTool.d.ts +0 -12
- package/dist/mcp-server/tools/repository/CreateRepositoryTool.js +0 -116
- package/dist/mcp-server/tools/repository/GetRepositoryTool.d.ts +0 -12
- package/dist/mcp-server/tools/repository/GetRepositoryTool.js +0 -85
- package/dist/mcp-server/tools/repository/UpdateRepositoryTool.d.ts +0 -12
- package/dist/mcp-server/tools/repository/UpdateRepositoryTool.js +0 -115
- package/dist/mcp-server/tools/sharepoint/SharePointListConnectionsTool.d.ts +0 -19
- package/dist/mcp-server/tools/sharepoint/SharePointListConnectionsTool.js +0 -90
- package/dist/mcp-server/tools/sharepoint/SharePointListFoldersTool.d.ts +0 -21
- package/dist/mcp-server/tools/sharepoint/SharePointListFoldersTool.js +0 -133
- package/dist/mcp-server/tools/sharepoint/SharePointReadFileTool.d.ts +0 -22
- package/dist/mcp-server/tools/sharepoint/SharePointReadFileTool.js +0 -146
- package/dist/mcp-server/tools/sharepoint/SharePointReadRelatedFileTool.d.ts +0 -18
- package/dist/mcp-server/tools/sharepoint/SharePointReadRelatedFileTool.js +0 -108
- package/dist/mcp-server/tools/sharepoint/SharePointSearchTool.d.ts +0 -22
- package/dist/mcp-server/tools/sharepoint/SharePointSearchTool.js +0 -125
- package/dist/mcp-server/tools/utility/AuthorIndexTool.d.ts +0 -11
- package/dist/mcp-server/tools/utility/AuthorIndexTool.js +0 -49
- package/dist/mcp-server/tools/utility/AuthorRecentsTool.d.ts +0 -11
- package/dist/mcp-server/tools/utility/AuthorRecentsTool.js +0 -49
- package/dist/mcp-server/tools/utility/ListRepositoriesTool.d.ts +0 -11
- package/dist/mcp-server/tools/utility/ListRepositoriesTool.js +0 -68
- package/dist/mcp-server/tools/utility/QuickstartTool.d.ts +0 -11
- package/dist/mcp-server/tools/utility/QuickstartTool.js +0 -36
- package/dist/mcp-server/types/UcmApiTypes.d.ts +0 -40
- package/dist/mcp-server/types/UcmApiTypes.js +0 -4
- package/dist/mcp-server/utils/McpErrorHandler.d.ts +0 -25
- package/dist/mcp-server/utils/McpErrorHandler.js +0 -67
- package/dist/mcp-server/utils/PathUtils.d.ts +0 -61
- package/dist/mcp-server/utils/PathUtils.js +0 -178
- package/dist/mcp-server/utils/ResponseChunker.d.ts +0 -25
- package/dist/mcp-server/utils/ResponseChunker.js +0 -79
- package/dist/mcp-server/utils/SharePointErrorHandler.d.ts +0 -34
- package/dist/mcp-server/utils/SharePointErrorHandler.js +0 -55
- package/dist/publish/package.json +0 -37
- package/dist/schemas/memory-graph-tool-schemas.d.ts +0 -789
- package/dist/schemas/memory-graph-tool-schemas.js +0 -181
- 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/memory-graph/GraphGetStatsTool.d.ts +0 -11
- package/dist/tools/memory-graph/GraphGetStatsTool.js +0 -42
- package/dist/tools/memory-graph/GraphRemoveRelationshipsTool.d.ts +0 -11
- package/dist/tools/memory-graph/GraphRemoveRelationshipsTool.js +0 -47
- 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
|
@@ -1,14 +0,0 @@
|
|
|
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
|
|
@@ -1,58 +0,0 @@
|
|
|
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
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
|
@@ -1,25 +0,0 @@
|
|
|
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
|
|
@@ -1,14 +0,0 @@
|
|
|
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
|
|
@@ -1,31 +0,0 @@
|
|
|
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
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
-
import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
|
|
3
|
-
import { ILogger } from '../../interfaces/ILogger.js';
|
|
4
|
-
export declare class CreateRepositoryTool extends BaseToolController {
|
|
5
|
-
constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
|
|
6
|
-
get name(): string;
|
|
7
|
-
get description(): string;
|
|
8
|
-
get inputSchema(): any;
|
|
9
|
-
protected validateParams(params: any): void;
|
|
10
|
-
protected handleExecute(params: any): Promise<any>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=CreateRepositoryTool.d.ts.map
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
-
import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
|
|
3
|
-
export class CreateRepositoryTool extends BaseToolController {
|
|
4
|
-
constructor(ucmClient, logger, publishingAuthorId) {
|
|
5
|
-
super(ucmClient, logger, publishingAuthorId);
|
|
6
|
-
}
|
|
7
|
-
get name() {
|
|
8
|
-
return 'ucm_repository_create';
|
|
9
|
-
}
|
|
10
|
-
get description() {
|
|
11
|
-
const authorInfo = this.publishingAuthorId ? ` Your default workspace id is '${this.publishingAuthorId}'.` : '';
|
|
12
|
-
return `Create a new repository for a specific workspace. Repository names must be unique within the workspace and follow UCM naming conventions. (3-200 characters, start with letter, alphanumeric and hyphens only, no consecutive hyphens).${authorInfo}`;
|
|
13
|
-
}
|
|
14
|
-
get inputSchema() {
|
|
15
|
-
return {
|
|
16
|
-
type: 'object',
|
|
17
|
-
properties: {
|
|
18
|
-
workspace: {
|
|
19
|
-
type: 'string',
|
|
20
|
-
description: this.publishingAuthorId ? `Workspace identifier: ${this.publishingAuthorId}` : 'Workspace identifier (e.g., "utaba", "1064600359")',
|
|
21
|
-
minLength: 1,
|
|
22
|
-
maxLength: 50
|
|
23
|
-
},
|
|
24
|
-
repositoryName: {
|
|
25
|
-
type: 'string',
|
|
26
|
-
description: 'Unique repository name (3-200 characters, start with letter, alphanumeric and hyphens only)',
|
|
27
|
-
minLength: 3,
|
|
28
|
-
maxLength: 200,
|
|
29
|
-
pattern: '^[a-z][a-z0-9-]{2,199}$'
|
|
30
|
-
},
|
|
31
|
-
displayName: {
|
|
32
|
-
type: 'string',
|
|
33
|
-
description: 'Human-readable display name for the repository (optional)',
|
|
34
|
-
maxLength: 255
|
|
35
|
-
},
|
|
36
|
-
description: {
|
|
37
|
-
type: 'string',
|
|
38
|
-
description: 'Repository description (optional)',
|
|
39
|
-
maxLength: 1000
|
|
40
|
-
}
|
|
41
|
-
},
|
|
42
|
-
required: ['workspace', 'repositoryName'],
|
|
43
|
-
additionalProperties: false
|
|
44
|
-
};
|
|
45
|
-
}
|
|
46
|
-
validateParams(params) {
|
|
47
|
-
super.validateParams(params);
|
|
48
|
-
// Additional validation
|
|
49
|
-
if (!params.workspace || typeof params.workspace !== 'string' || params.workspace.trim() === '') {
|
|
50
|
-
throw new McpError(McpErrorCode.InvalidParams, 'Author identifier is required and cannot be empty');
|
|
51
|
-
}
|
|
52
|
-
if (!params.repositoryName || typeof params.repositoryName !== 'string' || params.repositoryName.trim() === '') {
|
|
53
|
-
throw new McpError(McpErrorCode.InvalidParams, 'Repository name is required and cannot be empty');
|
|
54
|
-
}
|
|
55
|
-
// Validate repository name format
|
|
56
|
-
const namePattern = /^[a-z][a-z0-9-]{2,199}$/;
|
|
57
|
-
if (!namePattern.test(params.repositoryName)) {
|
|
58
|
-
throw new McpError(McpErrorCode.InvalidParams, 'Repository name must be 3-200 characters, start with a lowercase letter, and contain only lowercase letters, numbers, and hyphens (no consecutive hyphens)');
|
|
59
|
-
}
|
|
60
|
-
// Check for consecutive hyphens
|
|
61
|
-
if (params.repositoryName.includes('--')) {
|
|
62
|
-
throw new McpError(McpErrorCode.InvalidParams, 'Repository name cannot contain consecutive hyphens');
|
|
63
|
-
}
|
|
64
|
-
// Validate displayName length if provided
|
|
65
|
-
if (params.displayName && params.displayName.length > 255) {
|
|
66
|
-
throw new McpError(McpErrorCode.InvalidParams, 'Display name cannot exceed 255 characters');
|
|
67
|
-
}
|
|
68
|
-
// Validate description length if provided
|
|
69
|
-
if (params.description && params.description.length > 1000) {
|
|
70
|
-
throw new McpError(McpErrorCode.InvalidParams, 'Description cannot exceed 1,000 characters');
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
async handleExecute(params) {
|
|
74
|
-
const author = params.workspace;
|
|
75
|
-
this.logger.info('CreateRepositoryTool', `Creating repository ${params.repositoryName} for author ${author}`);
|
|
76
|
-
try {
|
|
77
|
-
const repositoryData = {
|
|
78
|
-
repositoryName: params.repositoryName,
|
|
79
|
-
displayName: params.displayName,
|
|
80
|
-
description: params.description
|
|
81
|
-
};
|
|
82
|
-
const result = await this.ucmClient.createRepository(author, repositoryData);
|
|
83
|
-
this.logger.info('CreateRepositoryTool', `Repository created successfully: ${params.repositoryName}`);
|
|
84
|
-
return {
|
|
85
|
-
content: [
|
|
86
|
-
{
|
|
87
|
-
type: 'text',
|
|
88
|
-
text: JSON.stringify({
|
|
89
|
-
success: true,
|
|
90
|
-
message: `Repository '${params.repositoryName}' created successfully for author '${author}'`,
|
|
91
|
-
repository: result,
|
|
92
|
-
webUrl: `${process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000'}/repository/${result.id || params.repositoryName}`
|
|
93
|
-
}, null, 2)
|
|
94
|
-
}
|
|
95
|
-
]
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
catch (error) {
|
|
99
|
-
this.logger.error('CreateRepositoryTool', 'Failed to create repository', '', error);
|
|
100
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
101
|
-
// Handle specific error cases
|
|
102
|
-
if (errorMessage.includes('already exists') || errorMessage.includes('NAME_EXISTS')) {
|
|
103
|
-
throw new McpError(McpErrorCode.InvalidParams, `Repository name '${params.repositoryName}' already exists for author '${author}'. Please choose a different name.`);
|
|
104
|
-
}
|
|
105
|
-
if (errorMessage.includes('not found') || errorMessage.includes('404')) {
|
|
106
|
-
throw new McpError(McpErrorCode.InvalidParams, `Author '${author}' not found. Please verify the author identifier.`);
|
|
107
|
-
}
|
|
108
|
-
if (errorMessage.includes('validation') || errorMessage.includes('invalid')) {
|
|
109
|
-
throw new McpError(McpErrorCode.InvalidParams, `Repository creation failed due to validation error: ${errorMessage}`);
|
|
110
|
-
}
|
|
111
|
-
// Generic error
|
|
112
|
-
throw new McpError(McpErrorCode.InternalError, `Failed to create repository: ${errorMessage}`);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
//# sourceMappingURL=CreateRepositoryTool.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
-
import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
|
|
3
|
-
import { ILogger } from '../../interfaces/ILogger.js';
|
|
4
|
-
export declare class GetRepositoryTool extends BaseToolController {
|
|
5
|
-
constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
|
|
6
|
-
get name(): string;
|
|
7
|
-
get description(): string;
|
|
8
|
-
get inputSchema(): any;
|
|
9
|
-
protected validateParams(params: any): void;
|
|
10
|
-
protected handleExecute(params: any): Promise<any>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=GetRepositoryTool.d.ts.map
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
-
import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
|
|
3
|
-
export class GetRepositoryTool extends BaseToolController {
|
|
4
|
-
constructor(ucmClient, logger, publishingAuthorId) {
|
|
5
|
-
super(ucmClient, logger, publishingAuthorId);
|
|
6
|
-
}
|
|
7
|
-
get name() {
|
|
8
|
-
return 'ucm_repository_get';
|
|
9
|
-
}
|
|
10
|
-
get description() {
|
|
11
|
-
return 'Get detailed information about a specific repository, including metadata, statistics, and available categories. Returns repository details along with its content structure.';
|
|
12
|
-
}
|
|
13
|
-
get inputSchema() {
|
|
14
|
-
return {
|
|
15
|
-
type: 'object',
|
|
16
|
-
properties: {
|
|
17
|
-
workspace: {
|
|
18
|
-
type: 'string',
|
|
19
|
-
description: this.publishingAuthorId ? `Workspace identifier: ${this.publishingAuthorId}` : 'Workspace identifier (e.g., "utaba", "1064600359")',
|
|
20
|
-
minLength: 1,
|
|
21
|
-
maxLength: 50
|
|
22
|
-
},
|
|
23
|
-
repository: {
|
|
24
|
-
type: 'string',
|
|
25
|
-
description: 'Repository name (e.g., "main", "project-alpha")',
|
|
26
|
-
minLength: 1,
|
|
27
|
-
maxLength: 200
|
|
28
|
-
}
|
|
29
|
-
},
|
|
30
|
-
required: ['workspace', 'repository'],
|
|
31
|
-
additionalProperties: false
|
|
32
|
-
};
|
|
33
|
-
}
|
|
34
|
-
validateParams(params) {
|
|
35
|
-
super.validateParams(params);
|
|
36
|
-
if (!params.workspace || typeof params.workspace !== 'string' || params.workspace.trim() === '') {
|
|
37
|
-
throw new McpError(McpErrorCode.InvalidParams, 'Author identifier is required and cannot be empty');
|
|
38
|
-
}
|
|
39
|
-
if (!params.repository || typeof params.repository !== 'string' || params.repository.trim() === '') {
|
|
40
|
-
throw new McpError(McpErrorCode.InvalidParams, 'Repository name is required and cannot be empty');
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
async handleExecute(params) {
|
|
44
|
-
const author = params.workspace;
|
|
45
|
-
this.logger.info('GetRepositoryTool', `Getting repository ${params.repository} for author ${author}`);
|
|
46
|
-
try {
|
|
47
|
-
const result = await this.ucmClient.getRepository(author, params.repository);
|
|
48
|
-
this.logger.info('GetRepositoryTool', `Repository retrieved successfully: ${params.repository}`);
|
|
49
|
-
// Enhance the response with additional helpful information
|
|
50
|
-
const enhancedResult = {
|
|
51
|
-
success: true,
|
|
52
|
-
message: `Repository '${params.repository}' retrieved successfully for author '${author}'`,
|
|
53
|
-
repository: result,
|
|
54
|
-
webUrl: `${process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000'}/browse/${author}/${params.repository}`,
|
|
55
|
-
apiEndpoints: {
|
|
56
|
-
browse: `/api/v1/authors/${author}/${params.repository}`,
|
|
57
|
-
artifacts: `/api/v1/authors/${author}/${params.repository}/{category}/{subcategory}`,
|
|
58
|
-
files: `/api/v1/files/${author}/${params.repository}/{category}/{subcategory}/{filename}`
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
return {
|
|
62
|
-
content: [
|
|
63
|
-
{
|
|
64
|
-
type: 'text',
|
|
65
|
-
text: JSON.stringify(enhancedResult, null, 2)
|
|
66
|
-
}
|
|
67
|
-
]
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
catch (error) {
|
|
71
|
-
this.logger.error('GetRepositoryTool', 'Failed to get repository', '', error);
|
|
72
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
73
|
-
// Handle specific error cases
|
|
74
|
-
if (errorMessage.includes('not found') || errorMessage.includes('404')) {
|
|
75
|
-
throw new McpError(McpErrorCode.InvalidParams, `Repository '${params.repository}' not found for author '${author}'. Please verify the repository name and author identifier.`);
|
|
76
|
-
}
|
|
77
|
-
if (errorMessage.includes('403') || errorMessage.includes('Forbidden')) {
|
|
78
|
-
throw new McpError(McpErrorCode.InvalidParams, `Access denied to repository '${params.repository}' for author '${author}'. You may not have permission to view this repository.`);
|
|
79
|
-
}
|
|
80
|
-
// Generic error
|
|
81
|
-
throw new McpError(McpErrorCode.InternalError, `Failed to retrieve repository: ${errorMessage}`);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=GetRepositoryTool.js.map
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
-
import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
|
|
3
|
-
import { ILogger } from '../../interfaces/ILogger.js';
|
|
4
|
-
export declare class UpdateRepositoryTool extends BaseToolController {
|
|
5
|
-
constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
|
|
6
|
-
get name(): string;
|
|
7
|
-
get description(): string;
|
|
8
|
-
get inputSchema(): any;
|
|
9
|
-
protected validateParams(params: any): void;
|
|
10
|
-
protected handleExecute(params: any): Promise<any>;
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=UpdateRepositoryTool.d.ts.map
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { BaseToolController } from '../base/BaseToolController.js';
|
|
2
|
-
import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
|
|
3
|
-
export class UpdateRepositoryTool extends BaseToolController {
|
|
4
|
-
constructor(ucmClient, logger, publishingAuthorId) {
|
|
5
|
-
super(ucmClient, logger, publishingAuthorId);
|
|
6
|
-
}
|
|
7
|
-
get name() {
|
|
8
|
-
return 'ucm_repository_update';
|
|
9
|
-
}
|
|
10
|
-
get description() {
|
|
11
|
-
const authorInfo = this.publishingAuthorId ? ` Your default workspace id is '${this.publishingAuthorId}'.` : '';
|
|
12
|
-
return `Update repository metadata including display name and description.${authorInfo}`;
|
|
13
|
-
}
|
|
14
|
-
get inputSchema() {
|
|
15
|
-
return {
|
|
16
|
-
type: 'object',
|
|
17
|
-
properties: {
|
|
18
|
-
workspace: {
|
|
19
|
-
type: 'string',
|
|
20
|
-
description: this.publishingAuthorId ? `Workspace identifier: ${this.publishingAuthorId}` : 'Workspace identifier (e.g., "utaba", "1064600359")',
|
|
21
|
-
minLength: 1,
|
|
22
|
-
maxLength: 50
|
|
23
|
-
},
|
|
24
|
-
repository: {
|
|
25
|
-
type: 'string',
|
|
26
|
-
description: 'Repository to update (e.g., "main", "project-alpha") however the name will not change. Only the displayname can be updated after creation.',
|
|
27
|
-
minLength: 1,
|
|
28
|
-
maxLength: 200
|
|
29
|
-
},
|
|
30
|
-
displayName: {
|
|
31
|
-
type: 'string',
|
|
32
|
-
description: 'New human-readable display name for the repository (optional)',
|
|
33
|
-
maxLength: 255
|
|
34
|
-
},
|
|
35
|
-
description: {
|
|
36
|
-
type: 'string',
|
|
37
|
-
description: 'New repository description (optional)',
|
|
38
|
-
maxLength: 1000
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
required: ['workspace', 'repository'],
|
|
42
|
-
additionalProperties: false
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
validateParams(params) {
|
|
46
|
-
super.validateParams(params);
|
|
47
|
-
if (!params.workspace || typeof params.workspace !== 'string' || params.workspace.trim() === '') {
|
|
48
|
-
throw new McpError(McpErrorCode.InvalidParams, 'Author identifier is required and cannot be empty');
|
|
49
|
-
}
|
|
50
|
-
if (!params.repository || typeof params.repository !== 'string' || params.repository.trim() === '') {
|
|
51
|
-
throw new McpError(McpErrorCode.InvalidParams, 'Repository name is required and cannot be empty');
|
|
52
|
-
}
|
|
53
|
-
// Validate at least one field to update is provided
|
|
54
|
-
const updateFields = ['displayName', 'description'];
|
|
55
|
-
const hasUpdateField = updateFields.some(field => params[field] !== undefined);
|
|
56
|
-
if (!hasUpdateField) {
|
|
57
|
-
throw new McpError(McpErrorCode.InvalidParams, 'At least one field to update must be provided (displayName or description)');
|
|
58
|
-
}
|
|
59
|
-
// Validate displayName length if provided
|
|
60
|
-
if (params.displayName !== undefined && params.displayName.length > 255) {
|
|
61
|
-
throw new McpError(McpErrorCode.InvalidParams, 'Display name cannot exceed 255 characters');
|
|
62
|
-
}
|
|
63
|
-
// Validate description length if provided
|
|
64
|
-
if (params.description !== undefined && params.description.length > 1000) {
|
|
65
|
-
throw new McpError(McpErrorCode.InvalidParams, 'Description cannot exceed 1,000 characters');
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
async handleExecute(params) {
|
|
69
|
-
const author = params.workspace;
|
|
70
|
-
this.logger.info('UpdateRepositoryTool', `Updating repository ${params.repository} for author ${author}`);
|
|
71
|
-
try {
|
|
72
|
-
// Build update data from provided parameters
|
|
73
|
-
const updateData = {};
|
|
74
|
-
if (params.displayName !== undefined) {
|
|
75
|
-
updateData.displayName = params.displayName;
|
|
76
|
-
}
|
|
77
|
-
if (params.description !== undefined) {
|
|
78
|
-
updateData.description = params.description;
|
|
79
|
-
}
|
|
80
|
-
const result = await this.ucmClient.updateRepository(author, params.repository, updateData);
|
|
81
|
-
this.logger.info('UpdateRepositoryTool', `Repository updated successfully: ${params.repository}`);
|
|
82
|
-
return {
|
|
83
|
-
content: [
|
|
84
|
-
{
|
|
85
|
-
type: 'text',
|
|
86
|
-
text: JSON.stringify({
|
|
87
|
-
success: true,
|
|
88
|
-
message: `Repository '${params.repository}' updated successfully for author '${author}'`,
|
|
89
|
-
repository: result,
|
|
90
|
-
updatedFields: Object.keys(updateData),
|
|
91
|
-
webUrl: `${process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000'}/repository/${result.id || params.repository}/settings`
|
|
92
|
-
}, null, 2)
|
|
93
|
-
}
|
|
94
|
-
]
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
catch (error) {
|
|
98
|
-
this.logger.error('UpdateRepositoryTool', 'Failed to update repository', '', error);
|
|
99
|
-
const errorMessage = error instanceof Error ? error.message : 'Unknown error occurred';
|
|
100
|
-
// Handle specific error cases
|
|
101
|
-
if (errorMessage.includes('not found') || errorMessage.includes('404')) {
|
|
102
|
-
throw new McpError(McpErrorCode.InvalidParams, `Repository '${params.repository}' not found for author '${author}'. Please verify the repository name and author identifier.`);
|
|
103
|
-
}
|
|
104
|
-
if (errorMessage.includes('403') || errorMessage.includes('Forbidden')) {
|
|
105
|
-
throw new McpError(McpErrorCode.InvalidParams, `Access denied to update repository '${params.repository}' for author '${author}'. You may not have permission to modify this repository.`);
|
|
106
|
-
}
|
|
107
|
-
if (errorMessage.includes('validation') || errorMessage.includes('invalid')) {
|
|
108
|
-
throw new McpError(McpErrorCode.InvalidParams, `Repository update failed due to validation error: ${errorMessage}`);
|
|
109
|
-
}
|
|
110
|
-
// Generic error
|
|
111
|
-
throw new McpError(McpErrorCode.InternalError, `Failed to update repository: ${errorMessage}`);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
//# sourceMappingURL=UpdateRepositoryTool.js.map
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ListConnectionsTool
|
|
3
|
-
* List all external connections available to the user
|
|
4
|
-
*/
|
|
5
|
-
import { BaseToolController } from '../base/BaseToolController.js';
|
|
6
|
-
import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
|
|
7
|
-
import { ILogger } from '../../interfaces/ILogger.js';
|
|
8
|
-
export declare class ListConnectionsTool extends BaseToolController {
|
|
9
|
-
constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
|
|
10
|
-
get name(): string;
|
|
11
|
-
get description(): string;
|
|
12
|
-
get inputSchema(): any;
|
|
13
|
-
protected validateParams(params: any): void;
|
|
14
|
-
protected handleExecute(params: {
|
|
15
|
-
limit?: number;
|
|
16
|
-
offset?: number;
|
|
17
|
-
}): Promise<any>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=SharePointListConnectionsTool.d.ts.map
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ListConnectionsTool
|
|
3
|
-
* List all external connections available to the user
|
|
4
|
-
*/
|
|
5
|
-
import { BaseToolController } from '../base/BaseToolController.js';
|
|
6
|
-
import { McpError, McpErrorCode } from '../../utils/McpErrorHandler.js';
|
|
7
|
-
export class ListConnectionsTool extends BaseToolController {
|
|
8
|
-
constructor(ucmClient, logger, publishingAuthorId) {
|
|
9
|
-
super(ucmClient, logger, publishingAuthorId);
|
|
10
|
-
}
|
|
11
|
-
get name() {
|
|
12
|
-
return 'ucm_connection_list';
|
|
13
|
-
}
|
|
14
|
-
get description() {
|
|
15
|
-
return 'List all External connections including SharePoint available to the user. Returns connection details, use this to discover available connections before searching or browsing.';
|
|
16
|
-
}
|
|
17
|
-
get inputSchema() {
|
|
18
|
-
return {
|
|
19
|
-
type: 'object',
|
|
20
|
-
properties: {
|
|
21
|
-
limit: {
|
|
22
|
-
type: 'number',
|
|
23
|
-
description: 'Maximum number of connections to return (default: 20, max: 100)',
|
|
24
|
-
minimum: 1,
|
|
25
|
-
maximum: 100
|
|
26
|
-
},
|
|
27
|
-
offset: {
|
|
28
|
-
type: 'number',
|
|
29
|
-
description: 'Number of connections to skip for pagination (default: 0)',
|
|
30
|
-
minimum: 0
|
|
31
|
-
}
|
|
32
|
-
},
|
|
33
|
-
required: []
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
validateParams(params) {
|
|
37
|
-
super.validateParams(params);
|
|
38
|
-
// Validate limit if provided
|
|
39
|
-
if (params.limit !== undefined) {
|
|
40
|
-
if (typeof params.limit !== 'number' || params.limit < 1 || params.limit > 100) {
|
|
41
|
-
throw new McpError(McpErrorCode.InvalidParams, 'Limit must be a number between 1 and 100');
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
// Validate offset if provided
|
|
45
|
-
if (params.offset !== undefined) {
|
|
46
|
-
if (typeof params.offset !== 'number' || params.offset < 0) {
|
|
47
|
-
throw new McpError(McpErrorCode.InvalidParams, 'Offset must be a number greater than or equal to 0');
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
async handleExecute(params) {
|
|
52
|
-
this.logger.info('ListConnectionsTool', `Listing external connections (limit: ${params.limit || 20}, offset: ${params.offset || 0})`);
|
|
53
|
-
try {
|
|
54
|
-
// Get organizationId from auth ticket (via UcmApiClient)
|
|
55
|
-
// Call API to list connections with pagination params
|
|
56
|
-
const result = await this.ucmClient.listExternalConnections({
|
|
57
|
-
limit: params.limit,
|
|
58
|
-
offset: params.offset
|
|
59
|
-
});
|
|
60
|
-
this.logger.info('listConnections', 'Connections retrieved successfully', '', {
|
|
61
|
-
contentLength: result.length,
|
|
62
|
-
source: 'UCM API /api/v1/connections'
|
|
63
|
-
});
|
|
64
|
-
return result;
|
|
65
|
-
}
|
|
66
|
-
catch (error) {
|
|
67
|
-
// Sanitize error for logging to avoid circular reference issues
|
|
68
|
-
const sanitizedError = {
|
|
69
|
-
message: error?.message,
|
|
70
|
-
status: error?.response?.status,
|
|
71
|
-
data: error?.response?.data
|
|
72
|
-
};
|
|
73
|
-
this.logger.error('ListConnectionsTool', 'Failed to list connections', '', sanitizedError);
|
|
74
|
-
if (error instanceof McpError) {
|
|
75
|
-
throw error;
|
|
76
|
-
}
|
|
77
|
-
// Handle API errors
|
|
78
|
-
if (error.response) {
|
|
79
|
-
const status = error.response.status;
|
|
80
|
-
const errorData = error.response.data;
|
|
81
|
-
if (status === 401 || status === 403) {
|
|
82
|
-
throw new McpError(McpErrorCode.InvalidRequest, `Access denied: ${errorData?.message || 'Not authorized to list SharePoint connections'}`);
|
|
83
|
-
}
|
|
84
|
-
throw new McpError(McpErrorCode.InternalError, `API error: ${errorData?.message || error.message}`);
|
|
85
|
-
}
|
|
86
|
-
throw new McpError(McpErrorCode.InternalError, `Failed to list external connections: ${error.message}`);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=SharePointListConnectionsTool.js.map
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* SharePointListFoldersTool
|
|
3
|
-
* List folders in SharePoint document library
|
|
4
|
-
*/
|
|
5
|
-
import { BaseToolController } from '../base/BaseToolController.js';
|
|
6
|
-
import { UcmLocalApiClient } from '../../clients/UcmLocalApiClient.js';
|
|
7
|
-
import { ILogger } from '../../interfaces/ILogger.js';
|
|
8
|
-
export declare class SharePointListFoldersTool extends BaseToolController {
|
|
9
|
-
constructor(ucmClient: UcmLocalApiClient, logger: ILogger, publishingAuthorId?: string);
|
|
10
|
-
get name(): string;
|
|
11
|
-
get description(): string;
|
|
12
|
-
get inputSchema(): any;
|
|
13
|
-
protected validateParams(params: any): void;
|
|
14
|
-
protected handleExecute(params: {
|
|
15
|
-
connectionId: string;
|
|
16
|
-
folderPath?: string;
|
|
17
|
-
limit?: number;
|
|
18
|
-
offset?: number;
|
|
19
|
-
}): Promise<any>;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=SharePointListFoldersTool.d.ts.map
|