@payloadcms/plugin-mcp 0.0.1-alpha.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/LICENSE.md +22 -0
- package/README.md +7 -0
- package/dist/collections/createApiKeysCollection.d.ts +7 -0
- package/dist/collections/createApiKeysCollection.d.ts.map +1 -0
- package/dist/collections/createApiKeysCollection.js +315 -0
- package/dist/collections/createApiKeysCollection.js.map +1 -0
- package/dist/endpoints/mcp.d.ts +4 -0
- package/dist/endpoints/mcp.d.ts.map +1 -0
- package/dist/endpoints/mcp.js +44 -0
- package/dist/endpoints/mcp.js.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/mcp/createRequest.d.ts +3 -0
- package/dist/mcp/createRequest.d.ts.map +1 -0
- package/dist/mcp/createRequest.js +14 -0
- package/dist/mcp/createRequest.js.map +1 -0
- package/dist/mcp/getMcpHandler.d.ts +4 -0
- package/dist/mcp/getMcpHandler.d.ts.map +1 -0
- package/dist/mcp/getMcpHandler.js +179 -0
- package/dist/mcp/getMcpHandler.js.map +1 -0
- package/dist/mcp/helpers/config.d.ts +30 -0
- package/dist/mcp/helpers/config.d.ts.map +1 -0
- package/dist/mcp/helpers/config.js +217 -0
- package/dist/mcp/helpers/config.js.map +1 -0
- package/dist/mcp/helpers/conversion.d.ts +2 -0
- package/dist/mcp/helpers/conversion.d.ts.map +1 -0
- package/dist/mcp/helpers/conversion.js +5 -0
- package/dist/mcp/helpers/conversion.js.map +1 -0
- package/dist/mcp/helpers/fields.d.ts +38 -0
- package/dist/mcp/helpers/fields.d.ts.map +1 -0
- package/dist/mcp/helpers/fields.js +96 -0
- package/dist/mcp/helpers/fields.js.map +1 -0
- package/dist/mcp/helpers/fileValidation.d.ts +69 -0
- package/dist/mcp/helpers/fileValidation.d.ts.map +1 -0
- package/dist/mcp/helpers/fileValidation.js +305 -0
- package/dist/mcp/helpers/fileValidation.js.map +1 -0
- package/dist/mcp/helpers/validation.d.ts +9 -0
- package/dist/mcp/helpers/validation.d.ts.map +1 -0
- package/dist/mcp/helpers/validation.js +22 -0
- package/dist/mcp/helpers/validation.js.map +1 -0
- package/dist/mcp/registerTool.d.ts +6 -0
- package/dist/mcp/registerTool.d.ts.map +1 -0
- package/dist/mcp/registerTool.js +18 -0
- package/dist/mcp/registerTool.js.map +1 -0
- package/dist/mcp/tools/auth/auth.d.ts +4 -0
- package/dist/mcp/tools/auth/auth.d.ts.map +1 -0
- package/dist/mcp/tools/auth/auth.js +54 -0
- package/dist/mcp/tools/auth/auth.js.map +1 -0
- package/dist/mcp/tools/auth/forgotPassword.d.ts +4 -0
- package/dist/mcp/tools/auth/forgotPassword.d.ts.map +1 -0
- package/dist/mcp/tools/auth/forgotPassword.js +45 -0
- package/dist/mcp/tools/auth/forgotPassword.js.map +1 -0
- package/dist/mcp/tools/auth/login.d.ts +4 -0
- package/dist/mcp/tools/auth/login.d.ts.map +1 -0
- package/dist/mcp/tools/auth/login.js +48 -0
- package/dist/mcp/tools/auth/login.js.map +1 -0
- package/dist/mcp/tools/auth/resetPassword.d.ts +4 -0
- package/dist/mcp/tools/auth/resetPassword.d.ts.map +1 -0
- package/dist/mcp/tools/auth/resetPassword.js +46 -0
- package/dist/mcp/tools/auth/resetPassword.js.map +1 -0
- package/dist/mcp/tools/auth/unlock.d.ts +4 -0
- package/dist/mcp/tools/auth/unlock.d.ts.map +1 -0
- package/dist/mcp/tools/auth/unlock.js +45 -0
- package/dist/mcp/tools/auth/unlock.js.map +1 -0
- package/dist/mcp/tools/auth/verify.d.ts +4 -0
- package/dist/mcp/tools/auth/verify.d.ts.map +1 -0
- package/dist/mcp/tools/auth/verify.js +42 -0
- package/dist/mcp/tools/auth/verify.js.map +1 -0
- package/dist/mcp/tools/collection/create.d.ts +10 -0
- package/dist/mcp/tools/collection/create.d.ts.map +1 -0
- package/dist/mcp/tools/collection/create.js +159 -0
- package/dist/mcp/tools/collection/create.js.map +1 -0
- package/dist/mcp/tools/collection/delete.d.ts +10 -0
- package/dist/mcp/tools/collection/delete.d.ts.map +1 -0
- package/dist/mcp/tools/collection/delete.js +162 -0
- package/dist/mcp/tools/collection/delete.js.map +1 -0
- package/dist/mcp/tools/collection/find.d.ts +10 -0
- package/dist/mcp/tools/collection/find.d.ts.map +1 -0
- package/dist/mcp/tools/collection/find.js +162 -0
- package/dist/mcp/tools/collection/find.js.map +1 -0
- package/dist/mcp/tools/collection/update.d.ts +10 -0
- package/dist/mcp/tools/collection/update.d.ts.map +1 -0
- package/dist/mcp/tools/collection/update.js +206 -0
- package/dist/mcp/tools/collection/update.js.map +1 -0
- package/dist/mcp/tools/config/find.d.ts +10 -0
- package/dist/mcp/tools/config/find.d.ts.map +1 -0
- package/dist/mcp/tools/config/find.js +94 -0
- package/dist/mcp/tools/config/find.js.map +1 -0
- package/dist/mcp/tools/config/update.d.ts +10 -0
- package/dist/mcp/tools/config/update.d.ts.map +1 -0
- package/dist/mcp/tools/config/update.js +212 -0
- package/dist/mcp/tools/config/update.js.map +1 -0
- package/dist/mcp/tools/job/create.d.ts +10 -0
- package/dist/mcp/tools/job/create.d.ts.map +1 -0
- package/dist/mcp/tools/job/create.js +293 -0
- package/dist/mcp/tools/job/create.js.map +1 -0
- package/dist/mcp/tools/job/run.d.ts +10 -0
- package/dist/mcp/tools/job/run.d.ts.map +1 -0
- package/dist/mcp/tools/job/run.js +147 -0
- package/dist/mcp/tools/job/run.js.map +1 -0
- package/dist/mcp/tools/job/update.d.ts +11 -0
- package/dist/mcp/tools/job/update.d.ts.map +1 -0
- package/dist/mcp/tools/job/update.js +211 -0
- package/dist/mcp/tools/job/update.js.map +1 -0
- package/dist/mcp/tools/resource/create.d.ts +6 -0
- package/dist/mcp/tools/resource/create.d.ts.map +1 -0
- package/dist/mcp/tools/resource/create.js +75 -0
- package/dist/mcp/tools/resource/create.js.map +1 -0
- package/dist/mcp/tools/resource/delete.d.ts +5 -0
- package/dist/mcp/tools/resource/delete.d.ts.map +1 -0
- package/dist/mcp/tools/resource/delete.js +140 -0
- package/dist/mcp/tools/resource/delete.js.map +1 -0
- package/dist/mcp/tools/resource/find.d.ts +5 -0
- package/dist/mcp/tools/resource/find.d.ts.map +1 -0
- package/dist/mcp/tools/resource/find.js +119 -0
- package/dist/mcp/tools/resource/find.js.map +1 -0
- package/dist/mcp/tools/resource/update.d.ts +6 -0
- package/dist/mcp/tools/resource/update.d.ts.map +1 -0
- package/dist/mcp/tools/resource/update.js +201 -0
- package/dist/mcp/tools/resource/update.js.map +1 -0
- package/dist/mcp/tools/schemas.d.ts +374 -0
- package/dist/mcp/tools/schemas.d.ts.map +1 -0
- package/dist/mcp/tools/schemas.js +201 -0
- package/dist/mcp/tools/schemas.js.map +1 -0
- package/dist/types.d.ts +379 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/camelCase.d.ts +9 -0
- package/dist/utils/camelCase.d.ts.map +1 -0
- package/dist/utils/camelCase.js +11 -0
- package/dist/utils/camelCase.js.map +1 -0
- package/dist/utils/convertCollectionSchemaToZod.d.ts +3 -0
- package/dist/utils/convertCollectionSchemaToZod.d.ts.map +1 -0
- package/dist/utils/convertCollectionSchemaToZod.js +30 -0
- package/dist/utils/convertCollectionSchemaToZod.js.map +1 -0
- package/package.json +64 -0
- package/src/collections/createApiKeysCollection.ts +393 -0
- package/src/endpoints/mcp.ts +60 -0
- package/src/index.ts +86 -0
- package/src/mcp/createRequest.ts +13 -0
- package/src/mcp/getMcpHandler.ts +433 -0
- package/src/mcp/helpers/config.ts +326 -0
- package/src/mcp/helpers/conversion.ts +3 -0
- package/src/mcp/helpers/fields.ts +158 -0
- package/src/mcp/helpers/fileValidation.ts +417 -0
- package/src/mcp/helpers/validation.ts +32 -0
- package/src/mcp/registerTool.ts +22 -0
- package/src/mcp/tools/auth/auth.ts +69 -0
- package/src/mcp/tools/auth/forgotPassword.ts +68 -0
- package/src/mcp/tools/auth/login.ts +70 -0
- package/src/mcp/tools/auth/resetPassword.ts +59 -0
- package/src/mcp/tools/auth/unlock.ts +62 -0
- package/src/mcp/tools/auth/verify.ts +55 -0
- package/src/mcp/tools/collection/create.ts +236 -0
- package/src/mcp/tools/collection/delete.ts +227 -0
- package/src/mcp/tools/collection/find.ts +222 -0
- package/src/mcp/tools/collection/update.ts +288 -0
- package/src/mcp/tools/config/find.ts +126 -0
- package/src/mcp/tools/config/update.ts +282 -0
- package/src/mcp/tools/job/create.ts +420 -0
- package/src/mcp/tools/job/run.ts +189 -0
- package/src/mcp/tools/job/update.ts +319 -0
- package/src/mcp/tools/resource/create.ts +121 -0
- package/src/mcp/tools/resource/delete.ts +210 -0
- package/src/mcp/tools/resource/find.ts +194 -0
- package/src/mcp/tools/resource/update.ts +314 -0
- package/src/mcp/tools/schemas.ts +373 -0
- package/src/types.ts +405 -0
- package/src/utils/camelCase.ts +12 -0
- package/src/utils/convertCollectionSchemaToZod.ts +35 -0
|
@@ -0,0 +1,374 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const toolSchemas: {
|
|
3
|
+
findResources: {
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: z.ZodObject<{
|
|
6
|
+
id: z.ZodOptional<z.ZodString>;
|
|
7
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
8
|
+
page: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
9
|
+
sort: z.ZodOptional<z.ZodString>;
|
|
10
|
+
where: z.ZodOptional<z.ZodString>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
limit: number;
|
|
13
|
+
page: number;
|
|
14
|
+
sort?: string | undefined;
|
|
15
|
+
id?: string | undefined;
|
|
16
|
+
where?: string | undefined;
|
|
17
|
+
}, {
|
|
18
|
+
sort?: string | undefined;
|
|
19
|
+
id?: string | undefined;
|
|
20
|
+
limit?: number | undefined;
|
|
21
|
+
page?: number | undefined;
|
|
22
|
+
where?: string | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
};
|
|
25
|
+
createResource: {
|
|
26
|
+
description: string;
|
|
27
|
+
parameters: z.ZodObject<{
|
|
28
|
+
data: z.ZodString;
|
|
29
|
+
draft: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
draft: boolean;
|
|
32
|
+
data: string;
|
|
33
|
+
}, {
|
|
34
|
+
data: string;
|
|
35
|
+
draft?: boolean | undefined;
|
|
36
|
+
}>;
|
|
37
|
+
};
|
|
38
|
+
updateResource: {
|
|
39
|
+
description: string;
|
|
40
|
+
parameters: z.ZodObject<{
|
|
41
|
+
id: z.ZodOptional<z.ZodString>;
|
|
42
|
+
data: z.ZodString;
|
|
43
|
+
depth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
44
|
+
draft: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
45
|
+
filePath: z.ZodOptional<z.ZodString>;
|
|
46
|
+
overrideLock: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
47
|
+
overwriteExistingFiles: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
48
|
+
where: z.ZodOptional<z.ZodString>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
depth: number;
|
|
51
|
+
draft: boolean;
|
|
52
|
+
data: string;
|
|
53
|
+
overrideLock: boolean;
|
|
54
|
+
overwriteExistingFiles: boolean;
|
|
55
|
+
id?: string | undefined;
|
|
56
|
+
where?: string | undefined;
|
|
57
|
+
filePath?: string | undefined;
|
|
58
|
+
}, {
|
|
59
|
+
data: string;
|
|
60
|
+
depth?: number | undefined;
|
|
61
|
+
draft?: boolean | undefined;
|
|
62
|
+
id?: string | undefined;
|
|
63
|
+
where?: string | undefined;
|
|
64
|
+
filePath?: string | undefined;
|
|
65
|
+
overrideLock?: boolean | undefined;
|
|
66
|
+
overwriteExistingFiles?: boolean | undefined;
|
|
67
|
+
}>;
|
|
68
|
+
};
|
|
69
|
+
deleteResource: {
|
|
70
|
+
description: string;
|
|
71
|
+
parameters: z.ZodObject<{
|
|
72
|
+
id: z.ZodOptional<z.ZodString>;
|
|
73
|
+
depth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
74
|
+
where: z.ZodOptional<z.ZodString>;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
depth: number;
|
|
77
|
+
id?: string | undefined;
|
|
78
|
+
where?: string | undefined;
|
|
79
|
+
}, {
|
|
80
|
+
depth?: number | undefined;
|
|
81
|
+
id?: string | undefined;
|
|
82
|
+
where?: string | undefined;
|
|
83
|
+
}>;
|
|
84
|
+
};
|
|
85
|
+
createCollection: {
|
|
86
|
+
description: string;
|
|
87
|
+
parameters: z.ZodObject<{
|
|
88
|
+
collectionDescription: z.ZodOptional<z.ZodString>;
|
|
89
|
+
collectionName: z.ZodString;
|
|
90
|
+
fields: z.ZodArray<z.ZodAny, "many">;
|
|
91
|
+
hasUpload: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
+
}, "strip", z.ZodTypeAny, {
|
|
93
|
+
fields: any[];
|
|
94
|
+
collectionName: string;
|
|
95
|
+
collectionDescription?: string | undefined;
|
|
96
|
+
hasUpload?: boolean | undefined;
|
|
97
|
+
}, {
|
|
98
|
+
fields: any[];
|
|
99
|
+
collectionName: string;
|
|
100
|
+
collectionDescription?: string | undefined;
|
|
101
|
+
hasUpload?: boolean | undefined;
|
|
102
|
+
}>;
|
|
103
|
+
};
|
|
104
|
+
findCollections: {
|
|
105
|
+
description: string;
|
|
106
|
+
parameters: z.ZodObject<{
|
|
107
|
+
collectionName: z.ZodOptional<z.ZodString>;
|
|
108
|
+
includeContent: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
109
|
+
includeCount: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
110
|
+
}, "strip", z.ZodTypeAny, {
|
|
111
|
+
includeContent: boolean;
|
|
112
|
+
includeCount: boolean;
|
|
113
|
+
collectionName?: string | undefined;
|
|
114
|
+
}, {
|
|
115
|
+
collectionName?: string | undefined;
|
|
116
|
+
includeContent?: boolean | undefined;
|
|
117
|
+
includeCount?: boolean | undefined;
|
|
118
|
+
}>;
|
|
119
|
+
};
|
|
120
|
+
updateCollection: {
|
|
121
|
+
description: string;
|
|
122
|
+
parameters: z.ZodObject<{
|
|
123
|
+
collectionName: z.ZodString;
|
|
124
|
+
configUpdates: z.ZodOptional<z.ZodAny>;
|
|
125
|
+
fieldModifications: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
126
|
+
fieldNamesToRemove: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
127
|
+
newContent: z.ZodOptional<z.ZodString>;
|
|
128
|
+
newFields: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
129
|
+
updateType: z.ZodEnum<["add_field", "remove_field", "modify_field", "update_config", "replace_content"]>;
|
|
130
|
+
}, "strip", z.ZodTypeAny, {
|
|
131
|
+
collectionName: string;
|
|
132
|
+
updateType: "add_field" | "remove_field" | "modify_field" | "update_config" | "replace_content";
|
|
133
|
+
configUpdates?: any;
|
|
134
|
+
fieldModifications?: any[] | undefined;
|
|
135
|
+
fieldNamesToRemove?: string[] | undefined;
|
|
136
|
+
newContent?: string | undefined;
|
|
137
|
+
newFields?: any[] | undefined;
|
|
138
|
+
}, {
|
|
139
|
+
collectionName: string;
|
|
140
|
+
updateType: "add_field" | "remove_field" | "modify_field" | "update_config" | "replace_content";
|
|
141
|
+
configUpdates?: any;
|
|
142
|
+
fieldModifications?: any[] | undefined;
|
|
143
|
+
fieldNamesToRemove?: string[] | undefined;
|
|
144
|
+
newContent?: string | undefined;
|
|
145
|
+
newFields?: any[] | undefined;
|
|
146
|
+
}>;
|
|
147
|
+
};
|
|
148
|
+
deleteCollection: {
|
|
149
|
+
description: string;
|
|
150
|
+
parameters: z.ZodObject<{
|
|
151
|
+
collectionName: z.ZodString;
|
|
152
|
+
confirmDeletion: z.ZodBoolean;
|
|
153
|
+
updateConfig: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
154
|
+
}, "strip", z.ZodTypeAny, {
|
|
155
|
+
confirmDeletion: boolean;
|
|
156
|
+
collectionName: string;
|
|
157
|
+
updateConfig: boolean;
|
|
158
|
+
}, {
|
|
159
|
+
confirmDeletion: boolean;
|
|
160
|
+
collectionName: string;
|
|
161
|
+
updateConfig?: boolean | undefined;
|
|
162
|
+
}>;
|
|
163
|
+
};
|
|
164
|
+
findConfig: {
|
|
165
|
+
description: string;
|
|
166
|
+
parameters: z.ZodObject<{
|
|
167
|
+
includeMetadata: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
168
|
+
}, "strip", z.ZodTypeAny, {
|
|
169
|
+
includeMetadata: boolean;
|
|
170
|
+
}, {
|
|
171
|
+
includeMetadata?: boolean | undefined;
|
|
172
|
+
}>;
|
|
173
|
+
};
|
|
174
|
+
updateConfig: {
|
|
175
|
+
description: string;
|
|
176
|
+
parameters: z.ZodObject<{
|
|
177
|
+
adminConfig: z.ZodOptional<z.ZodAny>;
|
|
178
|
+
collectionName: z.ZodOptional<z.ZodString>;
|
|
179
|
+
databaseConfig: z.ZodOptional<z.ZodAny>;
|
|
180
|
+
generalConfig: z.ZodOptional<z.ZodAny>;
|
|
181
|
+
newContent: z.ZodOptional<z.ZodString>;
|
|
182
|
+
pluginUpdates: z.ZodOptional<z.ZodAny>;
|
|
183
|
+
updateType: z.ZodEnum<["add_collection", "remove_collection", "update_admin", "update_database", "update_plugins", "replace_content"]>;
|
|
184
|
+
}, "strip", z.ZodTypeAny, {
|
|
185
|
+
updateType: "replace_content" | "add_collection" | "remove_collection" | "update_admin" | "update_database" | "update_plugins";
|
|
186
|
+
collectionName?: string | undefined;
|
|
187
|
+
newContent?: string | undefined;
|
|
188
|
+
adminConfig?: any;
|
|
189
|
+
databaseConfig?: any;
|
|
190
|
+
generalConfig?: any;
|
|
191
|
+
pluginUpdates?: any;
|
|
192
|
+
}, {
|
|
193
|
+
updateType: "replace_content" | "add_collection" | "remove_collection" | "update_admin" | "update_database" | "update_plugins";
|
|
194
|
+
collectionName?: string | undefined;
|
|
195
|
+
newContent?: string | undefined;
|
|
196
|
+
adminConfig?: any;
|
|
197
|
+
databaseConfig?: any;
|
|
198
|
+
generalConfig?: any;
|
|
199
|
+
pluginUpdates?: any;
|
|
200
|
+
}>;
|
|
201
|
+
};
|
|
202
|
+
auth: {
|
|
203
|
+
description: string;
|
|
204
|
+
parameters: z.ZodObject<{
|
|
205
|
+
headers: z.ZodOptional<z.ZodString>;
|
|
206
|
+
}, "strip", z.ZodTypeAny, {
|
|
207
|
+
headers?: string | undefined;
|
|
208
|
+
}, {
|
|
209
|
+
headers?: string | undefined;
|
|
210
|
+
}>;
|
|
211
|
+
};
|
|
212
|
+
login: {
|
|
213
|
+
description: string;
|
|
214
|
+
parameters: z.ZodObject<{
|
|
215
|
+
collection: z.ZodString;
|
|
216
|
+
depth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
217
|
+
email: z.ZodString;
|
|
218
|
+
overrideAccess: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
219
|
+
password: z.ZodString;
|
|
220
|
+
showHiddenFields: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
221
|
+
}, "strip", z.ZodTypeAny, {
|
|
222
|
+
email: string;
|
|
223
|
+
depth: number;
|
|
224
|
+
password: string;
|
|
225
|
+
collection: string;
|
|
226
|
+
overrideAccess: boolean;
|
|
227
|
+
showHiddenFields: boolean;
|
|
228
|
+
}, {
|
|
229
|
+
email: string;
|
|
230
|
+
password: string;
|
|
231
|
+
collection: string;
|
|
232
|
+
depth?: number | undefined;
|
|
233
|
+
overrideAccess?: boolean | undefined;
|
|
234
|
+
showHiddenFields?: boolean | undefined;
|
|
235
|
+
}>;
|
|
236
|
+
};
|
|
237
|
+
verify: {
|
|
238
|
+
description: string;
|
|
239
|
+
parameters: z.ZodObject<{
|
|
240
|
+
collection: z.ZodString;
|
|
241
|
+
token: z.ZodString;
|
|
242
|
+
}, "strip", z.ZodTypeAny, {
|
|
243
|
+
collection: string;
|
|
244
|
+
token: string;
|
|
245
|
+
}, {
|
|
246
|
+
collection: string;
|
|
247
|
+
token: string;
|
|
248
|
+
}>;
|
|
249
|
+
};
|
|
250
|
+
resetPassword: {
|
|
251
|
+
description: string;
|
|
252
|
+
parameters: z.ZodObject<{
|
|
253
|
+
collection: z.ZodString;
|
|
254
|
+
password: z.ZodString;
|
|
255
|
+
token: z.ZodString;
|
|
256
|
+
}, "strip", z.ZodTypeAny, {
|
|
257
|
+
password: string;
|
|
258
|
+
collection: string;
|
|
259
|
+
token: string;
|
|
260
|
+
}, {
|
|
261
|
+
password: string;
|
|
262
|
+
collection: string;
|
|
263
|
+
token: string;
|
|
264
|
+
}>;
|
|
265
|
+
};
|
|
266
|
+
forgotPassword: {
|
|
267
|
+
description: string;
|
|
268
|
+
parameters: z.ZodObject<{
|
|
269
|
+
collection: z.ZodString;
|
|
270
|
+
disableEmail: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
271
|
+
email: z.ZodString;
|
|
272
|
+
}, "strip", z.ZodTypeAny, {
|
|
273
|
+
email: string;
|
|
274
|
+
collection: string;
|
|
275
|
+
disableEmail: boolean;
|
|
276
|
+
}, {
|
|
277
|
+
email: string;
|
|
278
|
+
collection: string;
|
|
279
|
+
disableEmail?: boolean | undefined;
|
|
280
|
+
}>;
|
|
281
|
+
};
|
|
282
|
+
unlock: {
|
|
283
|
+
description: string;
|
|
284
|
+
parameters: z.ZodObject<{
|
|
285
|
+
collection: z.ZodString;
|
|
286
|
+
email: z.ZodString;
|
|
287
|
+
}, "strip", z.ZodTypeAny, {
|
|
288
|
+
email: string;
|
|
289
|
+
collection: string;
|
|
290
|
+
}, {
|
|
291
|
+
email: string;
|
|
292
|
+
collection: string;
|
|
293
|
+
}>;
|
|
294
|
+
};
|
|
295
|
+
createJob: {
|
|
296
|
+
description: string;
|
|
297
|
+
parameters: z.ZodObject<{
|
|
298
|
+
description: z.ZodString;
|
|
299
|
+
inputSchema: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
300
|
+
jobData: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
301
|
+
jobName: z.ZodString;
|
|
302
|
+
jobSlug: z.ZodString;
|
|
303
|
+
jobType: z.ZodEnum<["task", "workflow"]>;
|
|
304
|
+
outputSchema: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>>;
|
|
305
|
+
}, "strip", z.ZodTypeAny, {
|
|
306
|
+
description: string;
|
|
307
|
+
inputSchema: Record<string, any>;
|
|
308
|
+
jobData: Record<string, any>;
|
|
309
|
+
jobName: string;
|
|
310
|
+
jobSlug: string;
|
|
311
|
+
jobType: "task" | "workflow";
|
|
312
|
+
outputSchema: Record<string, any>;
|
|
313
|
+
}, {
|
|
314
|
+
description: string;
|
|
315
|
+
jobName: string;
|
|
316
|
+
jobSlug: string;
|
|
317
|
+
jobType: "task" | "workflow";
|
|
318
|
+
inputSchema?: Record<string, any> | undefined;
|
|
319
|
+
jobData?: Record<string, any> | undefined;
|
|
320
|
+
outputSchema?: Record<string, any> | undefined;
|
|
321
|
+
}>;
|
|
322
|
+
};
|
|
323
|
+
updateJob: {
|
|
324
|
+
description: string;
|
|
325
|
+
parameters: z.ZodObject<{
|
|
326
|
+
configUpdate: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
327
|
+
handlerCode: z.ZodOptional<z.ZodString>;
|
|
328
|
+
inputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
329
|
+
jobSlug: z.ZodString;
|
|
330
|
+
outputSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
|
|
331
|
+
taskSequence: z.ZodOptional<z.ZodArray<z.ZodAny, "many">>;
|
|
332
|
+
updateType: z.ZodEnum<["modify_schema", "update_tasks", "change_config", "replace_handler"]>;
|
|
333
|
+
}, "strip", z.ZodTypeAny, {
|
|
334
|
+
updateType: "modify_schema" | "update_tasks" | "change_config" | "replace_handler";
|
|
335
|
+
jobSlug: string;
|
|
336
|
+
inputSchema?: Record<string, any> | undefined;
|
|
337
|
+
outputSchema?: Record<string, any> | undefined;
|
|
338
|
+
configUpdate?: Record<string, any> | undefined;
|
|
339
|
+
handlerCode?: string | undefined;
|
|
340
|
+
taskSequence?: any[] | undefined;
|
|
341
|
+
}, {
|
|
342
|
+
updateType: "modify_schema" | "update_tasks" | "change_config" | "replace_handler";
|
|
343
|
+
jobSlug: string;
|
|
344
|
+
inputSchema?: Record<string, any> | undefined;
|
|
345
|
+
outputSchema?: Record<string, any> | undefined;
|
|
346
|
+
configUpdate?: Record<string, any> | undefined;
|
|
347
|
+
handlerCode?: string | undefined;
|
|
348
|
+
taskSequence?: any[] | undefined;
|
|
349
|
+
}>;
|
|
350
|
+
};
|
|
351
|
+
runJob: {
|
|
352
|
+
description: string;
|
|
353
|
+
parameters: z.ZodObject<{
|
|
354
|
+
delay: z.ZodOptional<z.ZodNumber>;
|
|
355
|
+
input: z.ZodRecord<z.ZodString, z.ZodAny>;
|
|
356
|
+
jobSlug: z.ZodString;
|
|
357
|
+
priority: z.ZodOptional<z.ZodNumber>;
|
|
358
|
+
queue: z.ZodOptional<z.ZodString>;
|
|
359
|
+
}, "strip", z.ZodTypeAny, {
|
|
360
|
+
jobSlug: string;
|
|
361
|
+
input: Record<string, any>;
|
|
362
|
+
delay?: number | undefined;
|
|
363
|
+
priority?: number | undefined;
|
|
364
|
+
queue?: string | undefined;
|
|
365
|
+
}, {
|
|
366
|
+
jobSlug: string;
|
|
367
|
+
input: Record<string, any>;
|
|
368
|
+
delay?: number | undefined;
|
|
369
|
+
priority?: number | undefined;
|
|
370
|
+
queue?: string | undefined;
|
|
371
|
+
}>;
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
//# sourceMappingURL=schemas.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../src/mcp/tools/schemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkXvB,CAAA"}
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export const toolSchemas = {
|
|
3
|
+
findResources: {
|
|
4
|
+
description: 'Find documents in a Payload collection using Find or FindByID.',
|
|
5
|
+
parameters: z.object({
|
|
6
|
+
id: z.string().optional().describe('Optional: specific document ID to retrieve. If not provided, returns all documents'),
|
|
7
|
+
limit: z.number().int().min(1, 'Limit must be at least 1').max(100, 'Limit cannot exceed 100').optional().default(10).describe('Maximum number of documents to return (default: 10, max: 100)'),
|
|
8
|
+
page: z.number().int().min(1, 'Page must be at least 1').optional().default(1).describe('Page number for pagination (default: 1)'),
|
|
9
|
+
sort: z.string().optional().describe('Field to sort by (e.g., "createdAt", "-updatedAt" for descending)'),
|
|
10
|
+
where: z.string().optional().describe('Optional JSON string for where clause filtering (e.g., \'{"title": {"contains": "test"}}\')')
|
|
11
|
+
})
|
|
12
|
+
},
|
|
13
|
+
createResource: {
|
|
14
|
+
description: 'Create a document in a Payload collection.',
|
|
15
|
+
parameters: z.object({
|
|
16
|
+
data: z.string().describe('JSON string containing the data for the new document'),
|
|
17
|
+
draft: z.boolean().optional().default(false).describe('Whether to create the document as a draft')
|
|
18
|
+
})
|
|
19
|
+
},
|
|
20
|
+
updateResource: {
|
|
21
|
+
description: 'Update documents in a Payload collection by ID or where clause.',
|
|
22
|
+
parameters: z.object({
|
|
23
|
+
id: z.string().optional().describe('Optional: specific document ID to update'),
|
|
24
|
+
data: z.string().describe('JSON string containing the data to update'),
|
|
25
|
+
depth: z.number().int().min(0).max(10).optional().default(0).describe('Depth of population for relationships'),
|
|
26
|
+
draft: z.boolean().optional().default(false).describe('Whether to update as a draft'),
|
|
27
|
+
filePath: z.string().optional().describe('Optional: absolute file path for file uploads'),
|
|
28
|
+
overrideLock: z.boolean().optional().default(true).describe('Whether to override document locks'),
|
|
29
|
+
overwriteExistingFiles: z.boolean().optional().default(false).describe('Whether to overwrite existing files'),
|
|
30
|
+
where: z.string().optional().describe('Optional: JSON string for where clause to update multiple documents')
|
|
31
|
+
})
|
|
32
|
+
},
|
|
33
|
+
deleteResource: {
|
|
34
|
+
description: 'Delete documents in a Payload collection by ID or where clause.',
|
|
35
|
+
parameters: z.object({
|
|
36
|
+
id: z.string().optional().describe('Optional: specific document ID to delete'),
|
|
37
|
+
depth: z.number().int().min(0).max(10).optional().default(0).describe('Depth of population for relationships in response'),
|
|
38
|
+
where: z.string().optional().describe('Optional: JSON string for where clause to delete multiple documents')
|
|
39
|
+
})
|
|
40
|
+
},
|
|
41
|
+
// Experimental Below This Line
|
|
42
|
+
createCollection: {
|
|
43
|
+
description: 'Creates a new Payload collection with specified fields and configuration.',
|
|
44
|
+
parameters: z.object({
|
|
45
|
+
collectionDescription: z.string().optional().describe('Optional description for the collection'),
|
|
46
|
+
collectionName: z.string().describe('The name of the collection to create'),
|
|
47
|
+
fields: z.array(z.any()).describe('Array of field definitions for the collection'),
|
|
48
|
+
hasUpload: z.boolean().optional().describe('Whether the collection should have upload capabilities')
|
|
49
|
+
})
|
|
50
|
+
},
|
|
51
|
+
findCollections: {
|
|
52
|
+
description: 'Finds and lists Payload collections with optional content and document counts.',
|
|
53
|
+
parameters: z.object({
|
|
54
|
+
collectionName: z.string().optional().describe('Optional: specific collection name to retrieve'),
|
|
55
|
+
includeContent: z.boolean().optional().default(false).describe('Whether to include collection file content'),
|
|
56
|
+
includeCount: z.boolean().optional().default(false).describe('Whether to include document counts for each collection')
|
|
57
|
+
})
|
|
58
|
+
},
|
|
59
|
+
updateCollection: {
|
|
60
|
+
description: 'Updates an existing Payload collection with new fields, modifications, or configuration changes.',
|
|
61
|
+
parameters: z.object({
|
|
62
|
+
collectionName: z.string().describe('The name of the collection to update'),
|
|
63
|
+
configUpdates: z.any().optional().describe('Configuration updates (for update_config type)'),
|
|
64
|
+
fieldModifications: z.array(z.any()).optional().describe('Field modifications (for modify_field type)'),
|
|
65
|
+
fieldNamesToRemove: z.array(z.string()).optional().describe('Field names to remove (for remove_field type)'),
|
|
66
|
+
newContent: z.string().optional().describe('New content to replace entire collection (for replace_content type)'),
|
|
67
|
+
newFields: z.array(z.any()).optional().describe('New fields to add (for add_field type)'),
|
|
68
|
+
updateType: z.enum([
|
|
69
|
+
'add_field',
|
|
70
|
+
'remove_field',
|
|
71
|
+
'modify_field',
|
|
72
|
+
'update_config',
|
|
73
|
+
'replace_content'
|
|
74
|
+
]).describe('Type of update to perform')
|
|
75
|
+
})
|
|
76
|
+
},
|
|
77
|
+
deleteCollection: {
|
|
78
|
+
description: 'Deletes a Payload collection and optionally updates the configuration.',
|
|
79
|
+
parameters: z.object({
|
|
80
|
+
collectionName: z.string().describe('The name of the collection to delete'),
|
|
81
|
+
confirmDeletion: z.boolean().describe('Confirmation flag to prevent accidental deletion'),
|
|
82
|
+
updateConfig: z.boolean().optional().default(false).describe('Whether to update payload.config.ts to remove collection reference')
|
|
83
|
+
})
|
|
84
|
+
},
|
|
85
|
+
findConfig: {
|
|
86
|
+
description: 'Reads and displays the current Payload configuration file.',
|
|
87
|
+
parameters: z.object({
|
|
88
|
+
includeMetadata: z.boolean().optional().default(false).describe('Whether to include file metadata (size, modified date, etc.)')
|
|
89
|
+
})
|
|
90
|
+
},
|
|
91
|
+
updateConfig: {
|
|
92
|
+
description: 'Updates the Payload configuration file with various modifications.',
|
|
93
|
+
parameters: z.object({
|
|
94
|
+
adminConfig: z.any().optional().describe('Admin configuration updates (for update_admin type)'),
|
|
95
|
+
collectionName: z.string().optional().describe('Collection name (required for add_collection and remove_collection)'),
|
|
96
|
+
databaseConfig: z.any().optional().describe('Database configuration updates (for update_database type)'),
|
|
97
|
+
generalConfig: z.any().optional().describe('General configuration updates'),
|
|
98
|
+
newContent: z.string().optional().describe('New configuration content (for replace_content type)'),
|
|
99
|
+
pluginUpdates: z.any().optional().describe('Plugin configuration updates (for update_plugins type)'),
|
|
100
|
+
updateType: z.enum([
|
|
101
|
+
'add_collection',
|
|
102
|
+
'remove_collection',
|
|
103
|
+
'update_admin',
|
|
104
|
+
'update_database',
|
|
105
|
+
'update_plugins',
|
|
106
|
+
'replace_content'
|
|
107
|
+
]).describe('Type of configuration update to perform')
|
|
108
|
+
})
|
|
109
|
+
},
|
|
110
|
+
auth: {
|
|
111
|
+
description: 'Checks authentication status for the current user.',
|
|
112
|
+
parameters: z.object({
|
|
113
|
+
headers: z.string().optional().describe('Optional JSON string containing custom headers to send with the authentication request')
|
|
114
|
+
})
|
|
115
|
+
},
|
|
116
|
+
login: {
|
|
117
|
+
description: 'Authenticates a user with email and password.',
|
|
118
|
+
parameters: z.object({
|
|
119
|
+
collection: z.string().describe('The collection containing the user (e.g., "users")'),
|
|
120
|
+
depth: z.number().int().min(0).max(10).optional().default(0).describe('Depth of population for relationships'),
|
|
121
|
+
email: z.string().email().describe('The user email address'),
|
|
122
|
+
overrideAccess: z.boolean().optional().default(false).describe('Whether to override access controls'),
|
|
123
|
+
password: z.string().describe('The user password'),
|
|
124
|
+
showHiddenFields: z.boolean().optional().default(false).describe('Whether to show hidden fields in the response')
|
|
125
|
+
})
|
|
126
|
+
},
|
|
127
|
+
verify: {
|
|
128
|
+
description: 'Verifies a user email with a verification token.',
|
|
129
|
+
parameters: z.object({
|
|
130
|
+
collection: z.string().describe('The collection containing the user (e.g., "users")'),
|
|
131
|
+
token: z.string().describe('The verification token sent to the user email')
|
|
132
|
+
})
|
|
133
|
+
},
|
|
134
|
+
resetPassword: {
|
|
135
|
+
description: 'Resets a user password with a reset token.',
|
|
136
|
+
parameters: z.object({
|
|
137
|
+
collection: z.string().describe('The collection containing the user (e.g., "users")'),
|
|
138
|
+
password: z.string().describe('The new password for the user'),
|
|
139
|
+
token: z.string().describe('The password reset token sent to the user email')
|
|
140
|
+
})
|
|
141
|
+
},
|
|
142
|
+
forgotPassword: {
|
|
143
|
+
description: 'Sends a password reset email to a user.',
|
|
144
|
+
parameters: z.object({
|
|
145
|
+
collection: z.string().describe('The collection containing the user (e.g., "users")'),
|
|
146
|
+
disableEmail: z.boolean().optional().default(false).describe('Whether to disable sending the email (for testing)'),
|
|
147
|
+
email: z.string().email().describe('The user email address')
|
|
148
|
+
})
|
|
149
|
+
},
|
|
150
|
+
unlock: {
|
|
151
|
+
description: 'Unlocks a user account that has been locked due to failed login attempts.',
|
|
152
|
+
parameters: z.object({
|
|
153
|
+
collection: z.string().describe('The collection containing the user (e.g., "users")'),
|
|
154
|
+
email: z.string().email().describe('The user email address')
|
|
155
|
+
})
|
|
156
|
+
},
|
|
157
|
+
createJob: {
|
|
158
|
+
description: 'Creates a new Payload job (task or workflow) with specified configuration.',
|
|
159
|
+
parameters: z.object({
|
|
160
|
+
description: z.string().describe('Description of what the job does'),
|
|
161
|
+
inputSchema: z.record(z.any()).optional().default({}).describe('Input schema for the job'),
|
|
162
|
+
jobData: z.record(z.any()).optional().default({}).describe('Additional job configuration data'),
|
|
163
|
+
jobName: z.string().min(1, 'Job name cannot be empty').regex(/^[a-z][\w-]*$/i, 'Job name must be alphanumeric and can contain underscores/dashes').describe('The name of the job to create'),
|
|
164
|
+
jobSlug: z.string().min(1, 'Job slug cannot be empty').regex(/^[a-z][a-z0-9-]*$/, 'Job slug must be kebab-case').describe('The slug for the job (kebab-case format)'),
|
|
165
|
+
jobType: z.enum([
|
|
166
|
+
'task',
|
|
167
|
+
'workflow'
|
|
168
|
+
]).describe('Whether to create a task (individual unit) or workflow (orchestrates tasks)'),
|
|
169
|
+
outputSchema: z.record(z.any()).optional().default({}).describe('Output schema for the job')
|
|
170
|
+
})
|
|
171
|
+
},
|
|
172
|
+
updateJob: {
|
|
173
|
+
description: 'Updates an existing Payload job with new configuration, schema, or handler code.',
|
|
174
|
+
parameters: z.object({
|
|
175
|
+
configUpdate: z.record(z.any()).optional().describe('New configuration for the job'),
|
|
176
|
+
handlerCode: z.string().optional().describe('New handler code to replace the existing handler'),
|
|
177
|
+
inputSchema: z.record(z.any()).optional().describe('New input schema for the job'),
|
|
178
|
+
jobSlug: z.string().describe('The slug of the job to update'),
|
|
179
|
+
outputSchema: z.record(z.any()).optional().describe('New output schema for the job'),
|
|
180
|
+
taskSequence: z.array(z.any()).optional().describe('New task sequence for workflows'),
|
|
181
|
+
updateType: z.enum([
|
|
182
|
+
'modify_schema',
|
|
183
|
+
'update_tasks',
|
|
184
|
+
'change_config',
|
|
185
|
+
'replace_handler'
|
|
186
|
+
]).describe('Type of update to perform on the job')
|
|
187
|
+
})
|
|
188
|
+
},
|
|
189
|
+
runJob: {
|
|
190
|
+
description: 'Runs a Payload job with specified input data and queue options.',
|
|
191
|
+
parameters: z.object({
|
|
192
|
+
delay: z.number().int().min(0).optional().describe('Delay in milliseconds before job execution'),
|
|
193
|
+
input: z.record(z.any()).describe('Input data for the job execution'),
|
|
194
|
+
jobSlug: z.string().describe('The slug of the job to run'),
|
|
195
|
+
priority: z.number().int().min(1).max(10).optional().describe('Job priority (1-10, higher is more important)'),
|
|
196
|
+
queue: z.string().optional().describe('Queue name to use for job execution (default: "default")')
|
|
197
|
+
})
|
|
198
|
+
}
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
//# sourceMappingURL=schemas.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../src/mcp/tools/schemas.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport const toolSchemas = {\n findResources: {\n description: 'Find documents in a Payload collection using Find or FindByID.',\n parameters: z.object({\n id: z\n .string()\n .optional()\n .describe(\n 'Optional: specific document ID to retrieve. If not provided, returns all documents',\n ),\n limit: z\n .number()\n .int()\n .min(1, 'Limit must be at least 1')\n .max(100, 'Limit cannot exceed 100')\n .optional()\n .default(10)\n .describe('Maximum number of documents to return (default: 10, max: 100)'),\n page: z\n .number()\n .int()\n .min(1, 'Page must be at least 1')\n .optional()\n .default(1)\n .describe('Page number for pagination (default: 1)'),\n sort: z\n .string()\n .optional()\n .describe('Field to sort by (e.g., \"createdAt\", \"-updatedAt\" for descending)'),\n where: z\n .string()\n .optional()\n .describe(\n 'Optional JSON string for where clause filtering (e.g., \\'{\"title\": {\"contains\": \"test\"}}\\')',\n ),\n }),\n },\n\n createResource: {\n description: 'Create a document in a Payload collection.',\n parameters: z.object({\n data: z.string().describe('JSON string containing the data for the new document'),\n draft: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to create the document as a draft'),\n }),\n },\n\n updateResource: {\n description: 'Update documents in a Payload collection by ID or where clause.',\n parameters: z.object({\n id: z.string().optional().describe('Optional: specific document ID to update'),\n data: z.string().describe('JSON string containing the data to update'),\n depth: z\n .number()\n .int()\n .min(0)\n .max(10)\n .optional()\n .default(0)\n .describe('Depth of population for relationships'),\n draft: z.boolean().optional().default(false).describe('Whether to update as a draft'),\n filePath: z.string().optional().describe('Optional: absolute file path for file uploads'),\n overrideLock: z\n .boolean()\n .optional()\n .default(true)\n .describe('Whether to override document locks'),\n overwriteExistingFiles: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to overwrite existing files'),\n where: z\n .string()\n .optional()\n .describe('Optional: JSON string for where clause to update multiple documents'),\n }),\n },\n\n deleteResource: {\n description: 'Delete documents in a Payload collection by ID or where clause.',\n parameters: z.object({\n id: z.string().optional().describe('Optional: specific document ID to delete'),\n depth: z\n .number()\n .int()\n .min(0)\n .max(10)\n .optional()\n .default(0)\n .describe('Depth of population for relationships in response'),\n where: z\n .string()\n .optional()\n .describe('Optional: JSON string for where clause to delete multiple documents'),\n }),\n },\n\n // Experimental Below This Line\n createCollection: {\n description: 'Creates a new Payload collection with specified fields and configuration.',\n parameters: z.object({\n collectionDescription: z\n .string()\n .optional()\n .describe('Optional description for the collection'),\n collectionName: z.string().describe('The name of the collection to create'),\n fields: z.array(z.any()).describe('Array of field definitions for the collection'),\n hasUpload: z\n .boolean()\n .optional()\n .describe('Whether the collection should have upload capabilities'),\n }),\n },\n\n findCollections: {\n description: 'Finds and lists Payload collections with optional content and document counts.',\n parameters: z.object({\n collectionName: z\n .string()\n .optional()\n .describe('Optional: specific collection name to retrieve'),\n includeContent: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to include collection file content'),\n includeCount: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to include document counts for each collection'),\n }),\n },\n\n updateCollection: {\n description:\n 'Updates an existing Payload collection with new fields, modifications, or configuration changes.',\n parameters: z.object({\n collectionName: z.string().describe('The name of the collection to update'),\n configUpdates: z.any().optional().describe('Configuration updates (for update_config type)'),\n fieldModifications: z\n .array(z.any())\n .optional()\n .describe('Field modifications (for modify_field type)'),\n fieldNamesToRemove: z\n .array(z.string())\n .optional()\n .describe('Field names to remove (for remove_field type)'),\n newContent: z\n .string()\n .optional()\n .describe('New content to replace entire collection (for replace_content type)'),\n newFields: z.array(z.any()).optional().describe('New fields to add (for add_field type)'),\n updateType: z\n .enum(['add_field', 'remove_field', 'modify_field', 'update_config', 'replace_content'])\n .describe('Type of update to perform'),\n }),\n },\n\n deleteCollection: {\n description: 'Deletes a Payload collection and optionally updates the configuration.',\n parameters: z.object({\n collectionName: z.string().describe('The name of the collection to delete'),\n confirmDeletion: z.boolean().describe('Confirmation flag to prevent accidental deletion'),\n updateConfig: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to update payload.config.ts to remove collection reference'),\n }),\n },\n\n findConfig: {\n description: 'Reads and displays the current Payload configuration file.',\n parameters: z.object({\n includeMetadata: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to include file metadata (size, modified date, etc.)'),\n }),\n },\n\n updateConfig: {\n description: 'Updates the Payload configuration file with various modifications.',\n parameters: z.object({\n adminConfig: z\n .any()\n .optional()\n .describe('Admin configuration updates (for update_admin type)'),\n collectionName: z\n .string()\n .optional()\n .describe('Collection name (required for add_collection and remove_collection)'),\n databaseConfig: z\n .any()\n .optional()\n .describe('Database configuration updates (for update_database type)'),\n generalConfig: z.any().optional().describe('General configuration updates'),\n newContent: z\n .string()\n .optional()\n .describe('New configuration content (for replace_content type)'),\n pluginUpdates: z\n .any()\n .optional()\n .describe('Plugin configuration updates (for update_plugins type)'),\n updateType: z\n .enum([\n 'add_collection',\n 'remove_collection',\n 'update_admin',\n 'update_database',\n 'update_plugins',\n 'replace_content',\n ])\n .describe('Type of configuration update to perform'),\n }),\n },\n\n auth: {\n description: 'Checks authentication status for the current user.',\n parameters: z.object({\n headers: z\n .string()\n .optional()\n .describe(\n 'Optional JSON string containing custom headers to send with the authentication request',\n ),\n }),\n },\n\n login: {\n description: 'Authenticates a user with email and password.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n depth: z\n .number()\n .int()\n .min(0)\n .max(10)\n .optional()\n .default(0)\n .describe('Depth of population for relationships'),\n email: z.string().email().describe('The user email address'),\n overrideAccess: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to override access controls'),\n password: z.string().describe('The user password'),\n showHiddenFields: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to show hidden fields in the response'),\n }),\n },\n\n verify: {\n description: 'Verifies a user email with a verification token.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n token: z.string().describe('The verification token sent to the user email'),\n }),\n },\n\n resetPassword: {\n description: 'Resets a user password with a reset token.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n password: z.string().describe('The new password for the user'),\n token: z.string().describe('The password reset token sent to the user email'),\n }),\n },\n\n forgotPassword: {\n description: 'Sends a password reset email to a user.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n disableEmail: z\n .boolean()\n .optional()\n .default(false)\n .describe('Whether to disable sending the email (for testing)'),\n email: z.string().email().describe('The user email address'),\n }),\n },\n\n unlock: {\n description: 'Unlocks a user account that has been locked due to failed login attempts.',\n parameters: z.object({\n collection: z.string().describe('The collection containing the user (e.g., \"users\")'),\n email: z.string().email().describe('The user email address'),\n }),\n },\n\n createJob: {\n description: 'Creates a new Payload job (task or workflow) with specified configuration.',\n parameters: z.object({\n description: z.string().describe('Description of what the job does'),\n inputSchema: z.record(z.any()).optional().default({}).describe('Input schema for the job'),\n jobData: z\n .record(z.any())\n .optional()\n .default({})\n .describe('Additional job configuration data'),\n jobName: z\n .string()\n .min(1, 'Job name cannot be empty')\n .regex(/^[a-z][\\w-]*$/i, 'Job name must be alphanumeric and can contain underscores/dashes')\n .describe('The name of the job to create'),\n jobSlug: z\n .string()\n .min(1, 'Job slug cannot be empty')\n .regex(/^[a-z][a-z0-9-]*$/, 'Job slug must be kebab-case')\n .describe('The slug for the job (kebab-case format)'),\n jobType: z\n .enum(['task', 'workflow'])\n .describe('Whether to create a task (individual unit) or workflow (orchestrates tasks)'),\n outputSchema: z.record(z.any()).optional().default({}).describe('Output schema for the job'),\n }),\n },\n\n updateJob: {\n description: 'Updates an existing Payload job with new configuration, schema, or handler code.',\n parameters: z.object({\n configUpdate: z.record(z.any()).optional().describe('New configuration for the job'),\n handlerCode: z\n .string()\n .optional()\n .describe('New handler code to replace the existing handler'),\n inputSchema: z.record(z.any()).optional().describe('New input schema for the job'),\n jobSlug: z.string().describe('The slug of the job to update'),\n outputSchema: z.record(z.any()).optional().describe('New output schema for the job'),\n taskSequence: z.array(z.any()).optional().describe('New task sequence for workflows'),\n updateType: z\n .enum(['modify_schema', 'update_tasks', 'change_config', 'replace_handler'])\n .describe('Type of update to perform on the job'),\n }),\n },\n\n runJob: {\n description: 'Runs a Payload job with specified input data and queue options.',\n parameters: z.object({\n delay: z\n .number()\n .int()\n .min(0)\n .optional()\n .describe('Delay in milliseconds before job execution'),\n input: z.record(z.any()).describe('Input data for the job execution'),\n jobSlug: z.string().describe('The slug of the job to run'),\n priority: z\n .number()\n .int()\n .min(1)\n .max(10)\n .optional()\n .describe('Job priority (1-10, higher is more important)'),\n queue: z\n .string()\n .optional()\n .describe('Queue name to use for job execution (default: \"default\")'),\n }),\n },\n}\n"],"names":["z","toolSchemas","findResources","description","parameters","object","id","string","optional","describe","limit","number","int","min","max","default","page","sort","where","createResource","data","draft","boolean","updateResource","depth","filePath","overrideLock","overwriteExistingFiles","deleteResource","createCollection","collectionDescription","collectionName","fields","array","any","hasUpload","findCollections","includeContent","includeCount","updateCollection","configUpdates","fieldModifications","fieldNamesToRemove","newContent","newFields","updateType","enum","deleteCollection","confirmDeletion","updateConfig","findConfig","includeMetadata","adminConfig","databaseConfig","generalConfig","pluginUpdates","auth","headers","login","collection","email","overrideAccess","password","showHiddenFields","verify","token","resetPassword","forgotPassword","disableEmail","unlock","createJob","inputSchema","record","jobData","jobName","regex","jobSlug","jobType","outputSchema","updateJob","configUpdate","handlerCode","taskSequence","runJob","delay","input","priority","queue"],"mappings":"AAAA,SAASA,CAAC,QAAQ,MAAK;AAEvB,OAAO,MAAMC,cAAc;IACzBC,eAAe;QACbC,aAAa;QACbC,YAAYJ,EAAEK,MAAM,CAAC;YACnBC,IAAIN,EACDO,MAAM,GACNC,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