@cplace/test-mcp-server 0.1.14 → 1.0.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/README.md +275 -75
- package/dist/api.d.ts +4 -0
- package/dist/api.d.ts.map +1 -1
- package/dist/api.js.map +1 -1
- package/dist/conditional-registration.d.ts.map +1 -1
- package/dist/conditional-registration.js +21 -3
- package/dist/conditional-registration.js.map +1 -1
- package/dist/index.js +82 -99
- package/dist/index.js.map +1 -1
- package/dist/preference-file.d.ts +16 -0
- package/dist/preference-file.d.ts.map +1 -0
- package/dist/preference-file.js +133 -0
- package/dist/preference-file.js.map +1 -0
- package/dist/profiles.d.ts +1 -3
- package/dist/profiles.d.ts.map +1 -1
- package/dist/profiles.js +60 -107
- package/dist/profiles.js.map +1 -1
- package/dist/searchConversion.d.ts.map +1 -1
- package/dist/searchConversion.js +18 -5
- package/dist/searchConversion.js.map +1 -1
- package/dist/searchSchema.d.ts +25 -25
- package/dist/searchSchema.d.ts.map +1 -1
- package/dist/searchSchema.js +5 -5
- package/dist/searchSchema.js.map +1 -1
- package/dist/token-hashing.d.ts +3 -0
- package/dist/token-hashing.d.ts.map +1 -0
- package/dist/token-hashing.js +18 -0
- package/dist/token-hashing.js.map +1 -0
- package/dist/tool-metadata.d.ts +2 -0
- package/dist/tool-metadata.d.ts.map +1 -0
- package/dist/tool-metadata.js +43 -0
- package/dist/tool-metadata.js.map +1 -0
- package/dist/tools/change-listeners.d.ts +30 -0
- package/dist/tools/change-listeners.d.ts.map +1 -1
- package/dist/tools/change-listeners.js +24 -18
- package/dist/tools/change-listeners.js.map +1 -1
- package/dist/tools/common-schemas.d.ts +2 -0
- package/dist/tools/common-schemas.d.ts.map +1 -1
- package/dist/tools/common-schemas.js +16 -0
- package/dist/tools/common-schemas.js.map +1 -1
- package/dist/tools/csv-export.d.ts +1849 -0
- package/dist/tools/csv-export.d.ts.map +1 -0
- package/dist/tools/csv-export.js +61 -0
- package/dist/tools/csv-export.js.map +1 -0
- package/dist/tools/generic-layouts.d.ts +332 -0
- package/dist/tools/generic-layouts.d.ts.map +1 -0
- package/dist/tools/generic-layouts.js +490 -0
- package/dist/tools/generic-layouts.js.map +1 -0
- package/dist/tools/get-operations.d.ts +16 -0
- package/dist/tools/get-operations.d.ts.map +1 -0
- package/dist/tools/get-operations.js +63 -0
- package/dist/tools/get-operations.js.map +1 -0
- package/dist/tools/pages.d.ts +55 -0
- package/dist/tools/pages.d.ts.map +1 -1
- package/dist/tools/pages.js +217 -209
- package/dist/tools/pages.js.map +1 -1
- package/dist/tools/ppt-export-schemas.d.ts +16 -16
- package/dist/tools/ppt-export.d.ts +1493 -0
- package/dist/tools/ppt-export.d.ts.map +1 -1
- package/dist/tools/ppt-export.js +23 -17
- package/dist/tools/ppt-export.js.map +1 -1
- package/dist/tools/profile-management.d.ts +20 -0
- package/dist/tools/profile-management.d.ts.map +1 -0
- package/dist/tools/profile-management.js +250 -0
- package/dist/tools/profile-management.js.map +1 -0
- package/dist/tools/references.d.ts +36 -0
- package/dist/tools/references.d.ts.map +1 -1
- package/dist/tools/references.js +48 -45
- package/dist/tools/references.js.map +1 -1
- package/dist/tools/richstring-widgets.d.ts +51 -0
- package/dist/tools/richstring-widgets.d.ts.map +1 -0
- package/dist/tools/richstring-widgets.js +173 -0
- package/dist/tools/richstring-widgets.js.map +1 -0
- package/dist/tools/schedule.d.ts +14 -0
- package/dist/tools/schedule.d.ts.map +1 -1
- package/dist/tools/schedule.js +7 -3
- package/dist/tools/schedule.js.map +1 -1
- package/dist/tools/script-logs.d.ts +29 -0
- package/dist/tools/script-logs.d.ts.map +1 -0
- package/dist/tools/script-logs.js +144 -0
- package/dist/tools/script-logs.js.map +1 -0
- package/dist/tools/search.d.ts +1870 -0
- package/dist/tools/search.d.ts.map +1 -1
- package/dist/tools/search.js +49 -75
- package/dist/tools/search.js.map +1 -1
- package/dist/tools/system.d.ts +2 -1
- package/dist/tools/system.d.ts.map +1 -1
- package/dist/tools/system.js +68 -2
- package/dist/tools/system.js.map +1 -1
- package/dist/tools/type-layouts.d.ts +37 -0
- package/dist/tools/type-layouts.d.ts.map +1 -1
- package/dist/tools/type-layouts.js +57 -11
- package/dist/tools/type-layouts.js.map +1 -1
- package/dist/tools/type-management.d.ts +134 -0
- package/dist/tools/type-management.d.ts.map +1 -0
- package/dist/tools/{workspace.js → type-management.js} +67 -307
- package/dist/tools/type-management.js.map +1 -0
- package/dist/tools/users.d.ts +19 -0
- package/dist/tools/users.d.ts.map +1 -1
- package/dist/tools/users.js +14 -28
- package/dist/tools/users.js.map +1 -1
- package/dist/tools/validators.d.ts +28 -0
- package/dist/tools/validators.d.ts.map +1 -1
- package/dist/tools/validators.js +21 -15
- package/dist/tools/validators.js.map +1 -1
- package/dist/tools/version-check.d.ts +4 -0
- package/dist/tools/version-check.d.ts.map +1 -0
- package/dist/tools/version-check.js +107 -0
- package/dist/tools/version-check.js.map +1 -0
- package/dist/tools/version-history.d.ts +48 -0
- package/dist/tools/version-history.d.ts.map +1 -1
- package/dist/tools/version-history.js +39 -29
- package/dist/tools/version-history.js.map +1 -1
- package/dist/tools/widgets.d.ts +182 -0
- package/dist/tools/widgets.d.ts.map +1 -1
- package/dist/tools/widgets.js +213 -590
- package/dist/tools/widgets.js.map +1 -1
- package/dist/tools/workflow-scripts.d.ts +40 -0
- package/dist/tools/workflow-scripts.d.ts.map +1 -0
- package/dist/tools/workflow-scripts.js +186 -0
- package/dist/tools/workflow-scripts.js.map +1 -0
- package/dist/tools/workflow.d.ts +70 -0
- package/dist/tools/workflow.d.ts.map +1 -0
- package/dist/tools/workflow.js +259 -0
- package/dist/tools/workflow.js.map +1 -0
- package/dist/tools/workspace-admin.d.ts +40 -0
- package/dist/tools/workspace-admin.d.ts.map +1 -0
- package/dist/tools/workspace-admin.js +125 -0
- package/dist/tools/workspace-admin.js.map +1 -0
- package/dist/tools/workspace-core.d.ts +45 -0
- package/dist/tools/workspace-core.d.ts.map +1 -0
- package/dist/tools/workspace-core.js +153 -0
- package/dist/tools/workspace-core.js.map +1 -0
- package/dist/types.d.ts +3 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/url-parsing.d.ts +6 -0
- package/dist/url-parsing.d.ts.map +1 -0
- package/dist/url-parsing.js +25 -0
- package/dist/url-parsing.js.map +1 -0
- package/dist/utils/dateValidation.d.ts +5 -0
- package/dist/utils/dateValidation.d.ts.map +1 -0
- package/dist/utils/dateValidation.js +57 -0
- package/dist/utils/dateValidation.js.map +1 -0
- package/dist/utils.js +7 -7
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
- package/dist/tools/workspace.d.ts +0 -4
- package/dist/tools/workspace.d.ts.map +0 -1
- package/dist/tools/workspace.js.map +0 -1
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { CplaceApiClient } from '../api.js';
|
|
4
|
+
export declare const TYPE_MANAGEMENT_TOOL_DEFINITIONS: {
|
|
5
|
+
readonly cplace_manage_type_definition: {
|
|
6
|
+
readonly description: "Create or update type definitions in a workspace with comprehensive configuration options. All properties from the enhanced read endpoint are available for both creation and updates to enable complete type configuration.";
|
|
7
|
+
readonly inputSchema: {
|
|
8
|
+
readonly operation: z.ZodEnum<["create", "update"]>;
|
|
9
|
+
readonly workspaceId: z.ZodOptional<z.ZodString>;
|
|
10
|
+
readonly typeInternalName: z.ZodOptional<z.ZodString>;
|
|
11
|
+
readonly localizedNames: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
12
|
+
readonly localizedPlural: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
13
|
+
readonly description: z.ZodOptional<z.ZodString>;
|
|
14
|
+
readonly showInExplorer: z.ZodOptional<z.ZodBoolean>;
|
|
15
|
+
readonly readers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
16
|
+
readonly writers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
17
|
+
readonly readersAreDefault: z.ZodOptional<z.ZodBoolean>;
|
|
18
|
+
readonly writersAreDefault: z.ZodOptional<z.ZodBoolean>;
|
|
19
|
+
readonly editorsMayDeletePages: z.ZodOptional<z.ZodBoolean>;
|
|
20
|
+
readonly showNewButton: z.ZodOptional<z.ZodBoolean>;
|
|
21
|
+
readonly showInGlobalNewDialog: z.ZodOptional<z.ZodBoolean>;
|
|
22
|
+
readonly showInGlobalSearch: z.ZodOptional<z.ZodBoolean>;
|
|
23
|
+
readonly namesAreUnique: z.ZodOptional<z.ZodBoolean>;
|
|
24
|
+
readonly enableIconLink: z.ZodOptional<z.ZodBoolean>;
|
|
25
|
+
readonly hideTabVersions: z.ZodOptional<z.ZodBoolean>;
|
|
26
|
+
readonly allowDivergentLayouts: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
readonly iconName: z.ZodOptional<z.ZodString>;
|
|
28
|
+
readonly nameGenerationPattern: z.ZodOptional<z.ZodString>;
|
|
29
|
+
readonly displayNameGenerationPattern: z.ZodOptional<z.ZodString>;
|
|
30
|
+
readonly autocompleteDetailsPattern: z.ZodOptional<z.ZodString>;
|
|
31
|
+
readonly internalAttributeNamePrefix: z.ZodOptional<z.ZodString>;
|
|
32
|
+
readonly localizedPageNamesMode: z.ZodOptional<z.ZodEnum<["none", "optional", "optional_with_dialog", "mandatory"]>>;
|
|
33
|
+
};
|
|
34
|
+
readonly annotations: {
|
|
35
|
+
readonly title: "Manage Type Definition";
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
readonly cplace_manage_attribute_definition: {
|
|
39
|
+
readonly description: "Create or update attribute definitions within existing type definitions. Supports all major constraint types including string, number, boolean, date, reference, enumeration, and specialized types like rich text and colors. Provides comprehensive configuration options for display properties, validation, and low-code integration.";
|
|
40
|
+
readonly inputSchema: {
|
|
41
|
+
readonly operation: z.ZodEnum<["create", "update"]>;
|
|
42
|
+
readonly workspaceId: z.ZodString;
|
|
43
|
+
readonly typeDefinitionInternalName: z.ZodString;
|
|
44
|
+
readonly attributeName: z.ZodString;
|
|
45
|
+
readonly multiplicity: z.ZodOptional<z.ZodEnum<["exactlyOne", "maximalOne", "atLeastOne", "arbitrary"]>>;
|
|
46
|
+
readonly constraintConfig: z.ZodOptional<z.ZodObject<{
|
|
47
|
+
constraintType: z.ZodEnum<["string", "longString", "richString", "localizedString", "number", "boolean", "date", "color", "reference", "textEnumeration", "numberEnumeration", "dynamicEnumeration", "workflow"]>;
|
|
48
|
+
pattern: z.ZodOptional<z.ZodString>;
|
|
49
|
+
patternErrorMessage: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
50
|
+
precision: z.ZodOptional<z.ZodNumber>;
|
|
51
|
+
suffix: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
52
|
+
specificity: z.ZodOptional<z.ZodEnum<["date", "datetime", "time"]>>;
|
|
53
|
+
withTime: z.ZodOptional<z.ZodBoolean>;
|
|
54
|
+
dateFormat: z.ZodOptional<z.ZodString>;
|
|
55
|
+
targetTypeNames: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
56
|
+
targetEntityKind: z.ZodOptional<z.ZodString>;
|
|
57
|
+
sameWorkspace: z.ZodOptional<z.ZodBoolean>;
|
|
58
|
+
isHierarchy: z.ZodOptional<z.ZodBoolean>;
|
|
59
|
+
inverseRoleName: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
60
|
+
elements: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
61
|
+
value: z.ZodString;
|
|
62
|
+
localizedName: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
63
|
+
icon: z.ZodOptional<z.ZodString>;
|
|
64
|
+
}, "strip", z.ZodTypeAny, {
|
|
65
|
+
value: string;
|
|
66
|
+
localizedName: Record<string, string>;
|
|
67
|
+
icon?: string | undefined;
|
|
68
|
+
}, {
|
|
69
|
+
value: string;
|
|
70
|
+
localizedName: Record<string, string>;
|
|
71
|
+
icon?: string | undefined;
|
|
72
|
+
}>, "many">>;
|
|
73
|
+
providerClass: z.ZodOptional<z.ZodString>;
|
|
74
|
+
providerSimpleName: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
constraintType: "string" | "number" | "boolean" | "workflow" | "longString" | "richString" | "localizedString" | "date" | "color" | "reference" | "textEnumeration" | "numberEnumeration" | "dynamicEnumeration";
|
|
77
|
+
pattern?: string | undefined;
|
|
78
|
+
patternErrorMessage?: Record<string, string> | undefined;
|
|
79
|
+
precision?: number | undefined;
|
|
80
|
+
suffix?: Record<string, string> | undefined;
|
|
81
|
+
specificity?: "date" | "datetime" | "time" | undefined;
|
|
82
|
+
withTime?: boolean | undefined;
|
|
83
|
+
dateFormat?: string | undefined;
|
|
84
|
+
targetTypeNames?: string[] | undefined;
|
|
85
|
+
targetEntityKind?: string | undefined;
|
|
86
|
+
sameWorkspace?: boolean | undefined;
|
|
87
|
+
isHierarchy?: boolean | undefined;
|
|
88
|
+
inverseRoleName?: Record<string, string> | undefined;
|
|
89
|
+
elements?: {
|
|
90
|
+
value: string;
|
|
91
|
+
localizedName: Record<string, string>;
|
|
92
|
+
icon?: string | undefined;
|
|
93
|
+
}[] | undefined;
|
|
94
|
+
providerClass?: string | undefined;
|
|
95
|
+
providerSimpleName?: string | undefined;
|
|
96
|
+
}, {
|
|
97
|
+
constraintType: "string" | "number" | "boolean" | "workflow" | "longString" | "richString" | "localizedString" | "date" | "color" | "reference" | "textEnumeration" | "numberEnumeration" | "dynamicEnumeration";
|
|
98
|
+
pattern?: string | undefined;
|
|
99
|
+
patternErrorMessage?: Record<string, string> | undefined;
|
|
100
|
+
precision?: number | undefined;
|
|
101
|
+
suffix?: Record<string, string> | undefined;
|
|
102
|
+
specificity?: "date" | "datetime" | "time" | undefined;
|
|
103
|
+
withTime?: boolean | undefined;
|
|
104
|
+
dateFormat?: string | undefined;
|
|
105
|
+
targetTypeNames?: string[] | undefined;
|
|
106
|
+
targetEntityKind?: string | undefined;
|
|
107
|
+
sameWorkspace?: boolean | undefined;
|
|
108
|
+
isHierarchy?: boolean | undefined;
|
|
109
|
+
inverseRoleName?: Record<string, string> | undefined;
|
|
110
|
+
elements?: {
|
|
111
|
+
value: string;
|
|
112
|
+
localizedName: Record<string, string>;
|
|
113
|
+
icon?: string | undefined;
|
|
114
|
+
}[] | undefined;
|
|
115
|
+
providerClass?: string | undefined;
|
|
116
|
+
providerSimpleName?: string | undefined;
|
|
117
|
+
}>>;
|
|
118
|
+
readonly localizedNames: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
119
|
+
readonly localizedShortNames: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
120
|
+
readonly localizedShortHelp: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
121
|
+
readonly readOnly: z.ZodOptional<z.ZodBoolean>;
|
|
122
|
+
readonly showInTables: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
readonly showInNewDialog: z.ZodOptional<z.ZodBoolean>;
|
|
124
|
+
readonly showValuesWithLineBreak: z.ZodOptional<z.ZodBoolean>;
|
|
125
|
+
readonly showInAttributesWidget: z.ZodOptional<z.ZodBoolean>;
|
|
126
|
+
readonly showInColumnSelection: z.ZodOptional<z.ZodBoolean>;
|
|
127
|
+
};
|
|
128
|
+
readonly annotations: {
|
|
129
|
+
readonly title: "Manage Attribute Definition";
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
export declare function registerTypeManagementTools(server: McpServer, client: CplaceApiClient): void;
|
|
134
|
+
//# sourceMappingURL=type-management.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-management.d.ts","sourceRoot":"","sources":["../../src/tools/type-management.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAQ5C,eAAO,MAAM,gCAAgC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0GnC,CAAC;AAEX,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QAgNrF"}
|
|
@@ -1,150 +1,14 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import { debugLogWithTag } from "../logger.js";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
inputSchema: {
|
|
8
|
-
limit: z.number().min(1).max(100).optional().describe("Maximum number of workspaces to return (1-100). If not provided, returns all workspaces."),
|
|
9
|
-
offset: z.number().min(0).default(0).describe("Number of workspaces to skip for pagination")
|
|
10
|
-
},
|
|
11
|
-
annotations: { title: "List Workspaces" }
|
|
12
|
-
}, async ({ limit, offset = 0 }) => {
|
|
13
|
-
debugLogWithTag('WORKSPACES', 'Starting workspace list request');
|
|
14
|
-
try {
|
|
15
|
-
const workspaces = await client.makeApiRequest('json/workspaces');
|
|
16
|
-
const filteredWorkspaces = workspaces.map((workspace) => ({
|
|
17
|
-
id: workspace.id,
|
|
18
|
-
name: workspace.name,
|
|
19
|
-
displayName: workspace.displayName,
|
|
20
|
-
totalPages: workspace.totalPages,
|
|
21
|
-
isFavorite: workspace.isFavorite,
|
|
22
|
-
installedApps: workspace.apps?.installed?.map(app => app.name) || []
|
|
23
|
-
}));
|
|
24
|
-
const total = filteredWorkspaces.length;
|
|
25
|
-
const paginatedWorkspaces = limit ? filteredWorkspaces.slice(offset, offset + limit) : filteredWorkspaces.slice(offset);
|
|
26
|
-
const result = {
|
|
27
|
-
results: paginatedWorkspaces,
|
|
28
|
-
pagination: {
|
|
29
|
-
total,
|
|
30
|
-
limit: limit || total,
|
|
31
|
-
offset,
|
|
32
|
-
hasMore: limit ? offset + limit < total : false
|
|
33
|
-
}
|
|
34
|
-
};
|
|
35
|
-
debugLogWithTag('WORKSPACES', `Retrieved ${paginatedWorkspaces.length} workspaces (${offset}-${offset + paginatedWorkspaces.length} of ${total} total)`);
|
|
36
|
-
const sizeCheck = checkResponseSize(result);
|
|
37
|
-
if (sizeCheck.tooLarge) {
|
|
38
|
-
return {
|
|
39
|
-
content: [{ type: "text", text: `Response too large (${sizeCheck.actualSize} characters, max allowed: 45000). Try using the limit parameter to reduce the number of workspaces returned (e.g., limit: 10).` }],
|
|
40
|
-
isError: true
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
return {
|
|
44
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
catch (error) {
|
|
48
|
-
return {
|
|
49
|
-
content: [{ type: "text", text: `Error retrieving workspaces: ${error instanceof Error ? error.message : String(error)}` }],
|
|
50
|
-
isError: true
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
server.registerTool("cplace_list_types", {
|
|
55
|
-
description: "List all types available in a workspace",
|
|
56
|
-
inputSchema: {
|
|
57
|
-
workspaceId: z.string().describe("The ID of the workspace to get types for")
|
|
58
|
-
},
|
|
59
|
-
annotations: { title: "List Types" }
|
|
60
|
-
}, async ({ workspaceId }) => {
|
|
61
|
-
try {
|
|
62
|
-
const workspaces = await client.makeApiRequest('json/workspaces');
|
|
63
|
-
const workspace = workspaces.find((w) => w.id === workspaceId);
|
|
64
|
-
if (workspace) {
|
|
65
|
-
const types = workspace.typeDefinitions?.types || [];
|
|
66
|
-
return {
|
|
67
|
-
content: [{ type: "text", text: JSON.stringify(types, null, 2) }]
|
|
68
|
-
};
|
|
69
|
-
}
|
|
70
|
-
return {
|
|
71
|
-
content: [{ type: "text", text: `Workspace ${workspaceId} not found` }]
|
|
72
|
-
};
|
|
73
|
-
}
|
|
74
|
-
catch (error) {
|
|
75
|
-
return {
|
|
76
|
-
content: [{ type: "text", text: `Error retrieving types: ${error instanceof Error ? error.message : String(error)}` }],
|
|
77
|
-
isError: true
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
server.registerTool("cplace_get_workspace_details", {
|
|
82
|
-
description: "Get comprehensive details about a specific workspace including all metadata, permissions, type definitions (count only), styling, and configuration. Provides access to rootPageId and other fields not available in the list view. For the full list of types, use cplace_list_types.",
|
|
83
|
-
inputSchema: {
|
|
84
|
-
workspaceId: z.string().describe("The ID of the workspace to get details for")
|
|
85
|
-
},
|
|
86
|
-
annotations: { title: "Get Workspace Details" }
|
|
87
|
-
}, async ({ workspaceId }) => {
|
|
88
|
-
debugLogWithTag('WORKSPACES', `Getting details for workspace: ${workspaceId}`);
|
|
89
|
-
try {
|
|
90
|
-
const workspaces = await client.makeApiRequest('json/workspaces');
|
|
91
|
-
const workspace = workspaces.find((w) => w.id === workspaceId);
|
|
92
|
-
if (!workspace) {
|
|
93
|
-
return {
|
|
94
|
-
content: [{ type: "text", text: `Workspace not found: ${workspaceId}` }]
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
debugLogWithTag('WORKSPACES', `Found workspace with rootPageId: ${workspace.rootPageId}`);
|
|
98
|
-
const workspaceDetails = {
|
|
99
|
-
...workspace,
|
|
100
|
-
typeDefinitions: {
|
|
101
|
-
count: workspace.typeDefinitions?.count || 0
|
|
102
|
-
}
|
|
103
|
-
};
|
|
104
|
-
return {
|
|
105
|
-
content: [{ type: "text", text: JSON.stringify(workspaceDetails, null, 2) }]
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
catch (error) {
|
|
109
|
-
return {
|
|
110
|
-
content: [{ type: "text", text: `Error retrieving workspace details: ${error instanceof Error ? error.message : String(error)}` }],
|
|
111
|
-
isError: true
|
|
112
|
-
};
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
server.registerTool("cplace_get_type_datamodel", {
|
|
116
|
-
description: "Get the datamodel of a type including its attributes, constraints, and permissions. Use this before performing a search to understand the type structure.",
|
|
117
|
-
inputSchema: {
|
|
118
|
-
workspaceId: z.string().describe("The ID of the workspace"),
|
|
119
|
-
internalName: z.string().describe("The internal name of the type")
|
|
120
|
-
},
|
|
121
|
-
annotations: { title: "Get Type Details" }
|
|
122
|
-
}, async ({ workspaceId, internalName }) => {
|
|
123
|
-
try {
|
|
124
|
-
const result = await client.makeApiRequest('json/type-definition', 'GET', {
|
|
125
|
-
workspaceId,
|
|
126
|
-
internalName
|
|
127
|
-
});
|
|
128
|
-
if (result && result.attributes) {
|
|
129
|
-
result.attributes = transformMultiplicityToBoolean(result.attributes);
|
|
130
|
-
}
|
|
131
|
-
return {
|
|
132
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
133
|
-
};
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
return {
|
|
137
|
-
content: [{ type: "text", text: `Error retrieving type details: ${error instanceof Error ? error.message : String(error)}` }],
|
|
138
|
-
isError: true
|
|
139
|
-
};
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
server.registerTool("cplace_manage_type_definition", {
|
|
3
|
+
const TOOL_MANAGE_TYPE_DEFINITION = 'cplace_manage_type_definition';
|
|
4
|
+
const TOOL_MANAGE_ATTRIBUTE_DEFINITION = 'cplace_manage_attribute_definition';
|
|
5
|
+
export const TYPE_MANAGEMENT_TOOL_DEFINITIONS = {
|
|
6
|
+
[TOOL_MANAGE_TYPE_DEFINITION]: {
|
|
143
7
|
description: "Create or update type definitions in a workspace with comprehensive configuration options. All properties from the enhanced read endpoint are available for both creation and updates to enable complete type configuration.",
|
|
144
8
|
inputSchema: {
|
|
145
9
|
operation: z.enum(["create", "update"]).describe("Operation type: 'create' for new type definitions, 'update' for existing type definitions"),
|
|
146
10
|
workspaceId: z.string().optional().describe("Required for both: Target workspace ID (e.g., 'abc123')"),
|
|
147
|
-
typeInternalName: z.string().optional().describe("
|
|
11
|
+
typeInternalName: z.string().optional().describe("Type internal name (e.g., 'cf.example.myType') - no trailing dot"),
|
|
148
12
|
localizedNames: z.record(z.string()).optional().describe("Localized type names (singular) - e.g., {\"en\": \"My Type\", \"de\": \"Mein Typ\"}"),
|
|
149
13
|
localizedPlural: z.record(z.string()).optional().describe("Localized type names (plural) - e.g., {\"en\": \"My Types\", \"de\": \"Meine Typen\"}"),
|
|
150
14
|
description: z.string().optional().describe("Type description"),
|
|
@@ -162,14 +26,63 @@ export function registerWorkspaceTools(server, client) {
|
|
|
162
26
|
hideTabVersions: z.boolean().optional().describe("Hide versions tab (default: false for create)"),
|
|
163
27
|
allowDivergentLayouts: z.boolean().optional().describe("Allow different layouts per page (default: false for create)"),
|
|
164
28
|
iconName: z.string().optional().describe("FontAwesome icon name (e.g., 'fa-project', 'fa-list') or visual icon identifier for update"),
|
|
165
|
-
nameGenerationPattern: z.string().optional().describe("Create only: Auto-naming pattern
|
|
166
|
-
displayNameGenerationPattern: z.string().optional().describe("Create only: Display name pattern (
|
|
29
|
+
nameGenerationPattern: z.string().optional().describe("Create only: Auto-naming pattern for pages of this type. When configured, page names can be auto-generated during creation. Pattern syntax: <attributeName> for attribute values, {###} for sequential counter, {0000} for zero-padded counter. Examples: 'PROJ-{###}' generates PROJ-1, PROJ-2, etc. '<title>-{0000}' generates 'ProjectAlpha-0001'. Pages can still override with explicit names. Leave empty to require explicit names."),
|
|
30
|
+
displayNameGenerationPattern: z.string().optional().describe("Create only: Display name pattern for UI representation. Uses same syntax as nameGenerationPattern (see above). Display name shown in UI, separate from internal page name."),
|
|
167
31
|
autocompleteDetailsPattern: z.string().optional().describe("Create only: Autocomplete format (e.g., '{name}: {description}')"),
|
|
168
32
|
internalAttributeNamePrefix: z.string().optional().describe("Prefix for attribute names (e.g., 'cf.mycompany.risk' - no trailing dot)"),
|
|
169
33
|
localizedPageNamesMode: z.enum(["none", "optional", "optional_with_dialog", "mandatory"]).optional().describe("Localized naming mode")
|
|
170
34
|
},
|
|
171
35
|
annotations: { title: "Manage Type Definition" }
|
|
172
|
-
},
|
|
36
|
+
},
|
|
37
|
+
[TOOL_MANAGE_ATTRIBUTE_DEFINITION]: {
|
|
38
|
+
description: "Create or update attribute definitions within existing type definitions. Supports all major constraint types including string, number, boolean, date, reference, enumeration, and specialized types like rich text and colors. Provides comprehensive configuration options for display properties, validation, and low-code integration.",
|
|
39
|
+
inputSchema: {
|
|
40
|
+
operation: z.enum(["create", "update"]).describe("Operation type: 'create' for new attribute definitions, 'update' for existing attribute definitions"),
|
|
41
|
+
workspaceId: z.string().describe("Target workspace ID (e.g., 'abc123')"),
|
|
42
|
+
typeDefinitionInternalName: z.string().describe("Target type internal name (e.g., 'cf.example.myType')"),
|
|
43
|
+
attributeName: z.string().describe("For create: attribute name without prefix (e.g., 'myAttribute'). For update: attribute name to update (e.g., 'myAttribute')"),
|
|
44
|
+
multiplicity: z.enum(["exactlyOne", "maximalOne", "atLeastOne", "arbitrary"]).optional().describe("Required for create: Attribute multiplicity. Optional for update."),
|
|
45
|
+
constraintConfig: z.object({
|
|
46
|
+
constraintType: z.enum([
|
|
47
|
+
"string", "longString", "richString", "localizedString",
|
|
48
|
+
"number", "boolean", "date", "color", "reference",
|
|
49
|
+
"textEnumeration", "numberEnumeration", "dynamicEnumeration", "workflow"
|
|
50
|
+
]).describe("Constraint type"),
|
|
51
|
+
pattern: z.string().optional().describe("Regex pattern for string validation"),
|
|
52
|
+
patternErrorMessage: z.record(z.string()).optional().describe("Localized error messages for pattern validation"),
|
|
53
|
+
precision: z.number().optional().describe("Decimal precision (-1 for unlimited)"),
|
|
54
|
+
suffix: z.record(z.string()).optional().describe("Localized suffix text"),
|
|
55
|
+
specificity: z.enum(["date", "datetime", "time"]).optional().describe("Date specificity"),
|
|
56
|
+
withTime: z.boolean().optional().describe("Include time component"),
|
|
57
|
+
dateFormat: z.string().optional().describe("Display format"),
|
|
58
|
+
targetTypeNames: z.array(z.string()).optional().describe("Target type internal names"),
|
|
59
|
+
targetEntityKind: z.string().optional().describe("Target entity kind"),
|
|
60
|
+
sameWorkspace: z.boolean().optional().describe("Restrict to same workspace"),
|
|
61
|
+
isHierarchy: z.boolean().optional().describe("Whether this is a hierarchical reference"),
|
|
62
|
+
inverseRoleName: z.record(z.string()).optional().describe("Localized inverse role name"),
|
|
63
|
+
elements: z.array(z.object({
|
|
64
|
+
value: z.string().describe("Enumeration value"),
|
|
65
|
+
localizedName: z.record(z.string()).describe("Localized display names"),
|
|
66
|
+
icon: z.string().optional().describe("Optional icon name")
|
|
67
|
+
})).optional().describe("Enumeration elements for textEnumeration/numberEnumeration"),
|
|
68
|
+
providerClass: z.string().optional().describe("Provider class for dynamicEnumeration"),
|
|
69
|
+
providerSimpleName: z.string().optional().describe("Provider simple name for dynamicEnumeration")
|
|
70
|
+
}).optional().describe("Required for create: Constraint configuration object. Optional for update: New constraint configuration object (replaces existing)."),
|
|
71
|
+
localizedNames: z.record(z.string()).optional().describe("Localized attribute names - e.g., {\"en\": \"My Attribute\", \"de\": \"Mein Attribut\"}"),
|
|
72
|
+
localizedShortNames: z.record(z.string()).optional().describe("Localized short names - e.g., {\"en\": \"My Attr\", \"de\": \"Mein Attr\"}"),
|
|
73
|
+
localizedShortHelp: z.record(z.string()).optional().describe("Localized help text - e.g., {\"en\": \"Help text\", \"de\": \"Hilfetext\"}"),
|
|
74
|
+
readOnly: z.boolean().optional().describe("Whether attribute is read-only"),
|
|
75
|
+
showInTables: z.boolean().optional().describe("Show in table views"),
|
|
76
|
+
showInNewDialog: z.boolean().optional().describe("Show in new item dialogs"),
|
|
77
|
+
showValuesWithLineBreak: z.boolean().optional().describe("Display values with line breaks"),
|
|
78
|
+
showInAttributesWidget: z.boolean().optional().describe("Show in attribute widgets"),
|
|
79
|
+
showInColumnSelection: z.boolean().optional().describe("Include in column selection")
|
|
80
|
+
},
|
|
81
|
+
annotations: { title: "Manage Attribute Definition" }
|
|
82
|
+
}
|
|
83
|
+
};
|
|
84
|
+
export function registerTypeManagementTools(server, client) {
|
|
85
|
+
server.registerTool(TOOL_MANAGE_TYPE_DEFINITION, TYPE_MANAGEMENT_TOOL_DEFINITIONS[TOOL_MANAGE_TYPE_DEFINITION], async (params) => {
|
|
173
86
|
try {
|
|
174
87
|
if (params.operation === "create") {
|
|
175
88
|
if (!params.workspaceId || !params.typeInternalName) {
|
|
@@ -292,61 +205,18 @@ export function registerWorkspaceTools(server, client) {
|
|
|
292
205
|
};
|
|
293
206
|
}
|
|
294
207
|
});
|
|
295
|
-
server.registerTool(
|
|
296
|
-
description: "Create or update attribute definitions within existing type definitions. Supports all major constraint types including string, number, boolean, date, reference, enumeration, and specialized types like rich text and colors. Provides comprehensive configuration options for display properties, validation, and low-code integration.",
|
|
297
|
-
inputSchema: {
|
|
298
|
-
operation: z.enum(["create", "update"]).describe("Operation type: 'create' for new attribute definitions, 'update' for existing attribute definitions"),
|
|
299
|
-
typeDefinitionInternalName: z.string().describe("Target type internal name (e.g., 'cf.example.myType')"),
|
|
300
|
-
attributeName: z.string().describe("For create: attribute name without prefix (e.g., 'myAttribute'). For update: attribute name to update (e.g., 'myAttribute')"),
|
|
301
|
-
multiplicity: z.enum(["exactlyOne", "maximalOne", "atLeastOne", "arbitrary"]).optional().describe("Required for create: Attribute multiplicity. Optional for update."),
|
|
302
|
-
constraintConfig: z.object({
|
|
303
|
-
constraintType: z.enum([
|
|
304
|
-
"string", "longString", "richString", "localizedString",
|
|
305
|
-
"number", "boolean", "date", "color", "reference",
|
|
306
|
-
"textEnumeration", "numberEnumeration", "dynamicEnumeration"
|
|
307
|
-
]).describe("Constraint type"),
|
|
308
|
-
pattern: z.string().optional().describe("Regex pattern for string validation"),
|
|
309
|
-
patternErrorMessage: z.record(z.string()).optional().describe("Localized error messages for pattern validation"),
|
|
310
|
-
precision: z.number().optional().describe("Decimal precision (-1 for unlimited)"),
|
|
311
|
-
suffix: z.record(z.string()).optional().describe("Localized suffix text"),
|
|
312
|
-
specificity: z.enum(["date", "datetime", "time"]).optional().describe("Date specificity"),
|
|
313
|
-
withTime: z.boolean().optional().describe("Include time component"),
|
|
314
|
-
dateFormat: z.string().optional().describe("Display format"),
|
|
315
|
-
targetTypeNames: z.array(z.string()).optional().describe("Target type internal names"),
|
|
316
|
-
targetEntityKind: z.string().optional().describe("Target entity kind"),
|
|
317
|
-
sameWorkspace: z.boolean().optional().describe("Restrict to same workspace"),
|
|
318
|
-
isHierarchy: z.boolean().optional().describe("Whether this is a hierarchical reference"),
|
|
319
|
-
inverseRoleName: z.record(z.string()).optional().describe("Localized inverse role name"),
|
|
320
|
-
elements: z.array(z.object({
|
|
321
|
-
value: z.string().describe("Enumeration value"),
|
|
322
|
-
localizedName: z.record(z.string()).describe("Localized display names"),
|
|
323
|
-
icon: z.string().optional().describe("Optional icon name")
|
|
324
|
-
})).optional().describe("Enumeration elements for textEnumeration/numberEnumeration"),
|
|
325
|
-
providerClass: z.string().optional().describe("Provider class for dynamicEnumeration"),
|
|
326
|
-
providerSimpleName: z.string().optional().describe("Provider simple name for dynamicEnumeration")
|
|
327
|
-
}).optional().describe("Required for create: Constraint configuration object. Optional for update: New constraint configuration object (replaces existing)."),
|
|
328
|
-
localizedNames: z.record(z.string()).optional().describe("Localized attribute names - e.g., {\"en\": \"My Attribute\", \"de\": \"Mein Attribut\"}"),
|
|
329
|
-
localizedShortNames: z.record(z.string()).optional().describe("Localized short names - e.g., {\"en\": \"My Attr\", \"de\": \"Mein Attr\"}"),
|
|
330
|
-
localizedShortHelp: z.record(z.string()).optional().describe("Localized help text - e.g., {\"en\": \"Help text\", \"de\": \"Hilfetext\"}"),
|
|
331
|
-
readOnly: z.boolean().optional().describe("Whether attribute is read-only"),
|
|
332
|
-
showInTables: z.boolean().optional().describe("Show in table views"),
|
|
333
|
-
showInNewDialog: z.boolean().optional().describe("Show in new item dialogs"),
|
|
334
|
-
showValuesWithLineBreak: z.boolean().optional().describe("Display values with line breaks"),
|
|
335
|
-
showInAttributesWidget: z.boolean().optional().describe("Show in attribute widgets"),
|
|
336
|
-
showInColumnSelection: z.boolean().optional().describe("Include in column selection")
|
|
337
|
-
},
|
|
338
|
-
annotations: { title: "Manage Attribute Definition" }
|
|
339
|
-
}, async (params) => {
|
|
208
|
+
server.registerTool(TOOL_MANAGE_ATTRIBUTE_DEFINITION, TYPE_MANAGEMENT_TOOL_DEFINITIONS[TOOL_MANAGE_ATTRIBUTE_DEFINITION], async (params) => {
|
|
340
209
|
try {
|
|
341
210
|
if (params.operation === "create") {
|
|
342
|
-
if (!params.typeDefinitionInternalName || !params.attributeName || !params.multiplicity || !params.constraintConfig) {
|
|
211
|
+
if (!params.workspaceId || !params.typeDefinitionInternalName || !params.attributeName || !params.multiplicity || !params.constraintConfig) {
|
|
343
212
|
return {
|
|
344
|
-
content: [{ type: "text", text: "Error: Create operation requires typeDefinitionInternalName, attributeName, multiplicity, and constraintConfig parameters" }],
|
|
213
|
+
content: [{ type: "text", text: "Error: Create operation requires workspaceId, typeDefinitionInternalName, attributeName, multiplicity, and constraintConfig parameters" }],
|
|
345
214
|
isError: true
|
|
346
215
|
};
|
|
347
216
|
}
|
|
348
|
-
debugLogWithTag('ATTRIBUTE_CREATION', `Creating attribute: ${params.attributeName} for type: ${params.typeDefinitionInternalName}`);
|
|
217
|
+
debugLogWithTag('ATTRIBUTE_CREATION', `Creating attribute: ${params.attributeName} for type: ${params.typeDefinitionInternalName} in workspace: ${params.workspaceId}`);
|
|
349
218
|
const requestBody = {
|
|
219
|
+
workspaceId: params.workspaceId,
|
|
350
220
|
typeDefinitionInternalName: params.typeDefinitionInternalName,
|
|
351
221
|
attributeName: params.attributeName,
|
|
352
222
|
multiplicity: params.multiplicity,
|
|
@@ -377,14 +247,15 @@ export function registerWorkspaceTools(server, client) {
|
|
|
377
247
|
};
|
|
378
248
|
}
|
|
379
249
|
else {
|
|
380
|
-
if (!params.typeDefinitionInternalName || !params.attributeName) {
|
|
250
|
+
if (!params.workspaceId || !params.typeDefinitionInternalName || !params.attributeName) {
|
|
381
251
|
return {
|
|
382
|
-
content: [{ type: "text", text: "Error: Update operation requires typeDefinitionInternalName and attributeName parameters" }],
|
|
252
|
+
content: [{ type: "text", text: "Error: Update operation requires workspaceId, typeDefinitionInternalName and attributeName parameters" }],
|
|
383
253
|
isError: true
|
|
384
254
|
};
|
|
385
255
|
}
|
|
386
|
-
debugLogWithTag('ATTRIBUTE_UPDATE', `Updating attribute: ${params.attributeName} for type: ${params.typeDefinitionInternalName}`);
|
|
256
|
+
debugLogWithTag('ATTRIBUTE_UPDATE', `Updating attribute: ${params.attributeName} for type: ${params.typeDefinitionInternalName} in workspace: ${params.workspaceId}`);
|
|
387
257
|
const requestBody = {
|
|
258
|
+
workspaceId: params.workspaceId,
|
|
388
259
|
typeDefinitionInternalName: params.typeDefinitionInternalName,
|
|
389
260
|
attributeName: params.attributeName
|
|
390
261
|
};
|
|
@@ -429,116 +300,5 @@ export function registerWorkspaceTools(server, client) {
|
|
|
429
300
|
};
|
|
430
301
|
}
|
|
431
302
|
});
|
|
432
|
-
server.registerTool("cplace_create_workspace", {
|
|
433
|
-
description: "Create a new workspace (PageSpace) with specified configuration including name, permissions, and apps. Requires global CREATE_PAGE_SPACE permission.",
|
|
434
|
-
inputSchema: {
|
|
435
|
-
name: z.string().describe("Required: Internal workspace name (must be unique across the system)"),
|
|
436
|
-
administratorUids: z.array(z.string()).optional().describe("Optional: List of administrator principal UIDs (e.g., ['person/user123', 'person/admin456']). Defaults to current user if not provided."),
|
|
437
|
-
readerUids: z.array(z.string()).optional().describe("Optional: List of reader principal UIDs (e.g., ['person/reader789'])"),
|
|
438
|
-
writerUids: z.array(z.string()).optional().describe("Optional: List of writer principal UIDs (e.g., ['person/writer456'])"),
|
|
439
|
-
layouterUids: z.array(z.string()).optional().describe("Optional: List of layouter principal UIDs (e.g., ['person/layouter123'])"),
|
|
440
|
-
apps: z.array(z.string()).optional().describe("Optional: List of app qualified names to install (e.g., ['cf.cplace.solution.safe', 'cf.cplace.solution.ppm']). Apps are installed best-effort - incompatible apps are skipped with warnings.")
|
|
441
|
-
},
|
|
442
|
-
annotations: { title: "Create Workspace" }
|
|
443
|
-
}, async ({ name, administratorUids, readerUids, writerUids, layouterUids, apps }) => {
|
|
444
|
-
debugLogWithTag('WORKSPACES', `Creating workspace: ${name}`);
|
|
445
|
-
try {
|
|
446
|
-
const requestBody = { name };
|
|
447
|
-
if (administratorUids)
|
|
448
|
-
requestBody.administratorUids = administratorUids;
|
|
449
|
-
if (readerUids)
|
|
450
|
-
requestBody.readerUids = readerUids;
|
|
451
|
-
if (writerUids)
|
|
452
|
-
requestBody.writerUids = writerUids;
|
|
453
|
-
if (layouterUids)
|
|
454
|
-
requestBody.layouterUids = layouterUids;
|
|
455
|
-
if (apps)
|
|
456
|
-
requestBody.apps = apps;
|
|
457
|
-
const result = await client.makeApiRequest('json/workspace/create', 'POST', undefined, requestBody);
|
|
458
|
-
debugLogWithTag('WORKSPACES', `Successfully created workspace: ${name} with ID: ${result.result?.workspaceId}`);
|
|
459
|
-
return {
|
|
460
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
catch (error) {
|
|
464
|
-
debugLogWithTag('WORKSPACES', `Error creating workspace ${name}: ${error instanceof Error ? error.message : String(error)}`);
|
|
465
|
-
return {
|
|
466
|
-
content: [{ type: "text", text: `Error creating workspace: ${error instanceof Error ? error.message : String(error)}` }],
|
|
467
|
-
isError: true
|
|
468
|
-
};
|
|
469
|
-
}
|
|
470
|
-
});
|
|
471
|
-
server.registerTool("cplace_list_workspace_apps", {
|
|
472
|
-
description: "Get comprehensive information about applications within a workspace, including installed apps, available apps for installation, dependency information, and compatibility status",
|
|
473
|
-
inputSchema: {
|
|
474
|
-
workspaceId: z.string().describe("The ID of the workspace to query for apps (e.g., 'abc123')")
|
|
475
|
-
},
|
|
476
|
-
annotations: { title: "List Workspace Apps" }
|
|
477
|
-
}, async ({ workspaceId }) => {
|
|
478
|
-
debugLogWithTag('WORKSPACES', `Getting apps for workspace: ${workspaceId}`);
|
|
479
|
-
try {
|
|
480
|
-
const result = await client.makeApiRequest('json/apps', 'GET', { workspaceId });
|
|
481
|
-
debugLogWithTag('WORKSPACES', `Retrieved apps data for workspace ${workspaceId}`);
|
|
482
|
-
debugLogWithTag('WORKSPACES', `Installed apps: ${result.result?.installed?.length || 0}, Available apps: ${result.result?.available?.length || 0}`);
|
|
483
|
-
const sizeCheck = checkResponseSize(result);
|
|
484
|
-
if (sizeCheck.tooLarge) {
|
|
485
|
-
return {
|
|
486
|
-
content: [{ type: "text", text: `Response too large (${sizeCheck.actualSize} characters, max allowed: 45000). The apps data for this workspace is too large to display. Consider using the workspace details tool for basic app information.` }],
|
|
487
|
-
isError: true
|
|
488
|
-
};
|
|
489
|
-
}
|
|
490
|
-
return {
|
|
491
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
492
|
-
};
|
|
493
|
-
}
|
|
494
|
-
catch (error) {
|
|
495
|
-
debugLogWithTag('WORKSPACES', `Error getting apps for workspace ${workspaceId}: ${error instanceof Error ? error.message : String(error)}`);
|
|
496
|
-
return {
|
|
497
|
-
content: [{ type: "text", text: `Error retrieving workspace apps: ${error instanceof Error ? error.message : String(error)}` }],
|
|
498
|
-
isError: true
|
|
499
|
-
};
|
|
500
|
-
}
|
|
501
|
-
});
|
|
502
|
-
server.registerTool("cplace_install_workspace_app", {
|
|
503
|
-
description: "Install a specific application into a workspace, including automatic dependency resolution. Validates permissions, app compatibility, and automatically installs required dependencies.",
|
|
504
|
-
inputSchema: {
|
|
505
|
-
workspaceId: z.string().describe("The ID of the workspace to install the app in (e.g., 'abc123')"),
|
|
506
|
-
appQualifiedName: z.string().describe("The qualified name of the app to install (e.g., 'cf.cplace.solution.safe')")
|
|
507
|
-
},
|
|
508
|
-
annotations: { title: "Install Workspace App" }
|
|
509
|
-
}, async ({ workspaceId, appQualifiedName }) => {
|
|
510
|
-
debugLogWithTag('WORKSPACES', `Installing app: ${appQualifiedName} in workspace: ${workspaceId}`);
|
|
511
|
-
try {
|
|
512
|
-
const requestBody = {
|
|
513
|
-
workspaceId,
|
|
514
|
-
appQualifiedName
|
|
515
|
-
};
|
|
516
|
-
const result = await client.makeApiRequest('json/install-app', 'POST', undefined, requestBody);
|
|
517
|
-
debugLogWithTag('WORKSPACES', `Successfully installed app: ${appQualifiedName}`);
|
|
518
|
-
const sizeCheck = checkResponseSize(result);
|
|
519
|
-
if (sizeCheck.tooLarge) {
|
|
520
|
-
return {
|
|
521
|
-
content: [{
|
|
522
|
-
type: "text",
|
|
523
|
-
text: `App installed successfully but response too large (${sizeCheck.actualSize} characters, max allowed: 45000). Use cplace_list_workspace_apps to see updated app information.`
|
|
524
|
-
}],
|
|
525
|
-
isError: true
|
|
526
|
-
};
|
|
527
|
-
}
|
|
528
|
-
return {
|
|
529
|
-
content: [{ type: "text", text: JSON.stringify(result, null, 2) }]
|
|
530
|
-
};
|
|
531
|
-
}
|
|
532
|
-
catch (error) {
|
|
533
|
-
debugLogWithTag('WORKSPACES', `Error installing app ${appQualifiedName} in workspace ${workspaceId}: ${error instanceof Error ? error.message : String(error)}`);
|
|
534
|
-
return {
|
|
535
|
-
content: [{
|
|
536
|
-
type: "text",
|
|
537
|
-
text: `Error installing app: ${error instanceof Error ? error.message : String(error)}`
|
|
538
|
-
}],
|
|
539
|
-
isError: true
|
|
540
|
-
};
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
303
|
}
|
|
544
|
-
//# sourceMappingURL=
|
|
304
|
+
//# sourceMappingURL=type-management.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"type-management.js","sourceRoot":"","sources":["../../src/tools/type-management.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AA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YAC9E,eAAe,CAAC,MAAM,CAAC,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,kBAAkB,EAAE,SAAS,aAAa,eAAe,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;YAE1L,OAAO;gBACH,OAAO,EAAE,CAAC;wBACN,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,SAAS,aAAa,0BAA0B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;qBACjH,CAAC;gBACF,OAAO,EAAE,IAAI;aAChB,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
|
package/dist/tools/users.d.ts
CHANGED
|
@@ -1,4 +1,23 @@
|
|
|
1
1
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
import { z } from "zod";
|
|
2
3
|
import { CplaceApiClient } from '../api.js';
|
|
4
|
+
export declare const USER_TOOL_DEFINITIONS: {
|
|
5
|
+
readonly cplace_get_person_by_name: {
|
|
6
|
+
readonly description: "Get details about a person by searching for their name.";
|
|
7
|
+
readonly inputSchema: {
|
|
8
|
+
readonly name: z.ZodString;
|
|
9
|
+
};
|
|
10
|
+
readonly annotations: {
|
|
11
|
+
readonly title: "Get Person by Name";
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
readonly cplace_get_current_user: {
|
|
15
|
+
readonly description: "Get information about the currently logged-in user, including their attributes and metadata";
|
|
16
|
+
readonly inputSchema: {};
|
|
17
|
+
readonly annotations: {
|
|
18
|
+
readonly title: "Get Current User";
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
3
22
|
export declare function registerUserTools(server: McpServer, client: CplaceApiClient): void;
|
|
4
23
|
//# sourceMappingURL=users.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/tools/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;
|
|
1
|
+
{"version":3,"file":"users.d.ts","sourceRoot":"","sources":["../../src/tools/users.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAQ5C,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;CAaxB,CAAC;AAEX,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,eAAe,QA0C3E"}
|