@payloadcms/plugin-mcp 3.70.0-canary.9 → 3.71.0-internal-debug.80dab4c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/collections/createApiKeysCollection.d.ts +1 -1
- package/dist/collections/createApiKeysCollection.d.ts.map +1 -1
- package/dist/collections/createApiKeysCollection.js +10 -75
- package/dist/collections/createApiKeysCollection.js.map +1 -1
- package/dist/endpoints/mcp.d.ts.map +1 -1
- package/dist/endpoints/mcp.js +1 -0
- package/dist/endpoints/mcp.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/mcp/getMcpHandler.d.ts.map +1 -1
- package/dist/mcp/getMcpHandler.js +24 -10
- package/dist/mcp/getMcpHandler.js.map +1 -1
- package/dist/mcp/tools/global/find.d.ts +5 -0
- package/dist/mcp/tools/global/find.d.ts.map +1 -0
- package/dist/mcp/tools/global/find.js +59 -0
- package/dist/mcp/tools/global/find.js.map +1 -0
- package/dist/mcp/tools/global/update.d.ts +6 -0
- package/dist/mcp/tools/global/update.d.ts.map +1 -0
- package/dist/mcp/tools/global/update.js +97 -0
- package/dist/mcp/tools/global/update.js.map +1 -0
- package/dist/mcp/tools/schemas.d.ts +55 -17
- package/dist/mcp/tools/schemas.d.ts.map +1 -1
- package/dist/mcp/tools/schemas.js +18 -0
- package/dist/mcp/tools/schemas.js.map +1 -1
- package/dist/types.d.ts +40 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/dist/utils/adminEntitySettings.d.ts +17 -0
- package/dist/utils/adminEntitySettings.d.ts.map +1 -0
- package/dist/utils/adminEntitySettings.js +41 -0
- package/dist/utils/adminEntitySettings.js.map +1 -0
- package/dist/utils/createApiKeyFields.d.ts +15 -0
- package/dist/utils/createApiKeyFields.d.ts.map +1 -0
- package/dist/utils/createApiKeyFields.js +57 -0
- package/dist/utils/createApiKeyFields.js.map +1 -0
- package/dist/utils/getEnabledSlugs.d.ts +13 -0
- package/dist/utils/getEnabledSlugs.d.ts.map +1 -0
- package/dist/utils/getEnabledSlugs.js +32 -0
- package/dist/utils/getEnabledSlugs.js.map +1 -0
- package/package.json +4 -4
- package/src/collections/createApiKeysCollection.ts +11 -111
- package/src/endpoints/mcp.ts +1 -0
- package/src/index.ts +4 -0
- package/src/mcp/getMcpHandler.ts +62 -26
- package/src/mcp/tools/global/find.ts +104 -0
- package/src/mcp/tools/global/update.ts +168 -0
- package/src/mcp/tools/schemas.ts +50 -0
- package/src/types.ts +59 -1
- package/src/utils/adminEntitySettings.ts +40 -0
- package/src/utils/createApiKeyFields.ts +72 -0
- package/src/utils/getEnabledSlugs.ts +42 -0
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { toCamelCase } from '../../../utils/camelCase.js';
|
|
2
|
+
import { toolSchemas } from '../schemas.js';
|
|
3
|
+
export const findGlobalTool = (server, req, user, verboseLogs, globalSlug, globals)=>{
|
|
4
|
+
const tool = async (depth = 0, locale, fallbackLocale)=>{
|
|
5
|
+
const payload = req.payload;
|
|
6
|
+
if (verboseLogs) {
|
|
7
|
+
payload.logger.info(`[payload-mcp] Reading global: ${globalSlug}, depth: ${depth}${locale ? `, locale: ${locale}` : ''}`);
|
|
8
|
+
}
|
|
9
|
+
try {
|
|
10
|
+
const findOptions = {
|
|
11
|
+
slug: globalSlug,
|
|
12
|
+
depth,
|
|
13
|
+
user
|
|
14
|
+
};
|
|
15
|
+
// Add locale parameters if provided
|
|
16
|
+
if (locale) {
|
|
17
|
+
findOptions.locale = locale;
|
|
18
|
+
}
|
|
19
|
+
if (fallbackLocale) {
|
|
20
|
+
findOptions.fallbackLocale = fallbackLocale;
|
|
21
|
+
}
|
|
22
|
+
const result = await payload.findGlobal(findOptions);
|
|
23
|
+
if (verboseLogs) {
|
|
24
|
+
payload.logger.info(`[payload-mcp] Found global: ${globalSlug}`);
|
|
25
|
+
}
|
|
26
|
+
const response = {
|
|
27
|
+
content: [
|
|
28
|
+
{
|
|
29
|
+
type: 'text',
|
|
30
|
+
text: `Global "${globalSlug}":
|
|
31
|
+
\`\`\`json
|
|
32
|
+
${JSON.stringify(result, null, 2)}
|
|
33
|
+
\`\`\``
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
|
+
};
|
|
37
|
+
return globals?.[globalSlug]?.overrideResponse?.(response, result, req) || response;
|
|
38
|
+
} catch (error) {
|
|
39
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
40
|
+
payload.logger.error(`[payload-mcp] Error reading global ${globalSlug}: ${errorMessage}`);
|
|
41
|
+
const response = {
|
|
42
|
+
content: [
|
|
43
|
+
{
|
|
44
|
+
type: 'text',
|
|
45
|
+
text: `❌ **Error reading global "${globalSlug}":** ${errorMessage}`
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
};
|
|
49
|
+
return globals?.[globalSlug]?.overrideResponse?.(response, {}, req) || response;
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
if (globals?.[globalSlug]?.enabled) {
|
|
53
|
+
server.tool(`find${globalSlug.charAt(0).toUpperCase() + toCamelCase(globalSlug).slice(1)}`, `${toolSchemas.findGlobal.description.trim()}\n\n${globals?.[globalSlug]?.description || ''}`, toolSchemas.findGlobal.parameters.shape, async ({ depth, fallbackLocale, locale })=>{
|
|
54
|
+
return await tool(depth, locale, fallbackLocale);
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=find.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/mcp/tools/global/find.ts"],"sourcesContent":["import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport type { PayloadRequest, TypedUser } from 'payload'\n\nimport type { PluginMCPServerConfig } from '../../../types.js'\n\nimport { toCamelCase } from '../../../utils/camelCase.js'\nimport { toolSchemas } from '../schemas.js'\n\nexport const findGlobalTool = (\n server: McpServer,\n req: PayloadRequest,\n user: TypedUser,\n verboseLogs: boolean,\n globalSlug: string,\n globals: PluginMCPServerConfig['globals'],\n) => {\n const tool = async (\n depth: number = 0,\n locale?: string,\n fallbackLocale?: string,\n ): Promise<{\n content: Array<{\n text: string\n type: 'text'\n }>\n }> => {\n const payload = req.payload\n\n if (verboseLogs) {\n payload.logger.info(\n `[payload-mcp] Reading global: ${globalSlug}, depth: ${depth}${locale ? `, locale: ${locale}` : ''}`,\n )\n }\n\n try {\n const findOptions: Parameters<typeof payload.findGlobal>[0] = {\n slug: globalSlug,\n depth,\n user,\n }\n\n // Add locale parameters if provided\n if (locale) {\n findOptions.locale = locale\n }\n if (fallbackLocale) {\n findOptions.fallbackLocale = fallbackLocale\n }\n\n const result = await payload.findGlobal(findOptions)\n\n if (verboseLogs) {\n payload.logger.info(`[payload-mcp] Found global: ${globalSlug}`)\n }\n\n const response = {\n content: [\n {\n type: 'text' as const,\n text: `Global \"${globalSlug}\":\n\\`\\`\\`json\n${JSON.stringify(result, null, 2)}\n\\`\\`\\``,\n },\n ],\n }\n\n return (globals?.[globalSlug]?.overrideResponse?.(response, result, req) || response) as {\n content: Array<{\n text: string\n type: 'text'\n }>\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error'\n payload.logger.error(`[payload-mcp] Error reading global ${globalSlug}: ${errorMessage}`)\n const response = {\n content: [\n {\n type: 'text' as const,\n text: `❌ **Error reading global \"${globalSlug}\":** ${errorMessage}`,\n },\n ],\n }\n return (globals?.[globalSlug]?.overrideResponse?.(response, {}, req) || response) as {\n content: Array<{\n text: string\n type: 'text'\n }>\n }\n }\n }\n\n if (globals?.[globalSlug]?.enabled) {\n server.tool(\n `find${globalSlug.charAt(0).toUpperCase() + toCamelCase(globalSlug).slice(1)}`,\n `${toolSchemas.findGlobal.description.trim()}\\n\\n${globals?.[globalSlug]?.description || ''}`,\n toolSchemas.findGlobal.parameters.shape,\n async ({ depth, fallbackLocale, locale }) => {\n return await tool(depth, locale, fallbackLocale)\n },\n )\n }\n}\n"],"names":["toCamelCase","toolSchemas","findGlobalTool","server","req","user","verboseLogs","globalSlug","globals","tool","depth","locale","fallbackLocale","payload","logger","info","findOptions","slug","result","findGlobal","response","content","type","text","JSON","stringify","overrideResponse","error","errorMessage","Error","message","enabled","charAt","toUpperCase","slice","description","trim","parameters","shape"],"mappings":"AAKA,SAASA,WAAW,QAAQ,8BAA6B;AACzD,SAASC,WAAW,QAAQ,gBAAe;AAE3C,OAAO,MAAMC,iBAAiB,CAC5BC,QACAC,KACAC,MACAC,aACAC,YACAC;IAEA,MAAMC,OAAO,OACXC,QAAgB,CAAC,EACjBC,QACAC;QAOA,MAAMC,UAAUT,IAAIS,OAAO;QAE3B,IAAIP,aAAa;YACfO,QAAQC,MAAM,CAACC,IAAI,CACjB,CAAC,8BAA8B,EAAER,WAAW,SAAS,EAAEG,QAAQC,SAAS,CAAC,UAAU,EAAEA,QAAQ,GAAG,IAAI;QAExG;QAEA,IAAI;YACF,MAAMK,cAAwD;gBAC5DC,MAAMV;gBACNG;gBACAL;YACF;YAEA,oCAAoC;YACpC,IAAIM,QAAQ;gBACVK,YAAYL,MAAM,GAAGA;YACvB;YACA,IAAIC,gBAAgB;gBAClBI,YAAYJ,cAAc,GAAGA;YAC/B;YAEA,MAAMM,SAAS,MAAML,QAAQM,UAAU,CAACH;YAExC,IAAIV,aAAa;gBACfO,QAAQC,MAAM,CAACC,IAAI,CAAC,CAAC,4BAA4B,EAAER,YAAY;YACjE;YAEA,MAAMa,WAAW;gBACfC,SAAS;oBACP;wBACEC,MAAM;wBACNC,MAAM,CAAC,QAAQ,EAAEhB,WAAW;;AAExC,EAAEiB,KAAKC,SAAS,CAACP,QAAQ,MAAM,GAAG;MAC5B,CAAC;oBACG;iBACD;YACH;YAEA,OAAQV,SAAS,CAACD,WAAW,EAAEmB,mBAAmBN,UAAUF,QAAQd,QAAQgB;QAM9E,EAAE,OAAOO,OAAO;YACd,MAAMC,eAAeD,iBAAiBE,QAAQF,MAAMG,OAAO,GAAG;YAC9DjB,QAAQC,MAAM,CAACa,KAAK,CAAC,CAAC,mCAAmC,EAAEpB,WAAW,EAAE,EAAEqB,cAAc;YACxF,MAAMR,WAAW;gBACfC,SAAS;oBACP;wBACEC,MAAM;wBACNC,MAAM,CAAC,0BAA0B,EAAEhB,WAAW,KAAK,EAAEqB,cAAc;oBACrE;iBACD;YACH;YACA,OAAQpB,SAAS,CAACD,WAAW,EAAEmB,mBAAmBN,UAAU,CAAC,GAAGhB,QAAQgB;QAM1E;IACF;IAEA,IAAIZ,SAAS,CAACD,WAAW,EAAEwB,SAAS;QAClC5B,OAAOM,IAAI,CACT,CAAC,IAAI,EAAEF,WAAWyB,MAAM,CAAC,GAAGC,WAAW,KAAKjC,YAAYO,YAAY2B,KAAK,CAAC,IAAI,EAC9E,GAAGjC,YAAYkB,UAAU,CAACgB,WAAW,CAACC,IAAI,GAAG,IAAI,EAAE5B,SAAS,CAACD,WAAW,EAAE4B,eAAe,IAAI,EAC7FlC,YAAYkB,UAAU,CAACkB,UAAU,CAACC,KAAK,EACvC,OAAO,EAAE5B,KAAK,EAAEE,cAAc,EAAED,MAAM,EAAE;YACtC,OAAO,MAAMF,KAAKC,OAAOC,QAAQC;QACnC;IAEJ;AACF,EAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
+
import type { JSONSchema4 } from 'json-schema';
|
|
3
|
+
import type { PayloadRequest, TypedUser } from 'payload';
|
|
4
|
+
import type { PluginMCPServerConfig } from '../../../types.js';
|
|
5
|
+
export declare const updateGlobalTool: (server: McpServer, req: PayloadRequest, user: TypedUser, verboseLogs: boolean, globalSlug: string, globals: PluginMCPServerConfig["globals"], schema: JSONSchema4) => void;
|
|
6
|
+
//# sourceMappingURL=update.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.d.ts","sourceRoot":"","sources":["../../../../src/mcp/tools/global/update.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACxE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAIxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAA;AAM9D,eAAO,MAAM,gBAAgB,WACnB,SAAS,OACZ,cAAc,QACb,SAAS,eACF,OAAO,cACR,MAAM,WACT,qBAAqB,CAAC,SAAS,CAAC,UACjC,WAAW,SAoJpB,CAAA"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { toCamelCase } from '../../../utils/camelCase.js';
|
|
3
|
+
import { convertCollectionSchemaToZod } from '../../../utils/convertCollectionSchemaToZod.js';
|
|
4
|
+
import { toolSchemas } from '../schemas.js';
|
|
5
|
+
export const updateGlobalTool = (server, req, user, verboseLogs, globalSlug, globals, schema)=>{
|
|
6
|
+
const tool = async (data, draft = false, depth = 0, locale, fallbackLocale)=>{
|
|
7
|
+
const payload = req.payload;
|
|
8
|
+
if (verboseLogs) {
|
|
9
|
+
payload.logger.info(`[payload-mcp] Updating global: ${globalSlug}, draft: ${draft}${locale ? `, locale: ${locale}` : ''}`);
|
|
10
|
+
}
|
|
11
|
+
try {
|
|
12
|
+
// Parse the data JSON
|
|
13
|
+
let parsedData;
|
|
14
|
+
try {
|
|
15
|
+
parsedData = JSON.parse(data);
|
|
16
|
+
if (verboseLogs) {
|
|
17
|
+
payload.logger.info(`[payload-mcp] Parsed data for ${globalSlug}: ${JSON.stringify(parsedData)}`);
|
|
18
|
+
}
|
|
19
|
+
} catch (_parseError) {
|
|
20
|
+
payload.logger.error(`[payload-mcp] Invalid JSON data provided: ${data}`);
|
|
21
|
+
const response = {
|
|
22
|
+
content: [
|
|
23
|
+
{
|
|
24
|
+
type: 'text',
|
|
25
|
+
text: 'Error: Invalid JSON data provided'
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
};
|
|
29
|
+
return globals?.[globalSlug]?.overrideResponse?.(response, {}, req) || response;
|
|
30
|
+
}
|
|
31
|
+
const updateOptions = {
|
|
32
|
+
slug: globalSlug,
|
|
33
|
+
data: parsedData,
|
|
34
|
+
depth,
|
|
35
|
+
draft,
|
|
36
|
+
user
|
|
37
|
+
};
|
|
38
|
+
// Add locale parameters if provided
|
|
39
|
+
if (locale) {
|
|
40
|
+
updateOptions.locale = locale;
|
|
41
|
+
}
|
|
42
|
+
if (fallbackLocale) {
|
|
43
|
+
updateOptions.fallbackLocale = fallbackLocale;
|
|
44
|
+
}
|
|
45
|
+
const result = await payload.updateGlobal(updateOptions);
|
|
46
|
+
if (verboseLogs) {
|
|
47
|
+
payload.logger.info(`[payload-mcp] Successfully updated global: ${globalSlug}`);
|
|
48
|
+
}
|
|
49
|
+
const response = {
|
|
50
|
+
content: [
|
|
51
|
+
{
|
|
52
|
+
type: 'text',
|
|
53
|
+
text: `Global "${globalSlug}" updated successfully!
|
|
54
|
+
\`\`\`json
|
|
55
|
+
${JSON.stringify(result, null, 2)}
|
|
56
|
+
\`\`\``
|
|
57
|
+
}
|
|
58
|
+
]
|
|
59
|
+
};
|
|
60
|
+
return globals?.[globalSlug]?.overrideResponse?.(response, result, req) || response;
|
|
61
|
+
} catch (error) {
|
|
62
|
+
const errorMessage = error instanceof Error ? error.message : 'Unknown error';
|
|
63
|
+
payload.logger.error(`[payload-mcp] Error updating global ${globalSlug}: ${errorMessage}`);
|
|
64
|
+
const response = {
|
|
65
|
+
content: [
|
|
66
|
+
{
|
|
67
|
+
type: 'text',
|
|
68
|
+
text: `Error updating global "${globalSlug}": ${errorMessage}`
|
|
69
|
+
}
|
|
70
|
+
]
|
|
71
|
+
};
|
|
72
|
+
return globals?.[globalSlug]?.overrideResponse?.(response, {}, req) || response;
|
|
73
|
+
}
|
|
74
|
+
};
|
|
75
|
+
if (globals?.[globalSlug]?.enabled) {
|
|
76
|
+
const convertedFields = convertCollectionSchemaToZod(schema);
|
|
77
|
+
// Make all fields optional for partial updates (PATCH-style)
|
|
78
|
+
const optionalFields = Object.fromEntries(Object.entries(convertedFields.shape).map(([key, value])=>[
|
|
79
|
+
key,
|
|
80
|
+
value.optional()
|
|
81
|
+
]));
|
|
82
|
+
const updateGlobalSchema = z.object({
|
|
83
|
+
...optionalFields,
|
|
84
|
+
depth: z.number().optional().describe('Optional: Depth of relationships to populate'),
|
|
85
|
+
draft: z.boolean().optional().describe('Optional: Whether to save as draft (default: false)'),
|
|
86
|
+
fallbackLocale: z.string().optional().describe('Optional: fallback locale code to use when requested locale is not available'),
|
|
87
|
+
locale: z.string().optional().describe('Optional: locale code to update data in (e.g., "en", "es"). Use "all" to update all locales for localized fields')
|
|
88
|
+
});
|
|
89
|
+
server.tool(`update${globalSlug.charAt(0).toUpperCase() + toCamelCase(globalSlug).slice(1)}`, `${toolSchemas.updateGlobal.description.trim()}\n\n${globals?.[globalSlug]?.description || ''}`, updateGlobalSchema.shape, async (params)=>{
|
|
90
|
+
const { depth, draft, fallbackLocale, locale, ...rest } = params;
|
|
91
|
+
const data = JSON.stringify(rest);
|
|
92
|
+
return await tool(data, draft, depth, locale, fallbackLocale);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
//# sourceMappingURL=update.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../../src/mcp/tools/global/update.ts"],"sourcesContent":["import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js'\nimport type { JSONSchema4 } from 'json-schema'\nimport type { PayloadRequest, TypedUser } from 'payload'\n\nimport { z } from 'zod'\n\nimport type { PluginMCPServerConfig } from '../../../types.js'\n\nimport { toCamelCase } from '../../../utils/camelCase.js'\nimport { convertCollectionSchemaToZod } from '../../../utils/convertCollectionSchemaToZod.js'\nimport { toolSchemas } from '../schemas.js'\n\nexport const updateGlobalTool = (\n server: McpServer,\n req: PayloadRequest,\n user: TypedUser,\n verboseLogs: boolean,\n globalSlug: string,\n globals: PluginMCPServerConfig['globals'],\n schema: JSONSchema4,\n) => {\n const tool = async (\n data: string,\n draft: boolean = false,\n depth: number = 0,\n locale?: string,\n fallbackLocale?: string,\n ): Promise<{\n content: Array<{\n text: string\n type: 'text'\n }>\n }> => {\n const payload = req.payload\n\n if (verboseLogs) {\n payload.logger.info(\n `[payload-mcp] Updating global: ${globalSlug}, draft: ${draft}${locale ? `, locale: ${locale}` : ''}`,\n )\n }\n\n try {\n // Parse the data JSON\n let parsedData: Record<string, unknown>\n try {\n parsedData = JSON.parse(data)\n if (verboseLogs) {\n payload.logger.info(\n `[payload-mcp] Parsed data for ${globalSlug}: ${JSON.stringify(parsedData)}`,\n )\n }\n } catch (_parseError) {\n payload.logger.error(`[payload-mcp] Invalid JSON data provided: ${data}`)\n const response = {\n content: [{ type: 'text' as const, text: 'Error: Invalid JSON data provided' }],\n }\n return (globals?.[globalSlug]?.overrideResponse?.(response, {}, req) || response) as {\n content: Array<{\n text: string\n type: 'text'\n }>\n }\n }\n\n const updateOptions: Parameters<typeof payload.updateGlobal>[0] = {\n slug: globalSlug,\n data: parsedData,\n depth,\n draft,\n user,\n }\n\n // Add locale parameters if provided\n if (locale) {\n updateOptions.locale = locale\n }\n if (fallbackLocale) {\n updateOptions.fallbackLocale = fallbackLocale\n }\n\n const result = await payload.updateGlobal(updateOptions)\n\n if (verboseLogs) {\n payload.logger.info(`[payload-mcp] Successfully updated global: ${globalSlug}`)\n }\n\n const response = {\n content: [\n {\n type: 'text' as const,\n text: `Global \"${globalSlug}\" updated successfully!\n\\`\\`\\`json\n${JSON.stringify(result, null, 2)}\n\\`\\`\\``,\n },\n ],\n }\n\n return (globals?.[globalSlug]?.overrideResponse?.(response, result, req) || response) as {\n content: Array<{\n text: string\n type: 'text'\n }>\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error'\n payload.logger.error(`[payload-mcp] Error updating global ${globalSlug}: ${errorMessage}`)\n\n const response = {\n content: [\n {\n type: 'text' as const,\n text: `Error updating global \"${globalSlug}\": ${errorMessage}`,\n },\n ],\n }\n\n return (globals?.[globalSlug]?.overrideResponse?.(response, {}, req) || response) as {\n content: Array<{\n text: string\n type: 'text'\n }>\n }\n }\n }\n\n if (globals?.[globalSlug]?.enabled) {\n const convertedFields = convertCollectionSchemaToZod(schema)\n\n // Make all fields optional for partial updates (PATCH-style)\n const optionalFields = Object.fromEntries(\n Object.entries(convertedFields.shape).map(([key, value]) => [key, (value as any).optional()]),\n )\n\n const updateGlobalSchema = z.object({\n ...optionalFields,\n depth: z.number().optional().describe('Optional: Depth of relationships to populate'),\n draft: z.boolean().optional().describe('Optional: Whether to save as draft (default: false)'),\n fallbackLocale: z\n .string()\n .optional()\n .describe('Optional: fallback locale code to use when requested locale is not available'),\n locale: z\n .string()\n .optional()\n .describe(\n 'Optional: locale code to update data in (e.g., \"en\", \"es\"). Use \"all\" to update all locales for localized fields',\n ),\n })\n\n server.tool(\n `update${globalSlug.charAt(0).toUpperCase() + toCamelCase(globalSlug).slice(1)}`,\n `${toolSchemas.updateGlobal.description.trim()}\\n\\n${globals?.[globalSlug]?.description || ''}`,\n updateGlobalSchema.shape,\n async (params: Record<string, unknown>) => {\n const { depth, draft, fallbackLocale, locale, ...rest } = params\n const data = JSON.stringify(rest)\n return await tool(\n data,\n draft as boolean,\n depth as number,\n locale as string,\n fallbackLocale as string,\n )\n },\n )\n }\n}\n"],"names":["z","toCamelCase","convertCollectionSchemaToZod","toolSchemas","updateGlobalTool","server","req","user","verboseLogs","globalSlug","globals","schema","tool","data","draft","depth","locale","fallbackLocale","payload","logger","info","parsedData","JSON","parse","stringify","_parseError","error","response","content","type","text","overrideResponse","updateOptions","slug","result","updateGlobal","errorMessage","Error","message","enabled","convertedFields","optionalFields","Object","fromEntries","entries","shape","map","key","value","optional","updateGlobalSchema","object","number","describe","boolean","string","charAt","toUpperCase","slice","description","trim","params","rest"],"mappings":"AAIA,SAASA,CAAC,QAAQ,MAAK;AAIvB,SAASC,WAAW,QAAQ,8BAA6B;AACzD,SAASC,4BAA4B,QAAQ,iDAAgD;AAC7F,SAASC,WAAW,QAAQ,gBAAe;AAE3C,OAAO,MAAMC,mBAAmB,CAC9BC,QACAC,KACAC,MACAC,aACAC,YACAC,SACAC;IAEA,MAAMC,OAAO,OACXC,MACAC,QAAiB,KAAK,EACtBC,QAAgB,CAAC,EACjBC,QACAC;QAOA,MAAMC,UAAUZ,IAAIY,OAAO;QAE3B,IAAIV,aAAa;YACfU,QAAQC,MAAM,CAACC,IAAI,CACjB,CAAC,+BAA+B,EAAEX,WAAW,SAAS,EAAEK,QAAQE,SAAS,CAAC,UAAU,EAAEA,QAAQ,GAAG,IAAI;QAEzG;QAEA,IAAI;YACF,sBAAsB;YACtB,IAAIK;YACJ,IAAI;gBACFA,aAAaC,KAAKC,KAAK,CAACV;gBACxB,IAAIL,aAAa;oBACfU,QAAQC,MAAM,CAACC,IAAI,CACjB,CAAC,8BAA8B,EAAEX,WAAW,EAAE,EAAEa,KAAKE,SAAS,CAACH,aAAa;gBAEhF;YACF,EAAE,OAAOI,aAAa;gBACpBP,QAAQC,MAAM,CAACO,KAAK,CAAC,CAAC,0CAA0C,EAAEb,MAAM;gBACxE,MAAMc,WAAW;oBACfC,SAAS;wBAAC;4BAAEC,MAAM;4BAAiBC,MAAM;wBAAoC;qBAAE;gBACjF;gBACA,OAAQpB,SAAS,CAACD,WAAW,EAAEsB,mBAAmBJ,UAAU,CAAC,GAAGrB,QAAQqB;YAM1E;YAEA,MAAMK,gBAA4D;gBAChEC,MAAMxB;gBACNI,MAAMQ;gBACNN;gBACAD;gBACAP;YACF;YAEA,oCAAoC;YACpC,IAAIS,QAAQ;gBACVgB,cAAchB,MAAM,GAAGA;YACzB;YACA,IAAIC,gBAAgB;gBAClBe,cAAcf,cAAc,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AAGL,QAAQ,GAAGI,QAAQ,CAAC;YACvCpC,gBAAgBjB,EACbuD,MAAM,GACNN,QAAQ,GACRI,QAAQ,CAAC;YACZrC,QAAQhB,EACLuD,MAAM,GACNN,QAAQ,GACRI,QAAQ,CACP;QAEN;QAEAhD,OAAOO,IAAI,CACT,CAAC,MAAM,EAAEH,WAAW+C,MAAM,CAAC,GAAGC,WAAW,KAAKxD,YAAYQ,YAAYiD,KAAK,CAAC,IAAI,EAChF,GAAGvD,YAAYgC,YAAY,CAACwB,WAAW,CAACC,IAAI,GAAG,IAAI,EAAElD,SAAS,CAACD,WAAW,EAAEkD,eAAe,IAAI,EAC/FT,mBAAmBL,KAAK,EACxB,OAAOgB;YACL,MAAM,EAAE9C,KAAK,EAAED,KAAK,EAAEG,cAAc,EAAED,MAAM,EAAE,GAAG8C,MAAM,GAAGD;YAC1D,MAAMhD,OAAOS,KAAKE,SAAS,CAACsC;YAC5B,OAAO,MAAMlD,KACXC,MACAC,OACAC,OACAC,QACAC;QAEJ;IAEJ;AACF,EAAC"}
|
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export declare const toolSchemas: {
|
|
3
|
+
findGlobal: {
|
|
4
|
+
description: string;
|
|
5
|
+
parameters: z.ZodObject<{
|
|
6
|
+
depth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
7
|
+
fallbackLocale: z.ZodOptional<z.ZodString>;
|
|
8
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
9
|
+
}, "strip", z.ZodTypeAny, {
|
|
10
|
+
depth: number;
|
|
11
|
+
locale?: string | undefined;
|
|
12
|
+
fallbackLocale?: string | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
depth?: number | undefined;
|
|
15
|
+
locale?: string | undefined;
|
|
16
|
+
fallbackLocale?: string | undefined;
|
|
17
|
+
}>;
|
|
18
|
+
};
|
|
3
19
|
findResources: {
|
|
4
20
|
description: string;
|
|
5
21
|
parameters: z.ZodObject<{
|
|
@@ -13,19 +29,19 @@ export declare const toolSchemas: {
|
|
|
13
29
|
}, "strip", z.ZodTypeAny, {
|
|
14
30
|
limit: number;
|
|
15
31
|
page: number;
|
|
16
|
-
sort?: string | undefined;
|
|
17
32
|
locale?: string | undefined;
|
|
33
|
+
sort?: string | undefined;
|
|
34
|
+
where?: string | undefined;
|
|
18
35
|
id?: string | number | undefined;
|
|
19
36
|
fallbackLocale?: string | undefined;
|
|
20
|
-
where?: string | undefined;
|
|
21
37
|
}, {
|
|
22
|
-
sort?: string | undefined;
|
|
23
38
|
locale?: string | undefined;
|
|
39
|
+
sort?: string | undefined;
|
|
40
|
+
where?: string | undefined;
|
|
24
41
|
id?: string | number | undefined;
|
|
25
42
|
fallbackLocale?: string | undefined;
|
|
26
43
|
limit?: number | undefined;
|
|
27
44
|
page?: number | undefined;
|
|
28
|
-
where?: string | undefined;
|
|
29
45
|
}>;
|
|
30
46
|
};
|
|
31
47
|
createResource: {
|
|
@@ -67,18 +83,18 @@ export declare const toolSchemas: {
|
|
|
67
83
|
overrideLock: boolean;
|
|
68
84
|
overwriteExistingFiles: boolean;
|
|
69
85
|
locale?: string | undefined;
|
|
86
|
+
where?: string | undefined;
|
|
70
87
|
id?: string | number | undefined;
|
|
71
88
|
fallbackLocale?: string | undefined;
|
|
72
|
-
where?: string | undefined;
|
|
73
89
|
filePath?: string | undefined;
|
|
74
90
|
}, {
|
|
75
91
|
data: string;
|
|
76
92
|
depth?: number | undefined;
|
|
77
93
|
locale?: string | undefined;
|
|
78
94
|
draft?: boolean | undefined;
|
|
95
|
+
where?: string | undefined;
|
|
79
96
|
id?: string | number | undefined;
|
|
80
97
|
fallbackLocale?: string | undefined;
|
|
81
|
-
where?: string | undefined;
|
|
82
98
|
filePath?: string | undefined;
|
|
83
99
|
overrideLock?: boolean | undefined;
|
|
84
100
|
overwriteExistingFiles?: boolean | undefined;
|
|
@@ -95,15 +111,37 @@ export declare const toolSchemas: {
|
|
|
95
111
|
}, "strip", z.ZodTypeAny, {
|
|
96
112
|
depth: number;
|
|
97
113
|
locale?: string | undefined;
|
|
114
|
+
where?: string | undefined;
|
|
98
115
|
id?: string | number | undefined;
|
|
99
116
|
fallbackLocale?: string | undefined;
|
|
100
|
-
where?: string | undefined;
|
|
101
117
|
}, {
|
|
102
118
|
depth?: number | undefined;
|
|
103
119
|
locale?: string | undefined;
|
|
120
|
+
where?: string | undefined;
|
|
104
121
|
id?: string | number | undefined;
|
|
105
122
|
fallbackLocale?: string | undefined;
|
|
106
|
-
|
|
123
|
+
}>;
|
|
124
|
+
};
|
|
125
|
+
updateGlobal: {
|
|
126
|
+
description: string;
|
|
127
|
+
parameters: z.ZodObject<{
|
|
128
|
+
data: z.ZodString;
|
|
129
|
+
depth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
130
|
+
draft: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
131
|
+
fallbackLocale: z.ZodOptional<z.ZodString>;
|
|
132
|
+
locale: z.ZodOptional<z.ZodString>;
|
|
133
|
+
}, "strip", z.ZodTypeAny, {
|
|
134
|
+
depth: number;
|
|
135
|
+
draft: boolean;
|
|
136
|
+
data: string;
|
|
137
|
+
locale?: string | undefined;
|
|
138
|
+
fallbackLocale?: string | undefined;
|
|
139
|
+
}, {
|
|
140
|
+
data: string;
|
|
141
|
+
depth?: number | undefined;
|
|
142
|
+
locale?: string | undefined;
|
|
143
|
+
draft?: boolean | undefined;
|
|
144
|
+
fallbackLocale?: string | undefined;
|
|
107
145
|
}>;
|
|
108
146
|
};
|
|
109
147
|
createCollection: {
|
|
@@ -243,16 +281,16 @@ export declare const toolSchemas: {
|
|
|
243
281
|
password: z.ZodString;
|
|
244
282
|
showHiddenFields: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
245
283
|
}, "strip", z.ZodTypeAny, {
|
|
246
|
-
|
|
284
|
+
collection: string;
|
|
247
285
|
depth: number;
|
|
286
|
+
email: string;
|
|
248
287
|
password: string;
|
|
249
|
-
collection: string;
|
|
250
288
|
overrideAccess: boolean;
|
|
251
289
|
showHiddenFields: boolean;
|
|
252
290
|
}, {
|
|
291
|
+
collection: string;
|
|
253
292
|
email: string;
|
|
254
293
|
password: string;
|
|
255
|
-
collection: string;
|
|
256
294
|
depth?: number | undefined;
|
|
257
295
|
overrideAccess?: boolean | undefined;
|
|
258
296
|
showHiddenFields?: boolean | undefined;
|
|
@@ -278,12 +316,12 @@ export declare const toolSchemas: {
|
|
|
278
316
|
password: z.ZodString;
|
|
279
317
|
token: z.ZodString;
|
|
280
318
|
}, "strip", z.ZodTypeAny, {
|
|
281
|
-
password: string;
|
|
282
319
|
collection: string;
|
|
320
|
+
password: string;
|
|
283
321
|
token: string;
|
|
284
322
|
}, {
|
|
285
|
-
password: string;
|
|
286
323
|
collection: string;
|
|
324
|
+
password: string;
|
|
287
325
|
token: string;
|
|
288
326
|
}>;
|
|
289
327
|
};
|
|
@@ -294,12 +332,12 @@ export declare const toolSchemas: {
|
|
|
294
332
|
disableEmail: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
|
|
295
333
|
email: z.ZodString;
|
|
296
334
|
}, "strip", z.ZodTypeAny, {
|
|
297
|
-
email: string;
|
|
298
335
|
collection: string;
|
|
336
|
+
email: string;
|
|
299
337
|
disableEmail: boolean;
|
|
300
338
|
}, {
|
|
301
|
-
email: string;
|
|
302
339
|
collection: string;
|
|
340
|
+
email: string;
|
|
303
341
|
disableEmail?: boolean | undefined;
|
|
304
342
|
}>;
|
|
305
343
|
};
|
|
@@ -309,11 +347,11 @@ export declare const toolSchemas: {
|
|
|
309
347
|
collection: z.ZodString;
|
|
310
348
|
email: z.ZodString;
|
|
311
349
|
}, "strip", z.ZodTypeAny, {
|
|
312
|
-
email: string;
|
|
313
350
|
collection: string;
|
|
314
|
-
}, {
|
|
315
351
|
email: string;
|
|
352
|
+
}, {
|
|
316
353
|
collection: string;
|
|
354
|
+
email: string;
|
|
317
355
|
}>;
|
|
318
356
|
};
|
|
319
357
|
createJob: {
|
|
@@ -1 +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
|
|
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkdvB,CAAA"}
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
export const toolSchemas = {
|
|
3
|
+
findGlobal: {
|
|
4
|
+
description: 'Find a Payload global singleton configuration.',
|
|
5
|
+
parameters: z.object({
|
|
6
|
+
depth: z.number().int().min(0).max(10).optional().default(0).describe('Depth of population for relationships'),
|
|
7
|
+
fallbackLocale: z.string().optional().describe('Optional: fallback locale code to use when requested locale is not available'),
|
|
8
|
+
locale: z.string().optional().describe('Optional: locale code to retrieve data in (e.g., "en", "es"). Use "all" to retrieve all locales for localized fields')
|
|
9
|
+
})
|
|
10
|
+
},
|
|
3
11
|
findResources: {
|
|
4
12
|
description: 'Find documents in a collection by ID or where clause using Find or FindByID.',
|
|
5
13
|
parameters: z.object({
|
|
@@ -55,6 +63,16 @@ export const toolSchemas = {
|
|
|
55
63
|
where: z.string().optional().describe('Optional: JSON string for where clause to delete multiple documents')
|
|
56
64
|
})
|
|
57
65
|
},
|
|
66
|
+
updateGlobal: {
|
|
67
|
+
description: 'Update a Payload global singleton configuration.',
|
|
68
|
+
parameters: z.object({
|
|
69
|
+
data: z.string().describe('JSON string containing the data to update'),
|
|
70
|
+
depth: z.number().int().min(0).max(10).optional().default(0).describe('Depth of population for relationships'),
|
|
71
|
+
draft: z.boolean().optional().default(false).describe('Whether to update as a draft'),
|
|
72
|
+
fallbackLocale: z.string().optional().describe('Optional: fallback locale code to use when requested locale is not available'),
|
|
73
|
+
locale: z.string().optional().describe('Optional: locale code to update data in (e.g., "en", "es"). Use "all" to update all locales for localized fields')
|
|
74
|
+
})
|
|
75
|
+
},
|
|
58
76
|
// Experimental Below This Line
|
|
59
77
|
createCollection: {
|
|
60
78
|
description: 'Creates a new collection with specified fields and configuration.',
|
|
@@ -1 +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 collection by ID or where clause using Find or FindByID.',\n parameters: z.object({\n id: z\n .union([z.string(), z.number()])\n .optional()\n .describe(\n 'Optional: specific document ID to retrieve. If not provided, returns all documents',\n ),\n fallbackLocale: z\n .string()\n .optional()\n .describe('Optional: fallback locale code to use when requested locale is not available'),\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 locale: z\n .string()\n .optional()\n .describe(\n 'Optional: locale code to retrieve data in (e.g., \"en\", \"es\"). Use \"all\" to retrieve all locales for localized fields',\n ),\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 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 fallbackLocale: z\n .string()\n .optional()\n .describe('Optional: fallback locale code to use when requested locale is not available'),\n locale: z\n .string()\n .optional()\n .describe(\n 'Optional: locale code to create the document in (e.g., \"en\", \"es\"). Defaults to the default locale',\n ),\n }),\n },\n\n updateResource: {\n description: 'Update documents in a collection by ID or where clause.',\n parameters: z.object({\n id: z\n .union([z.string(), z.number()])\n .optional()\n .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 fallbackLocale: z\n .string()\n .optional()\n .describe('Optional: fallback locale code to use when requested locale is not available'),\n filePath: z.string().optional().describe('Optional: absolute file path for file uploads'),\n locale: z\n .string()\n .optional()\n .describe(\n 'Optional: locale code to update the document in (e.g., \"en\", \"es\"). Defaults to the default locale',\n ),\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 collection by ID or where clause.',\n parameters: z.object({\n id: z\n .union([z.string(), z.number()])\n .optional()\n .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 fallbackLocale: z\n .string()\n .optional()\n .describe('Optional: fallback locale code to use when requested locale is not available'),\n locale: z\n .string()\n .optional()\n .describe(\n 'Optional: locale code for the operation (e.g., \"en\", \"es\"). Defaults to the default locale',\n ),\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 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 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 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 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 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 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 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 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 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","union","string","number","optional","describe","fallbackLocale","limit","int","min","max","default","locale","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,KAAK,CAAC;gBAACP,EAAEQ,MAAM;gBAAIR,EAAES,MAAM;aAAG,EAC9BC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F;IAEA2E,QAAQ;QACNnF,aAAa;QACbC,YAAYJ,EAAEK,MAAM,CAAC;YACnBkF,OAAOvF,EACJS,MAAM,GACNK,GAAG,GACHC,GAAG,CAAC,GACJL,QAAQ,GACRC,QAAQ,CAAC;YACZ6E,OAAOxF,EAAE2E,MAAM,CAAC3E,EAAEqC,GAAG,IAAI1B,QAAQ,CAAC;YAClCoE,SAAS/E,EAAEQ,MAAM,GAAGG,QAAQ,CAAC;YAC7B8E,UAAUzF,EACPS,MAAM,GACNK,GAAG,GACHC,GAAG,CAAC,GACJC,GAAG,CAAC,IACJN,QAAQ,GACRC,QAAQ,CAAC;YACZ+E,OAAO1F,EACJQ,MAAM,GACNE,QAAQ,GACRC,QAAQ,CAAC;QACd;IACF;AACF,EAAC"}
|
|
1
|
+
{"version":3,"sources":["../../../src/mcp/tools/schemas.ts"],"sourcesContent":["import { z } from 'zod'\n\nexport const toolSchemas = {\n findGlobal: {\n description: 'Find a Payload global singleton configuration.',\n parameters: z.object({\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 fallbackLocale: z\n .string()\n .optional()\n .describe('Optional: fallback locale code to use when requested locale is not available'),\n locale: z\n .string()\n .optional()\n .describe(\n 'Optional: locale code to retrieve data in (e.g., \"en\", \"es\"). Use \"all\" to retrieve all locales for localized fields',\n ),\n }),\n },\n\n findResources: {\n description: 'Find documents in a collection by ID or where clause using Find or FindByID.',\n parameters: z.object({\n id: z\n .union([z.string(), z.number()])\n .optional()\n .describe(\n 'Optional: specific document ID to retrieve. If not provided, returns all documents',\n ),\n fallbackLocale: z\n .string()\n .optional()\n .describe('Optional: fallback locale code to use when requested locale is not available'),\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 locale: z\n .string()\n .optional()\n .describe(\n 'Optional: locale code to retrieve data in (e.g., \"en\", \"es\"). Use \"all\" to retrieve all locales for localized fields',\n ),\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 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 fallbackLocale: z\n .string()\n .optional()\n .describe('Optional: fallback locale code to use when requested locale is not available'),\n locale: z\n .string()\n .optional()\n .describe(\n 'Optional: locale code to create the document in (e.g., \"en\", \"es\"). Defaults to the default locale',\n ),\n }),\n },\n\n updateResource: {\n description: 'Update documents in a collection by ID or where clause.',\n parameters: z.object({\n id: z\n .union([z.string(), z.number()])\n .optional()\n .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 fallbackLocale: z\n .string()\n .optional()\n .describe('Optional: fallback locale code to use when requested locale is not available'),\n filePath: z.string().optional().describe('Optional: absolute file path for file uploads'),\n locale: z\n .string()\n .optional()\n .describe(\n 'Optional: locale code to update the document in (e.g., \"en\", \"es\"). Defaults to the default locale',\n ),\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 collection by ID or where clause.',\n parameters: z.object({\n id: z\n .union([z.string(), z.number()])\n .optional()\n .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 fallbackLocale: z\n .string()\n .optional()\n .describe('Optional: fallback locale code to use when requested locale is not available'),\n locale: z\n .string()\n .optional()\n .describe(\n 'Optional: locale code for the operation (e.g., \"en\", \"es\"). Defaults to the default locale',\n ),\n where: z\n .string()\n .optional()\n .describe('Optional: JSON string for where clause to delete multiple documents'),\n }),\n },\n\n updateGlobal: {\n description: 'Update a Payload global singleton configuration.',\n parameters: z.object({\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 fallbackLocale: z\n .string()\n .optional()\n .describe('Optional: fallback locale code to use when requested locale is not available'),\n locale: z\n .string()\n .optional()\n .describe(\n 'Optional: locale code to update data in (e.g., \"en\", \"es\"). Use \"all\" to update all locales for localized fields',\n ),\n }),\n },\n\n // Experimental Below This Line\n createCollection: {\n description: 'Creates a new 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 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 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 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 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 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 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 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 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","findGlobal","description","parameters","object","depth","number","int","min","max","optional","default","describe","fallbackLocale","string","locale","findResources","id","union","limit","page","sort","where","createResource","data","draft","boolean","updateResource","filePath","overrideLock","overwriteExistingFiles","deleteResource","updateGlobal","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,YAAY;QACVC,aAAa;QACbC,YAAYJ,EAAEK,MAAM,CAAC;YACnBC,OAAON,EACJO,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJC,GAAG,CAAC,IACJC,QAAQ,GACRC,OAAO,CAAC,GACRC,QAAQ,CAAC;YACZC,gBAAgBd,EACbe,MAAM,GACNJ,QAAQ,GACRE,QAAQ,CAAC;YACZG,QAAQhB,EACLe,MAAM,GACNJ,QAAQ,GACRE,QAAQ,CACP;QAEN;IACF;IAEAI,eAAe;QACbd,aAAa;QACbC,YAAYJ,EAAEK,MAAM,CAAC;YACnBa,IAAIlB,EACDmB,KAAK,CAAC;gBAACnB,EAAEe,MAAM;gBAAIf,EAAEO,MAAM;aAAG,EAC9BI,QAAQ,GACRE,QAAQ,CACP;YAEJC,gBAAgBd,EACbe,MAAM,GACNJ,QAAQ,GACRE,QAAQ,CAAC;YACZO,OAAOpB,EACJO,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GAAG,4BACPC,GAAG,CAAC,KAAK,2BACTC,QAAQ,GACRC,OAAO,CAAC,IACRC,QAAQ,CAAC;YACZG,QAAQhB,EACLe,MAAM,GACNJ,QAAQ,GACRE,QAAQ,CACP;YAEJQ,MAAMrB,EACHO,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GAAG,2BACPE,QAAQ,GACRC,OAAO,CAAC,GACRC,QAAQ,CAAC;YACZS,MAAMtB,EACHe,MAAM,GACNJ,QAAQ,GACRE,QAAQ,CAAC;YACZU,OAAOvB,EACJe,MAAM,GACNJ,QAAQ,GACRE,QAAQ,CACP;QAEN;IACF;IAEAW,gBAAgB;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ACHC,GAAG,CAAC,GACJE,QAAQ,GACRE,QAAQ,CAAC;YACZ6E,OAAO1F,EAAE6E,MAAM,CAAC7E,EAAEuC,GAAG,IAAI1B,QAAQ,CAAC;YAClCoE,SAASjF,EAAEe,MAAM,GAAGF,QAAQ,CAAC;YAC7B8E,UAAU3F,EACPO,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJC,GAAG,CAAC,IACJC,QAAQ,GACRE,QAAQ,CAAC;YACZ+E,OAAO5F,EACJe,MAAM,GACNJ,QAAQ,GACRE,QAAQ,CAAC;QACd;IACF;AACF,EAAC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { CollectionConfig, CollectionSlug, PayloadRequest, TypedUser } from 'payload';
|
|
1
|
+
import type { CollectionConfig, CollectionSlug, GlobalSlug, PayloadRequest, TypedUser } from 'payload';
|
|
2
2
|
import type { z } from 'zod';
|
|
3
3
|
import { type ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
4
4
|
export type PluginMCPServerConfig = {
|
|
@@ -101,6 +101,39 @@ export type PluginMCPServerConfig = {
|
|
|
101
101
|
};
|
|
102
102
|
};
|
|
103
103
|
};
|
|
104
|
+
/**
|
|
105
|
+
* Set the globals that should be available as resources via MCP.
|
|
106
|
+
* Globals are singleton configuration objects (e.g., site settings, navigation).
|
|
107
|
+
* Note: Globals only support find and update operations.
|
|
108
|
+
*/
|
|
109
|
+
globals?: Partial<Record<GlobalSlug, {
|
|
110
|
+
/**
|
|
111
|
+
* Set the description of the global. This is used by MCP clients to determine when to use the global as a resource.
|
|
112
|
+
*/
|
|
113
|
+
description?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Set the enabled capabilities of the global. Admins can then allow or disallow the use of the capability by MCP clients.
|
|
116
|
+
* Note: Globals only support find and update operations as they are singletons.
|
|
117
|
+
*/
|
|
118
|
+
enabled: {
|
|
119
|
+
find?: boolean;
|
|
120
|
+
update?: boolean;
|
|
121
|
+
} | boolean;
|
|
122
|
+
/**
|
|
123
|
+
* Override the response generated by the MCP client. This allows you to modify the response that is sent to the MCP client. This is useful for adding additional data to the response, data normalization, or verifying data.
|
|
124
|
+
*/
|
|
125
|
+
overrideResponse?: (response: {
|
|
126
|
+
content: Array<{
|
|
127
|
+
text: string;
|
|
128
|
+
type: string;
|
|
129
|
+
}>;
|
|
130
|
+
}, doc: Record<string, unknown>, req: PayloadRequest) => {
|
|
131
|
+
content: Array<{
|
|
132
|
+
text: string;
|
|
133
|
+
type: string;
|
|
134
|
+
}>;
|
|
135
|
+
};
|
|
136
|
+
}>>;
|
|
104
137
|
/**
|
|
105
138
|
* MCP Server options.
|
|
106
139
|
*/
|
|
@@ -310,6 +343,11 @@ export type MCPAccessSettings = {
|
|
|
310
343
|
find?: boolean;
|
|
311
344
|
update?: boolean;
|
|
312
345
|
};
|
|
346
|
+
custom?: Record<string, boolean>;
|
|
347
|
+
globals?: {
|
|
348
|
+
find?: boolean;
|
|
349
|
+
update?: boolean;
|
|
350
|
+
};
|
|
313
351
|
jobs?: {
|
|
314
352
|
create?: boolean;
|
|
315
353
|
run?: boolean;
|
|
@@ -320,6 +358,7 @@ export type MCPAccessSettings = {
|
|
|
320
358
|
'payload-mcp-tool'?: Record<string, boolean>;
|
|
321
359
|
user: TypedUser;
|
|
322
360
|
} & Record<string, unknown>;
|
|
361
|
+
export type EntityConfig = PluginMCPServerConfig['collections'] | PluginMCPServerConfig['globals'];
|
|
323
362
|
export type FieldDefinition = {
|
|
324
363
|
description?: string;
|
|
325
364
|
name: string;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB,EAChB,cAAc,EACd,UAA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