@payloadcms/plugin-mcp 3.86.0-internal.ac46214 → 4.0.0-canary.1

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.
Files changed (368) hide show
  1. package/README.md +2 -2
  2. package/bin.js +39 -0
  3. package/dist/collection/getAccessField.d.ts +12 -0
  4. package/dist/collection/getAccessField.d.ts.map +1 -0
  5. package/dist/collection/getAccessField.js +57 -0
  6. package/dist/collection/getAccessField.js.map +1 -0
  7. package/dist/collection/index.d.ts +6 -0
  8. package/dist/collection/index.d.ts.map +1 -0
  9. package/dist/collection/index.js +60 -0
  10. package/dist/collection/index.js.map +1 -0
  11. package/dist/components/AccessField/index.client.d.ts +10 -0
  12. package/dist/components/AccessField/index.client.d.ts.map +1 -0
  13. package/dist/components/AccessField/index.client.js +305 -0
  14. package/dist/components/AccessField/index.client.js.map +1 -0
  15. package/dist/components/AccessField/index.css +93 -0
  16. package/dist/defineTool.d.ts +26 -0
  17. package/dist/defineTool.d.ts.map +1 -0
  18. package/dist/defineTool.js +37 -0
  19. package/dist/defineTool.js.map +1 -0
  20. package/dist/endpoint/access.d.ts +10 -0
  21. package/dist/endpoint/access.d.ts.map +1 -0
  22. package/dist/endpoint/access.js +106 -0
  23. package/dist/endpoint/access.js.map +1 -0
  24. package/dist/endpoint/index.d.ts +3 -0
  25. package/dist/endpoint/index.d.ts.map +1 -0
  26. package/dist/endpoint/index.js +36 -0
  27. package/dist/endpoint/index.js.map +1 -0
  28. package/dist/exports/client.d.ts +2 -0
  29. package/dist/exports/client.d.ts.map +1 -0
  30. package/dist/exports/client.js +4 -0
  31. package/dist/exports/client.js.map +1 -0
  32. package/dist/index.d.ts +4 -7
  33. package/dist/index.d.ts.map +1 -1
  34. package/dist/index.js +44 -67
  35. package/dist/index.js.map +1 -1
  36. package/dist/mcp/buildMcpServer.d.ts +19 -0
  37. package/dist/mcp/buildMcpServer.d.ts.map +1 -0
  38. package/dist/mcp/buildMcpServer.js +199 -0
  39. package/dist/mcp/buildMcpServer.js.map +1 -0
  40. package/dist/mcp/builtin/collections/authTools.d.ts +7 -0
  41. package/dist/mcp/builtin/collections/authTools.d.ts.map +1 -0
  42. package/dist/mcp/builtin/collections/authTools.js +250 -0
  43. package/dist/mcp/builtin/collections/authTools.js.map +1 -0
  44. package/dist/mcp/builtin/collections/createTool.d.ts +2 -0
  45. package/dist/mcp/builtin/collections/createTool.d.ts.map +1 -0
  46. package/dist/mcp/builtin/collections/createTool.js +94 -0
  47. package/dist/mcp/builtin/collections/createTool.js.map +1 -0
  48. package/dist/mcp/builtin/collections/deleteTool.d.ts +2 -0
  49. package/dist/mcp/builtin/collections/deleteTool.d.ts.map +1 -0
  50. package/dist/mcp/builtin/collections/deleteTool.js +102 -0
  51. package/dist/mcp/builtin/collections/deleteTool.js.map +1 -0
  52. package/dist/mcp/builtin/collections/findTool.d.ts +2 -0
  53. package/dist/mcp/builtin/collections/findTool.d.ts.map +1 -0
  54. package/dist/mcp/builtin/collections/findTool.js +144 -0
  55. package/dist/mcp/builtin/collections/findTool.js.map +1 -0
  56. package/dist/mcp/builtin/collections/formatCollectionError.d.ts +9 -0
  57. package/dist/mcp/builtin/collections/formatCollectionError.d.ts.map +1 -0
  58. package/dist/mcp/builtin/collections/formatCollectionError.js +60 -0
  59. package/dist/mcp/builtin/collections/formatCollectionError.js.map +1 -0
  60. package/dist/mcp/builtin/collections/getCollectionSchemaTool.d.ts +2 -0
  61. package/dist/mcp/builtin/collections/getCollectionSchemaTool.d.ts.map +1 -0
  62. package/dist/mcp/builtin/collections/getCollectionSchemaTool.js +35 -0
  63. package/dist/mcp/builtin/collections/getCollectionSchemaTool.js.map +1 -0
  64. package/dist/mcp/builtin/collections/updateTool.d.ts +2 -0
  65. package/dist/mcp/builtin/collections/updateTool.d.ts.map +1 -0
  66. package/dist/mcp/builtin/collections/updateTool.js +199 -0
  67. package/dist/mcp/builtin/collections/updateTool.js.map +1 -0
  68. package/dist/mcp/builtin/getConfigInfoTool.d.ts +2 -0
  69. package/dist/mcp/builtin/getConfigInfoTool.d.ts.map +1 -0
  70. package/dist/mcp/builtin/getConfigInfoTool.js +49 -0
  71. package/dist/mcp/builtin/getConfigInfoTool.js.map +1 -0
  72. package/dist/mcp/builtin/globals/findTool.d.ts +2 -0
  73. package/dist/mcp/builtin/globals/findTool.d.ts.map +1 -0
  74. package/dist/mcp/builtin/globals/findTool.js +76 -0
  75. package/dist/mcp/builtin/globals/findTool.js.map +1 -0
  76. package/dist/mcp/builtin/globals/getGlobalSchemaTool.d.ts +2 -0
  77. package/dist/mcp/builtin/globals/getGlobalSchemaTool.d.ts.map +1 -0
  78. package/dist/mcp/builtin/globals/getGlobalSchemaTool.js +35 -0
  79. package/dist/mcp/builtin/globals/getGlobalSchemaTool.js.map +1 -0
  80. package/dist/mcp/builtin/globals/updateTool.d.ts +2 -0
  81. package/dist/mcp/builtin/globals/updateTool.d.ts.map +1 -0
  82. package/dist/mcp/builtin/globals/updateTool.js +94 -0
  83. package/dist/mcp/builtin/globals/updateTool.js.map +1 -0
  84. package/dist/mcp/builtin/validateEntityData.d.ts +14 -0
  85. package/dist/mcp/builtin/validateEntityData.d.ts.map +1 -0
  86. package/dist/mcp/builtin/validateEntityData.js +82 -0
  87. package/dist/mcp/builtin/validateEntityData.js.map +1 -0
  88. package/dist/mcp/builtinTools.d.ts +105 -0
  89. package/dist/mcp/builtinTools.d.ts.map +1 -0
  90. package/dist/mcp/builtinTools.js +107 -0
  91. package/dist/mcp/builtinTools.js.map +1 -0
  92. package/dist/mcp/sanitizeMCPConfig.d.ts +17 -0
  93. package/dist/mcp/sanitizeMCPConfig.d.ts.map +1 -0
  94. package/dist/mcp/sanitizeMCPConfig.js +188 -0
  95. package/dist/mcp/sanitizeMCPConfig.js.map +1 -0
  96. package/dist/stdio.d.ts +8 -0
  97. package/dist/stdio.d.ts.map +1 -0
  98. package/dist/stdio.js +89 -0
  99. package/dist/stdio.js.map +1 -0
  100. package/dist/types.d.ts +251 -455
  101. package/dist/types.d.ts.map +1 -1
  102. package/dist/types.js +6 -1
  103. package/dist/types.js.map +1 -1
  104. package/dist/utils/camelCase.d.ts.map +1 -1
  105. package/dist/utils/getLogger.d.ts +10 -0
  106. package/dist/utils/getLogger.d.ts.map +1 -0
  107. package/dist/utils/getLogger.js +22 -0
  108. package/dist/utils/getLogger.js.map +1 -0
  109. package/dist/utils/getPluginConfig.d.ts +12 -0
  110. package/dist/utils/getPluginConfig.d.ts.map +1 -0
  111. package/dist/utils/getPluginConfig.js +15 -0
  112. package/dist/utils/getPluginConfig.js.map +1 -0
  113. package/dist/utils/localAPIDefaults.d.ts +20 -0
  114. package/dist/utils/localAPIDefaults.d.ts.map +1 -0
  115. package/dist/utils/localAPIDefaults.js +19 -0
  116. package/dist/utils/localAPIDefaults.js.map +1 -0
  117. package/dist/utils/resolveProjectRoot.d.ts +7 -0
  118. package/dist/utils/resolveProjectRoot.d.ts.map +1 -0
  119. package/dist/utils/resolveProjectRoot.js +15 -0
  120. package/dist/utils/resolveProjectRoot.js.map +1 -0
  121. package/dist/utils/schemaConversion/getEntityInputSchema.d.ts +11 -0
  122. package/dist/utils/schemaConversion/getEntityInputSchema.d.ts.map +1 -0
  123. package/dist/utils/schemaConversion/getEntityInputSchema.js +34 -0
  124. package/dist/utils/schemaConversion/getEntityInputSchema.js.map +1 -0
  125. package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.d.ts +2 -2
  126. package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.d.ts.map +1 -1
  127. package/dist/utils/schemaConversion/removeVirtualFieldsFromSchema.js.map +1 -1
  128. package/dist/utils/schemaConversion/sanitizeEntitySchema.d.ts +15 -0
  129. package/dist/utils/schemaConversion/sanitizeEntitySchema.d.ts.map +1 -0
  130. package/dist/utils/schemaConversion/sanitizeEntitySchema.js +464 -0
  131. package/dist/utils/schemaConversion/sanitizeEntitySchema.js.map +1 -0
  132. package/dist/utils/schemaConversion/sanitizeEntitySchema.spec.js +158 -0
  133. package/dist/utils/schemaConversion/sanitizeEntitySchema.spec.js.map +1 -0
  134. package/dist/utils/toStandardSchema.d.ts +5 -0
  135. package/dist/utils/toStandardSchema.d.ts.map +1 -0
  136. package/dist/utils/toStandardSchema.js +4 -0
  137. package/dist/utils/toStandardSchema.js.map +1 -0
  138. package/dist/utils/whereSchema.d.ts +9 -0
  139. package/dist/utils/whereSchema.d.ts.map +1 -0
  140. package/dist/utils/whereSchema.js +13 -0
  141. package/dist/utils/whereSchema.js.map +1 -0
  142. package/package.json +35 -10
  143. package/src/collection/getAccessField.ts +64 -0
  144. package/src/collection/index.ts +64 -0
  145. package/src/components/AccessField/index.client.tsx +347 -0
  146. package/src/components/AccessField/index.css +93 -0
  147. package/src/defineTool.ts +44 -0
  148. package/src/endpoint/access.ts +132 -0
  149. package/src/endpoint/index.ts +35 -0
  150. package/src/exports/client.ts +2 -0
  151. package/src/index.ts +35 -85
  152. package/src/mcp/buildMcpServer.ts +257 -0
  153. package/src/mcp/builtin/collections/authTools.ts +233 -0
  154. package/src/mcp/builtin/collections/createTool.ts +112 -0
  155. package/src/mcp/builtin/collections/deleteTool.ts +116 -0
  156. package/src/mcp/builtin/collections/findTool.ts +177 -0
  157. package/src/mcp/builtin/collections/formatCollectionError.ts +84 -0
  158. package/src/mcp/builtin/collections/getCollectionSchemaTool.ts +28 -0
  159. package/src/mcp/builtin/collections/updateTool.ts +211 -0
  160. package/src/mcp/builtin/getConfigInfoTool.ts +44 -0
  161. package/src/mcp/builtin/globals/findTool.ts +96 -0
  162. package/src/mcp/builtin/globals/getGlobalSchemaTool.ts +28 -0
  163. package/src/mcp/builtin/globals/updateTool.ts +115 -0
  164. package/src/mcp/builtin/validateEntityData.ts +132 -0
  165. package/src/mcp/builtinTools.ts +98 -0
  166. package/src/mcp/sanitizeMCPConfig.ts +260 -0
  167. package/src/stdio.ts +98 -0
  168. package/src/types.ts +290 -490
  169. package/src/utils/getLogger.ts +22 -0
  170. package/src/utils/getPluginConfig.ts +24 -0
  171. package/src/utils/localAPIDefaults.ts +22 -0
  172. package/src/utils/resolveProjectRoot.ts +17 -0
  173. package/src/utils/schemaConversion/getEntityInputSchema.ts +78 -0
  174. package/src/utils/schemaConversion/removeVirtualFieldsFromSchema.ts +3 -3
  175. package/src/utils/schemaConversion/sanitizeEntitySchema.spec.ts +103 -0
  176. package/src/utils/schemaConversion/sanitizeEntitySchema.ts +529 -0
  177. package/src/utils/toStandardSchema.ts +9 -0
  178. package/src/utils/whereSchema.ts +24 -0
  179. package/dist/collections/createApiKeysCollection.d.ts +0 -7
  180. package/dist/collections/createApiKeysCollection.d.ts.map +0 -1
  181. package/dist/collections/createApiKeysCollection.js +0 -317
  182. package/dist/collections/createApiKeysCollection.js.map +0 -1
  183. package/dist/defaults.d.ts +0 -4
  184. package/dist/defaults.d.ts.map +0 -1
  185. package/dist/defaults.js +0 -5
  186. package/dist/defaults.js.map +0 -1
  187. package/dist/endpoints/mcp.d.ts +0 -4
  188. package/dist/endpoints/mcp.d.ts.map +0 -1
  189. package/dist/endpoints/mcp.js +0 -71
  190. package/dist/endpoints/mcp.js.map +0 -1
  191. package/dist/mcp/createRequest.d.ts +0 -3
  192. package/dist/mcp/createRequest.d.ts.map +0 -1
  193. package/dist/mcp/createRequest.js +0 -14
  194. package/dist/mcp/createRequest.js.map +0 -1
  195. package/dist/mcp/getMcpHandler.d.ts +0 -4
  196. package/dist/mcp/getMcpHandler.d.ts.map +0 -1
  197. package/dist/mcp/getMcpHandler.js +0 -231
  198. package/dist/mcp/getMcpHandler.js.map +0 -1
  199. package/dist/mcp/helpers/config.d.ts +0 -22
  200. package/dist/mcp/helpers/config.d.ts.map +0 -1
  201. package/dist/mcp/helpers/config.js +0 -153
  202. package/dist/mcp/helpers/config.js.map +0 -1
  203. package/dist/mcp/helpers/fields.d.ts +0 -19
  204. package/dist/mcp/helpers/fields.d.ts.map +0 -1
  205. package/dist/mcp/helpers/fields.js +0 -102
  206. package/dist/mcp/helpers/fields.js.map +0 -1
  207. package/dist/mcp/helpers/fileValidation.d.ts +0 -67
  208. package/dist/mcp/helpers/fileValidation.d.ts.map +0 -1
  209. package/dist/mcp/helpers/fileValidation.js +0 -267
  210. package/dist/mcp/helpers/fileValidation.js.map +0 -1
  211. package/dist/mcp/registerTool.d.ts +0 -6
  212. package/dist/mcp/registerTool.d.ts.map +0 -1
  213. package/dist/mcp/registerTool.js +0 -18
  214. package/dist/mcp/registerTool.js.map +0 -1
  215. package/dist/mcp/tools/auth/auth.d.ts +0 -4
  216. package/dist/mcp/tools/auth/auth.d.ts.map +0 -1
  217. package/dist/mcp/tools/auth/auth.js +0 -57
  218. package/dist/mcp/tools/auth/auth.js.map +0 -1
  219. package/dist/mcp/tools/auth/forgotPassword.d.ts +0 -4
  220. package/dist/mcp/tools/auth/forgotPassword.d.ts.map +0 -1
  221. package/dist/mcp/tools/auth/forgotPassword.js +0 -48
  222. package/dist/mcp/tools/auth/forgotPassword.js.map +0 -1
  223. package/dist/mcp/tools/auth/login.d.ts +0 -4
  224. package/dist/mcp/tools/auth/login.d.ts.map +0 -1
  225. package/dist/mcp/tools/auth/login.js +0 -51
  226. package/dist/mcp/tools/auth/login.js.map +0 -1
  227. package/dist/mcp/tools/auth/resetPassword.d.ts +0 -4
  228. package/dist/mcp/tools/auth/resetPassword.d.ts.map +0 -1
  229. package/dist/mcp/tools/auth/resetPassword.js +0 -49
  230. package/dist/mcp/tools/auth/resetPassword.js.map +0 -1
  231. package/dist/mcp/tools/auth/unlock.d.ts +0 -4
  232. package/dist/mcp/tools/auth/unlock.d.ts.map +0 -1
  233. package/dist/mcp/tools/auth/unlock.js +0 -48
  234. package/dist/mcp/tools/auth/unlock.js.map +0 -1
  235. package/dist/mcp/tools/auth/verify.d.ts +0 -4
  236. package/dist/mcp/tools/auth/verify.d.ts.map +0 -1
  237. package/dist/mcp/tools/auth/verify.js +0 -45
  238. package/dist/mcp/tools/auth/verify.js.map +0 -1
  239. package/dist/mcp/tools/collection/create.d.ts +0 -10
  240. package/dist/mcp/tools/collection/create.d.ts.map +0 -1
  241. package/dist/mcp/tools/collection/create.js +0 -139
  242. package/dist/mcp/tools/collection/create.js.map +0 -1
  243. package/dist/mcp/tools/collection/delete.d.ts +0 -10
  244. package/dist/mcp/tools/collection/delete.d.ts.map +0 -1
  245. package/dist/mcp/tools/collection/delete.js +0 -154
  246. package/dist/mcp/tools/collection/delete.js.map +0 -1
  247. package/dist/mcp/tools/collection/find.d.ts +0 -10
  248. package/dist/mcp/tools/collection/find.d.ts.map +0 -1
  249. package/dist/mcp/tools/collection/find.js +0 -165
  250. package/dist/mcp/tools/collection/find.js.map +0 -1
  251. package/dist/mcp/tools/collection/update.d.ts +0 -10
  252. package/dist/mcp/tools/collection/update.d.ts.map +0 -1
  253. package/dist/mcp/tools/collection/update.js +0 -209
  254. package/dist/mcp/tools/collection/update.js.map +0 -1
  255. package/dist/mcp/tools/config/find.d.ts +0 -10
  256. package/dist/mcp/tools/config/find.d.ts.map +0 -1
  257. package/dist/mcp/tools/config/find.js +0 -97
  258. package/dist/mcp/tools/config/find.js.map +0 -1
  259. package/dist/mcp/tools/config/update.d.ts +0 -10
  260. package/dist/mcp/tools/config/update.d.ts.map +0 -1
  261. package/dist/mcp/tools/config/update.js +0 -215
  262. package/dist/mcp/tools/config/update.js.map +0 -1
  263. package/dist/mcp/tools/global/find.d.ts +0 -5
  264. package/dist/mcp/tools/global/find.d.ts.map +0 -1
  265. package/dist/mcp/tools/global/find.js +0 -82
  266. package/dist/mcp/tools/global/find.js.map +0 -1
  267. package/dist/mcp/tools/global/update.d.ts +0 -6
  268. package/dist/mcp/tools/global/update.d.ts.map +0 -1
  269. package/dist/mcp/tools/global/update.js +0 -124
  270. package/dist/mcp/tools/global/update.js.map +0 -1
  271. package/dist/mcp/tools/job/create.d.ts +0 -10
  272. package/dist/mcp/tools/job/create.d.ts.map +0 -1
  273. package/dist/mcp/tools/job/create.js +0 -293
  274. package/dist/mcp/tools/job/create.js.map +0 -1
  275. package/dist/mcp/tools/job/run.d.ts +0 -10
  276. package/dist/mcp/tools/job/run.d.ts.map +0 -1
  277. package/dist/mcp/tools/job/run.js +0 -129
  278. package/dist/mcp/tools/job/run.js.map +0 -1
  279. package/dist/mcp/tools/job/update.d.ts +0 -11
  280. package/dist/mcp/tools/job/update.d.ts.map +0 -1
  281. package/dist/mcp/tools/job/update.js +0 -186
  282. package/dist/mcp/tools/job/update.js.map +0 -1
  283. package/dist/mcp/tools/resource/create.d.ts +0 -6
  284. package/dist/mcp/tools/resource/create.d.ts.map +0 -1
  285. package/dist/mcp/tools/resource/create.js +0 -124
  286. package/dist/mcp/tools/resource/create.js.map +0 -1
  287. package/dist/mcp/tools/resource/delete.d.ts +0 -5
  288. package/dist/mcp/tools/resource/delete.d.ts.map +0 -1
  289. package/dist/mcp/tools/resource/delete.js +0 -151
  290. package/dist/mcp/tools/resource/delete.js.map +0 -1
  291. package/dist/mcp/tools/resource/find.d.ts +0 -5
  292. package/dist/mcp/tools/resource/find.d.ts.map +0 -1
  293. package/dist/mcp/tools/resource/find.js +0 -170
  294. package/dist/mcp/tools/resource/find.js.map +0 -1
  295. package/dist/mcp/tools/resource/update.d.ts +0 -6
  296. package/dist/mcp/tools/resource/update.d.ts.map +0 -1
  297. package/dist/mcp/tools/resource/update.js +0 -256
  298. package/dist/mcp/tools/resource/update.js.map +0 -1
  299. package/dist/mcp/tools/schemas.d.ts +0 -457
  300. package/dist/mcp/tools/schemas.d.ts.map +0 -1
  301. package/dist/mcp/tools/schemas.js +0 -243
  302. package/dist/mcp/tools/schemas.js.map +0 -1
  303. package/dist/utils/adminEntitySettings.d.ts +0 -17
  304. package/dist/utils/adminEntitySettings.d.ts.map +0 -1
  305. package/dist/utils/adminEntitySettings.js +0 -41
  306. package/dist/utils/adminEntitySettings.js.map +0 -1
  307. package/dist/utils/createApiKeyFields.d.ts +0 -15
  308. package/dist/utils/createApiKeyFields.d.ts.map +0 -1
  309. package/dist/utils/createApiKeyFields.js +0 -57
  310. package/dist/utils/createApiKeyFields.js.map +0 -1
  311. package/dist/utils/getEnabledSlugs.d.ts +0 -13
  312. package/dist/utils/getEnabledSlugs.d.ts.map +0 -1
  313. package/dist/utils/getEnabledSlugs.js +0 -32
  314. package/dist/utils/getEnabledSlugs.js.map +0 -1
  315. package/dist/utils/schemaConversion/convertCollectionSchemaToZod.d.ts +0 -3
  316. package/dist/utils/schemaConversion/convertCollectionSchemaToZod.d.ts.map +0 -1
  317. package/dist/utils/schemaConversion/convertCollectionSchemaToZod.js +0 -43
  318. package/dist/utils/schemaConversion/convertCollectionSchemaToZod.js.map +0 -1
  319. package/dist/utils/schemaConversion/sanitizeJsonSchema.d.ts +0 -13
  320. package/dist/utils/schemaConversion/sanitizeJsonSchema.d.ts.map +0 -1
  321. package/dist/utils/schemaConversion/sanitizeJsonSchema.js +0 -56
  322. package/dist/utils/schemaConversion/sanitizeJsonSchema.js.map +0 -1
  323. package/dist/utils/schemaConversion/simplifyRelationshipFields.d.ts +0 -20
  324. package/dist/utils/schemaConversion/simplifyRelationshipFields.d.ts.map +0 -1
  325. package/dist/utils/schemaConversion/simplifyRelationshipFields.js +0 -53
  326. package/dist/utils/schemaConversion/simplifyRelationshipFields.js.map +0 -1
  327. package/dist/utils/schemaConversion/transformPointFields.d.ts +0 -3
  328. package/dist/utils/schemaConversion/transformPointFields.d.ts.map +0 -1
  329. package/dist/utils/schemaConversion/transformPointFields.js +0 -51
  330. package/dist/utils/schemaConversion/transformPointFields.js.map +0 -1
  331. package/src/collections/createApiKeysCollection.ts +0 -373
  332. package/src/defaults.ts +0 -3
  333. package/src/endpoints/mcp.ts +0 -91
  334. package/src/mcp/createRequest.ts +0 -13
  335. package/src/mcp/getMcpHandler.ts +0 -545
  336. package/src/mcp/helpers/config.ts +0 -213
  337. package/src/mcp/helpers/fields.ts +0 -154
  338. package/src/mcp/helpers/fileValidation.ts +0 -362
  339. package/src/mcp/registerTool.ts +0 -22
  340. package/src/mcp/tools/auth/auth.ts +0 -71
  341. package/src/mcp/tools/auth/forgotPassword.ts +0 -70
  342. package/src/mcp/tools/auth/login.ts +0 -72
  343. package/src/mcp/tools/auth/resetPassword.ts +0 -61
  344. package/src/mcp/tools/auth/unlock.ts +0 -64
  345. package/src/mcp/tools/auth/verify.ts +0 -57
  346. package/src/mcp/tools/collection/create.ts +0 -210
  347. package/src/mcp/tools/collection/delete.ts +0 -211
  348. package/src/mcp/tools/collection/find.ts +0 -224
  349. package/src/mcp/tools/collection/update.ts +0 -290
  350. package/src/mcp/tools/config/find.ts +0 -128
  351. package/src/mcp/tools/config/update.ts +0 -280
  352. package/src/mcp/tools/global/find.ts +0 -128
  353. package/src/mcp/tools/global/update.ts +0 -207
  354. package/src/mcp/tools/job/create.ts +0 -416
  355. package/src/mcp/tools/job/run.ts +0 -167
  356. package/src/mcp/tools/job/update.ts +0 -274
  357. package/src/mcp/tools/resource/create.ts +0 -211
  358. package/src/mcp/tools/resource/delete.ts +0 -218
  359. package/src/mcp/tools/resource/find.ts +0 -246
  360. package/src/mcp/tools/resource/update.ts +0 -383
  361. package/src/mcp/tools/schemas.ts +0 -520
  362. package/src/utils/adminEntitySettings.ts +0 -40
  363. package/src/utils/createApiKeyFields.ts +0 -72
  364. package/src/utils/getEnabledSlugs.ts +0 -42
  365. package/src/utils/schemaConversion/convertCollectionSchemaToZod.ts +0 -52
  366. package/src/utils/schemaConversion/sanitizeJsonSchema.ts +0 -62
  367. package/src/utils/schemaConversion/simplifyRelationshipFields.ts +0 -65
  368. package/src/utils/schemaConversion/transformPointFields.ts +0 -55
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/mcp/builtin/collections/updateTool.ts"],"sourcesContent":["import type { SelectType, Where } from 'payload'\n\nimport { z } from 'zod'\n\nimport { defineCollectionTool } from '../../../defineTool.js'\nimport { getLogger } from '../../../utils/getLogger.js'\nimport {\n getCollectionVirtualFieldNames,\n stripVirtualFields,\n} from '../../../utils/getVirtualFieldNames.js'\nimport { localAPIDefaults } from '../../../utils/localAPIDefaults.js'\nimport { getCollectionInputSchema } from '../../../utils/schemaConversion/getEntityInputSchema.js'\nimport { transformPointDataToPayload } from '../../../utils/transformPointDataToPayload.js'\nimport { whereSchema } from '../../../utils/whereSchema.js'\nimport { validateCollectionData } from '../validateEntityData.js'\nimport { formatCollectionError } from './formatCollectionError.js'\n\nconst DEFAULT_DESCRIPTION =\n 'Update documents in any collection by passing the collection slug and data.'\n\nexport const updateDocumentTool = defineCollectionTool({\n description: DEFAULT_DESCRIPTION,\n input: z.object({\n id: z.union([z.string(), z.number()]).describe('The ID of the document to update').optional(),\n data: z.record(z.string(), z.unknown()).describe('The fields to update'),\n depth: z\n .number()\n .describe('How many levels deep to populate relationships')\n .optional()\n .default(0),\n draft: z\n .boolean()\n .describe('Whether to update the document as a draft')\n .optional()\n .default(false),\n fallbackLocale: z\n .string()\n .describe('Optional: fallback locale code to use when requested locale is not available')\n .optional(),\n filePath: z.string().describe('File path for file uploads').optional(),\n locale: z\n .string()\n .describe(\n 'Optional: locale code to update the document in (e.g., \"en\", \"es\"). Defaults to the default locale',\n )\n .optional(),\n overrideLock: z\n .boolean()\n .describe('Whether to override document locks')\n .optional()\n .default(true),\n overwriteExistingFiles: z\n .boolean()\n .describe('Whether to overwrite existing files')\n .optional()\n .default(false),\n select: z\n .string()\n .describe(\n \"Optional: define exactly which fields you'd like to return in the response (JSON), e.g., '{\\\"title\\\": true}'\",\n )\n .optional(),\n where: whereSchema\n .describe(\n 'Where clause to update multiple documents. Use field names with Payload operators, and/or arrays for grouping. Example: {\"title\":{\"contains\":\"test\"}}',\n )\n .optional(),\n }),\n}).handler(async ({ authorizedMCP, collectionSlug, input, req }) => {\n const payload = req.payload\n const logger = getLogger({ payload })\n\n const {\n id,\n data,\n depth,\n draft,\n fallbackLocale,\n filePath,\n locale,\n overrideLock,\n overwriteExistingFiles,\n select,\n where,\n } = input\n\n logger.info(\n `Updating document in collection: ${collectionSlug}${id ? ` with ID: ${id}` : ' with where clause'}, draft: ${draft}${locale ? `, locale: ${locale}` : ''}`,\n )\n\n try {\n if (!id && !where) {\n return {\n content: [{ type: 'text', text: 'Error: Either id or where clause must be provided' }],\n }\n }\n\n const virtualFieldNames = getCollectionVirtualFieldNames(payload.config, collectionSlug)\n const inputData = stripVirtualFields(data, virtualFieldNames)\n const validationError = validateCollectionData({\n collectionSlug,\n data: inputData,\n partial: true,\n req,\n })\n\n if (validationError) {\n return validationError\n }\n\n const parsedData = transformPointDataToPayload(inputData)\n\n const whereClause: Where = where ?? {}\n\n let selectClause: SelectType | undefined\n if (select) {\n try {\n selectClause = JSON.parse(select) as SelectType\n } catch {\n logger.warn(`Invalid select clause JSON: ${select}`)\n return { content: [{ type: 'text', text: 'Error: Invalid JSON in select clause' }] }\n }\n }\n\n if (id) {\n const result = await payload.update({\n id,\n collection: collectionSlug,\n data: parsedData,\n depth,\n draft,\n overrideLock,\n req,\n ...localAPIDefaults(authorizedMCP),\n ...(filePath ? { filePath } : {}),\n ...(overwriteExistingFiles ? { overwriteExistingFiles } : {}),\n ...(locale ? { locale } : {}),\n ...(fallbackLocale ? { fallbackLocale } : {}),\n ...(selectClause ? { select: selectClause } : {}),\n })\n\n return {\n content: [\n {\n type: 'text',\n text: `Document updated successfully in collection \"${collectionSlug}\"!\\nUpdated document:\\n\\`\\`\\`json\\n${JSON.stringify(result)}\\n\\`\\`\\``,\n },\n ],\n doc: result as Record<string, unknown>,\n }\n }\n\n const result = await payload.update({\n collection: collectionSlug,\n data: parsedData,\n depth,\n draft,\n overrideLock,\n req,\n where: whereClause,\n ...localAPIDefaults(authorizedMCP),\n ...(filePath ? { filePath } : {}),\n ...(overwriteExistingFiles ? { overwriteExistingFiles } : {}),\n ...(locale ? { locale } : {}),\n ...(fallbackLocale ? { fallbackLocale } : {}),\n ...(selectClause ? { select: selectClause } : {}),\n })\n\n const docs = result.docs || []\n const errors = result.errors || []\n\n let responseText = `Multiple documents updated in collection \"${collectionSlug}\"!\\nUpdated: ${docs.length} documents\\nErrors: ${errors.length}\\n---`\n if (docs.length > 0) {\n responseText += `\\n\\nUpdated documents:\\n\\`\\`\\`json\\n${JSON.stringify(docs)}\\n\\`\\`\\``\n }\n if (errors.length > 0) {\n responseText += `\\n\\nErrors:\\n\\`\\`\\`json\\n${JSON.stringify(errors)}\\n\\`\\`\\``\n\n const errorSchema = getCollectionInputSchema({ collectionSlug, req })\n\n if (errorSchema) {\n responseText += `\\n\\nUse this schema for data:\\n\\`\\`\\`json\\n${JSON.stringify(errorSchema)}\\n\\`\\`\\``\n }\n\n return {\n content: [{ type: 'text', text: responseText }],\n doc: { docs, errors } as unknown as Record<string, unknown>,\n isError: true,\n ...(errorSchema\n ? {\n structuredContent: {\n collectionSlug,\n docs,\n errors,\n schema: errorSchema,\n },\n }\n : {}),\n }\n }\n\n return {\n content: [{ type: 'text', text: responseText }],\n doc: { docs, errors } as unknown as Record<string, unknown>,\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error'\n logger.error(`Error updating document in ${collectionSlug}: ${errorMessage}`)\n return formatCollectionError({ action: 'updating', collectionSlug, error, req })\n }\n})\n"],"names":["z","defineCollectionTool","getLogger","getCollectionVirtualFieldNames","stripVirtualFields","localAPIDefaults","getCollectionInputSchema","transformPointDataToPayload","whereSchema","validateCollectionData","formatCollectionError","DEFAULT_DESCRIPTION","updateDocumentTool","description","input","object","id","union","string","number","describe","optional","data","record","unknown","depth","default","draft","boolean","fallbackLocale","filePath","locale","overrideLock","overwriteExistingFiles","select","where","handler","authorizedMCP","collectionSlug","req","payload","logger","info","content","type","text","virtualFieldNames","config","inputData","validationError","partial","parsedData","whereClause","selectClause","JSON","parse","warn","result","update","collection","stringify","doc","docs","errors","responseText","length","errorSchema","isError","structuredContent","schema","error","errorMessage","Error","message","action"],"mappings":"AAEA,SAASA,CAAC,QAAQ,MAAK;AAEvB,SAASC,oBAAoB,QAAQ,yBAAwB;AAC7D,SAASC,SAAS,QAAQ,8BAA6B;AACvD,SACEC,8BAA8B,EAC9BC,kB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,KAAKG,MAAM,GAAG,GAAG;YACnBD,gBAAgB,CAAC,oCAAoC,EAAEV,KAAKM,SAAS,CAACE,MAAM,QAAQ,CAAC;QACvF;QACA,IAAIC,OAAOE,MAAM,GAAG,GAAG;YACrBD,gBAAgB,CAAC,yBAAyB,EAAEV,KAAKM,SAAS,CAACG,QAAQ,QAAQ,CAAC;YAE5E,MAAMG,cAAc5D,yBAAyB;gBAAEgC;gBAAgBC;YAAI;YAEnE,IAAI2B,aAAa;gBACfF,gBAAgB,CAAC,2CAA2C,EAAEV,KAAKM,SAAS,CAACM,aAAa,QAAQ,CAAC;YACrG;YAEA,OAAO;gBACLvB,SAAS;oBAAC;wBAAEC,MAAM;wBAAQC,MAAMmB;oBAAa;iBAAE;gBAC/CH,KAAK;oBAAEC;oBAAMC;gBAAO;gBACpBI,SAAS;gBACT,GAAID,cACA;oBACEE,mBAAmB;wBACjB9B;wBACAwB;wBACAC;wBACAM,QAAQH;oBACV;gBACF,IACA,CAAC,CAAC;YACR;QACF;QAEA,OAAO;YACLvB,SAAS;gBAAC;oBAAEC,MAAM;oBAAQC,MAAMmB;gBAAa;aAAE;YAC/CH,KAAK;gBAAEC;gBAAMC;YAAO;QACtB;IACF,EAAE,OAAOO,OAAO;QACd,MAAMC,eAAeD,iBAAiBE,QAAQF,MAAMG,OAAO,GAAG;QAC9DhC,OAAO6B,KAAK,CAAC,CAAC,2BAA2B,EAAEhC,eAAe,EAAE,EAAEiC,cAAc;QAC5E,OAAO7D,sBAAsB;YAAEgE,QAAQ;YAAYpC;YAAgBgC;YAAO/B;QAAI;IAChF;AACF,GAAE"}
@@ -0,0 +1,2 @@
1
+ export declare const getConfigInfoTool: import("../../types.js").Tool;
2
+ //# sourceMappingURL=getConfigInfoTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getConfigInfoTool.d.ts","sourceRoot":"","sources":["../../../src/mcp/builtin/getConfigInfoTool.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,+BAuC5B,CAAA"}
@@ -0,0 +1,49 @@
1
+ import { getAccessResults, isEntityHidden } from 'payload';
2
+ import { defineTool } from '../../defineTool.js';
3
+ export const getConfigInfoTool = defineTool({
4
+ description: 'List the Payload collection and global slugs visible to this MCP client.'
5
+ }).handler(async ({ authorizedMCP, req })=>{
6
+ const user = authorizedMCP.user ?? req.user ?? null;
7
+ const permissions = user ? await getAccessResults({
8
+ req: {
9
+ ...req,
10
+ user
11
+ }
12
+ }) : null;
13
+ const collections = [];
14
+ const globals = [];
15
+ for (const collection of req.payload.config.collections){
16
+ if (user && isEntityHidden({
17
+ hidden: collection.admin.hidden,
18
+ user
19
+ })) {
20
+ continue;
21
+ }
22
+ if (user && !permissions?.collections?.[collection.slug]?.read) {
23
+ continue;
24
+ }
25
+ collections.push(collection.slug);
26
+ }
27
+ for (const global of req.payload.config.globals){
28
+ if (user && isEntityHidden({
29
+ hidden: global.admin.hidden,
30
+ user
31
+ })) {
32
+ continue;
33
+ }
34
+ if (user && !permissions?.globals?.[global.slug]?.read) {
35
+ continue;
36
+ }
37
+ globals.push(global.slug);
38
+ }
39
+ return {
40
+ content: [
41
+ {
42
+ type: 'text',
43
+ text: `Collections: ${collections.join(', ') || 'none'}\nGlobals: ${globals.join(', ') || 'none'}`
44
+ }
45
+ ]
46
+ };
47
+ });
48
+
49
+ //# sourceMappingURL=getConfigInfoTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/mcp/builtin/getConfigInfoTool.ts"],"sourcesContent":["import { getAccessResults, isEntityHidden } from 'payload'\n\nimport { defineTool } from '../../defineTool.js'\n\nexport const getConfigInfoTool = defineTool({\n description: 'List the Payload collection and global slugs visible to this MCP client.',\n}).handler(async ({ authorizedMCP, req }) => {\n const user = authorizedMCP.user ?? req.user ?? null\n const permissions = user ? await getAccessResults({ req: { ...req, user } }) : null\n\n const collections: string[] = []\n const globals: string[] = []\n\n for (const collection of req.payload.config.collections) {\n if (user && isEntityHidden({ hidden: collection.admin.hidden, user })) {\n continue\n }\n if (user && !permissions?.collections?.[collection.slug]?.read) {\n continue\n }\n\n collections.push(collection.slug)\n }\n\n for (const global of req.payload.config.globals) {\n if (user && isEntityHidden({ hidden: global.admin.hidden, user })) {\n continue\n }\n if (user && !permissions?.globals?.[global.slug]?.read) {\n continue\n }\n\n globals.push(global.slug)\n }\n\n return {\n content: [\n {\n type: 'text',\n text: `Collections: ${collections.join(', ') || 'none'}\\nGlobals: ${globals.join(', ') || 'none'}`,\n },\n ],\n }\n})\n"],"names":["getAccessResults","isEntityHidden","defineTool","getConfigInfoTool","description","handler","authorizedMCP","req","user","permissions","collections","globals","collection","payload","config","hidden","admin","slug","read","push","global","content","type","text","join"],"mappings":"AAAA,SAASA,gBAAgB,EAAEC,cAAc,QAAQ,UAAS;AAE1D,SAASC,UAAU,QAAQ,sBAAqB;AAEhD,OAAO,MAAMC,oBAAoBD,WAAW;IAC1CE,aAAa;AACf,GAAGC,OAAO,CAAC,OAAO,EAAEC,aAAa,EAAEC,GAAG,EAAE;IACtC,MAAMC,OAAOF,cAAcE,IAAI,IAAID,IAAIC,IAAI,IAAI;IAC/C,MAAMC,cAAcD,OAAO,MAAMR,iBAAiB;QAAEO,KAAK;YAAE,GAAGA,GAAG;YAAEC;QAAK;IAAE,KAAK;IAE/E,MAAME,cAAwB,EAAE;IAChC,MAAMC,UAAoB,EAAE;IAE5B,KAAK,MAAMC,cAAcL,IAAIM,OAAO,CAACC,MAAM,CAACJ,WAAW,CAAE;QACvD,IAAIF,QAAQP,eAAe;YAAEc,QAAQH,WAAWI,KAAK,CAACD,MAAM;YAAEP;QAAK,IAAI;YACrE;QACF;QACA,IAAIA,QAAQ,CAACC,aAAaC,aAAa,CAACE,WAAWK,IAAI,CAAC,EAAEC,MAAM;YAC9D;QACF;QAEAR,YAAYS,IAAI,CAACP,WAAWK,IAAI;IAClC;IAEA,KAAK,MAAMG,UAAUb,IAAIM,OAAO,CAACC,MAAM,CAACH,OAAO,CAAE;QAC/C,IAAIH,QAAQP,eAAe;YAAEc,QAAQK,OAAOJ,KAAK,CAACD,MAAM;YAAEP;QAAK,IAAI;YACjE;QACF;QACA,IAAIA,QAAQ,CAACC,aAAaE,SAAS,CAACS,OAAOH,IAAI,CAAC,EAAEC,MAAM;YACtD;QACF;QAEAP,QAAQQ,IAAI,CAACC,OAAOH,IAAI;IAC1B;IAEA,OAAO;QACLI,SAAS;YACP;gBACEC,MAAM;gBACNC,MAAM,CAAC,aAAa,EAAEb,YAAYc,IAAI,CAAC,SAAS,OAAO,WAAW,EAAEb,QAAQa,IAAI,CAAC,SAAS,QAAQ;YACpG;SACD;IACH;AACF,GAAE"}
@@ -0,0 +1,2 @@
1
+ export declare const findGlobalTool: import("../../../types.js").GlobalTool;
2
+ //# sourceMappingURL=findTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"findTool.d.ts","sourceRoot":"","sources":["../../../../src/mcp/builtin/globals/findTool.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,cAAc,wCAqFzB,CAAA"}
@@ -0,0 +1,76 @@
1
+ import { z } from 'zod';
2
+ import { defineGlobalTool } from '../../../defineTool.js';
3
+ import { getLogger } from '../../../utils/getLogger.js';
4
+ import { localAPIDefaults } from '../../../utils/localAPIDefaults.js';
5
+ const DEFAULT_DESCRIPTION = 'Find any Payload global by passing the global slug.';
6
+ export const findGlobalTool = defineGlobalTool({
7
+ description: DEFAULT_DESCRIPTION,
8
+ input: z.object({
9
+ depth: z.number().int().min(0).max(10).describe('Depth of population for relationships').optional().default(0),
10
+ fallbackLocale: z.string().describe('Optional: fallback locale code to use when requested locale is not available').optional(),
11
+ locale: z.string().describe('Optional: locale code to retrieve data in (e.g., "en", "es"). Use "all" to retrieve all locales for localized fields').optional(),
12
+ select: z.string().describe("Optional: define exactly which fields you'd like to return in the response (JSON), e.g., '{\"title\": true}'").optional()
13
+ })
14
+ }).handler(async ({ authorizedMCP, globalSlug, input, req })=>{
15
+ const payload = req.payload;
16
+ const logger = getLogger({
17
+ payload
18
+ });
19
+ const { depth, fallbackLocale, locale, select } = input;
20
+ logger.info(`Reading global: ${globalSlug}, depth: ${depth}${locale ? `, locale: ${locale}` : ''}`);
21
+ try {
22
+ const findOptions = {
23
+ slug: globalSlug,
24
+ depth,
25
+ ...localAPIDefaults(authorizedMCP)
26
+ };
27
+ let selectClause;
28
+ if (select) {
29
+ try {
30
+ selectClause = JSON.parse(select);
31
+ } catch {
32
+ logger.warn(`Invalid select clause JSON for global: ${select}`);
33
+ return {
34
+ content: [
35
+ {
36
+ type: 'text',
37
+ text: 'Error: Invalid JSON in select clause'
38
+ }
39
+ ]
40
+ };
41
+ }
42
+ }
43
+ if (locale) {
44
+ findOptions.locale = locale;
45
+ }
46
+ if (fallbackLocale) {
47
+ findOptions.fallbackLocale = fallbackLocale;
48
+ }
49
+ if (selectClause) {
50
+ findOptions.select = selectClause;
51
+ }
52
+ const result = await payload.findGlobal(findOptions);
53
+ return {
54
+ content: [
55
+ {
56
+ type: 'text',
57
+ text: `Global "${globalSlug}":\n\`\`\`json\n${JSON.stringify(result)}\n\`\`\``
58
+ }
59
+ ],
60
+ doc: result
61
+ };
62
+ } catch (error) {
63
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
64
+ logger.error(`Error reading global ${globalSlug}: ${errorMessage}`);
65
+ return {
66
+ content: [
67
+ {
68
+ type: 'text',
69
+ text: `❌ **Error reading global "${globalSlug}":** ${errorMessage}`
70
+ }
71
+ ]
72
+ };
73
+ }
74
+ });
75
+
76
+ //# sourceMappingURL=findTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/mcp/builtin/globals/findTool.ts"],"sourcesContent":["import type { SelectType } from 'payload'\n\nimport { z } from 'zod'\n\nimport { defineGlobalTool } from '../../../defineTool.js'\nimport { getLogger } from '../../../utils/getLogger.js'\nimport { localAPIDefaults } from '../../../utils/localAPIDefaults.js'\n\nconst DEFAULT_DESCRIPTION = 'Find any Payload global by passing the global slug.'\n\nexport const findGlobalTool = defineGlobalTool({\n description: DEFAULT_DESCRIPTION,\n input: z.object({\n depth: z\n .number()\n .int()\n .min(0)\n .max(10)\n .describe('Depth of population for relationships')\n .optional()\n .default(0),\n fallbackLocale: z\n .string()\n .describe('Optional: fallback locale code to use when requested locale is not available')\n .optional(),\n locale: z\n .string()\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 .optional(),\n select: z\n .string()\n .describe(\n \"Optional: define exactly which fields you'd like to return in the response (JSON), e.g., '{\\\"title\\\": true}'\",\n )\n .optional(),\n }),\n}).handler(async ({ authorizedMCP, globalSlug, input, req }) => {\n const payload = req.payload\n const logger = getLogger({ payload })\n\n const { depth, fallbackLocale, locale, select } = input\n\n logger.info(\n `Reading global: ${globalSlug}, depth: ${depth}${locale ? `, locale: ${locale}` : ''}`,\n )\n\n try {\n const findOptions: Parameters<typeof payload.findGlobal>[0] = {\n slug: globalSlug,\n depth,\n ...localAPIDefaults(authorizedMCP),\n }\n\n let selectClause: SelectType | undefined\n if (select) {\n try {\n selectClause = JSON.parse(select) as SelectType\n } catch {\n logger.warn(`Invalid select clause JSON for global: ${select}`)\n return { content: [{ type: 'text', text: 'Error: Invalid JSON in select clause' }] }\n }\n }\n\n if (locale) {\n findOptions.locale = locale\n }\n if (fallbackLocale) {\n findOptions.fallbackLocale = fallbackLocale\n }\n if (selectClause) {\n findOptions.select = selectClause\n }\n\n const result = await payload.findGlobal(findOptions)\n\n return {\n content: [\n {\n type: 'text',\n text: `Global \"${globalSlug}\":\\n\\`\\`\\`json\\n${JSON.stringify(result)}\\n\\`\\`\\``,\n },\n ],\n doc: result as Record<string, unknown>,\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error'\n logger.error(`Error reading global ${globalSlug}: ${errorMessage}`)\n return {\n content: [\n { type: 'text', text: `❌ **Error reading global \"${globalSlug}\":** ${errorMessage}` },\n ],\n }\n }\n})\n"],"names":["z","defineGlobalTool","getLogger","localAPIDefaults","DEFAULT_DESCRIPTION","findGlobalTool","description","input","object","depth","number","int","min","max","describe","optional","default","fallbackLocale","string","locale","select","handler","authorizedMCP","globalSlug","req","payload","logger","info","findOptions","slug","selectClause","JSON","parse","warn","content","type","text","result","findGlobal","stringify","doc","error","errorMessage","Error","message"],"mappings":"AAEA,SAASA,CAAC,QAAQ,MAAK;AAEvB,SAASC,gBAAgB,QAAQ,yBAAwB;AACzD,SAASC,SAAS,QAAQ,8BAA6B;AACvD,SAASC,gBAAgB,QAAQ,qCAAoC;AAErE,MAAMC,sBAAsB;AAE5B,OAAO,MAAMC,iBAAiBJ,iBAAiB;IAC7CK,aAAaF;IACbG,OAAOP,EAAEQ,MAAM,CAAC;QACdC,OAAOT,EACJU,MAAM,GACNC,GAAG,GACHC,GAAG,CAAC,GACJC,GAAG,CAAC,IACJC,QAAQ,CAAC,yCACTC,QAAQ,GACRC,OAAO,CAAC;QACXC,gBAAgBjB,EACbkB,MAAM,GACNJ,QAAQ,CAAC,gFACTC,QAAQ;QACXI,QAAQnB,EACLkB,MAAM,GACNJ,QAAQ,CACP,wHAEDC,QAAQ;QACXK,QAAQpB,EACLkB,MAAM,GACNJ,QAAQ,CACP,gHAEDC,QAAQ;IACb;AACF,GAAGM,OAAO,CAAC,OAAO,EAAEC,aAAa,EAAEC,UAAU,EAAEhB,KAAK,EAAEiB,GAAG,EAAE;IACzD,MAAMC,UAAUD,IAAIC,OAAO;IAC3B,MAAMC,SAASxB,UAAU;QAAEuB;IAAQ;IAEnC,MAAM,EAAEhB,KAAK,EAAEQ,cAAc,EAAEE,MAAM,EAAEC,MAAM,EAAE,GAAGb;IAElDmB,OAAOC,IAAI,CACT,CAAC,gBAAgB,EAAEJ,WAAW,SAAS,EAAEd,QAAQU,SAAS,CAAC,UAAU,EAAEA,QAAQ,GAAG,IAAI;IAGxF,IAAI;QACF,MAAMS,cAAwD;YAC5DC,MAAMN;YACNd;YACA,GAAGN,iBAAiBmB,cAAc;QACpC;QAEA,IAAIQ;QACJ,IAAIV,QAAQ;YACV,IAAI;gBACFU,eAAeC,KAAKC,KAAK,CAACZ;YAC5B,EAAE,OAAM;gBACNM,OAAOO,IAAI,CAAC,CAAC,uCAAuC,EAAEb,QAAQ;gBAC9D,OAAO;oBAAEc,SAAS;wBAAC;4BAAEC,MAAM;4BAAQC,MAAM;wBAAuC;qBAAE;gBAAC;YACrF;QACF;QAEA,IAAIjB,QAAQ;YACVS,YAAYT,MAAM,GAAGA;QACvB;QACA,IAAIF,gBAAgB;YAClBW,YAAYX,cAAc,GAAGA;QAC/B;QACA,IAAIa,cAAc;YAChBF,YAAYR,MAAM,GAAGU;QACvB;QAEA,MAAMO,SAAS,MAAMZ,QAAQa,UAAU,CAACV;QAExC,OAAO;YACLM,SAAS;gBACP;oBACEC,MAAM;oBACNC,MAAM,CAAC,QAAQ,EAAEb,WAAW,gBAAgB,EAAEQ,KAAKQ,SAAS,CAACF,QAAQ,QAAQ,CAAC;gBAChF;aACD;YACDG,KAAKH;QACP;IACF,EAAE,OAAOI,OAAO;QACd,MAAMC,eAAeD,iBAAiBE,QAAQF,MAAMG,OAAO,GAAG;QAC9DlB,OAAOe,KAAK,CAAC,CAAC,qBAAqB,EAAElB,WAAW,EAAE,EAAEmB,cAAc;QAClE,OAAO;YACLR,SAAS;gBACP;oBAAEC,MAAM;oBAAQC,MAAM,CAAC,0BAA0B,EAAEb,WAAW,KAAK,EAAEmB,cAAc;gBAAC;aACrF;QACH;IACF;AACF,GAAE"}
@@ -0,0 +1,2 @@
1
+ export declare const getGlobalSchemaTool: import("../../../types.js").GlobalTool;
2
+ //# sourceMappingURL=getGlobalSchemaTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getGlobalSchemaTool.d.ts","sourceRoot":"","sources":["../../../../src/mcp/builtin/globals/getGlobalSchemaTool.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,mBAAmB,wCAwB9B,CAAA"}
@@ -0,0 +1,35 @@
1
+ import { defineGlobalTool } from '../../../defineTool.js';
2
+ import { getGlobalInputSchema } from '../../../utils/schemaConversion/getEntityInputSchema.js';
3
+ export const getGlobalSchemaTool = defineGlobalTool({
4
+ description: 'Get the input schema for updating a global.'
5
+ }).handler(({ globalSlug, req })=>{
6
+ const inputSchema = getGlobalInputSchema({
7
+ globalSlug,
8
+ req
9
+ });
10
+ if (!inputSchema) {
11
+ return {
12
+ content: [
13
+ {
14
+ type: 'text',
15
+ text: `Error: Global "${globalSlug}" not found`
16
+ }
17
+ ],
18
+ isError: true
19
+ };
20
+ }
21
+ return {
22
+ content: [
23
+ {
24
+ type: 'text',
25
+ text: `Schema for global "${globalSlug}":\n\`\`\`json\n${JSON.stringify(inputSchema)}\n\`\`\``
26
+ }
27
+ ],
28
+ structuredContent: {
29
+ globalSlug,
30
+ schema: inputSchema
31
+ }
32
+ };
33
+ });
34
+
35
+ //# sourceMappingURL=getGlobalSchemaTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/mcp/builtin/globals/getGlobalSchemaTool.ts"],"sourcesContent":["import { defineGlobalTool } from '../../../defineTool.js'\nimport { getGlobalInputSchema } from '../../../utils/schemaConversion/getEntityInputSchema.js'\n\nexport const getGlobalSchemaTool = defineGlobalTool({\n description: 'Get the input schema for updating a global.',\n}).handler(({ globalSlug, req }) => {\n const inputSchema = getGlobalInputSchema({ globalSlug, req })\n\n if (!inputSchema) {\n return {\n content: [{ type: 'text', text: `Error: Global \"${globalSlug}\" not found` }],\n isError: true,\n }\n }\n\n return {\n content: [\n {\n type: 'text',\n text: `Schema for global \"${globalSlug}\":\\n\\`\\`\\`json\\n${JSON.stringify(inputSchema)}\\n\\`\\`\\``,\n },\n ],\n structuredContent: {\n globalSlug,\n schema: inputSchema,\n },\n }\n})\n"],"names":["defineGlobalTool","getGlobalInputSchema","getGlobalSchemaTool","description","handler","globalSlug","req","inputSchema","content","type","text","isError","JSON","stringify","structuredContent","schema"],"mappings":"AAAA,SAASA,gBAAgB,QAAQ,yBAAwB;AACzD,SAASC,oBAAoB,QAAQ,0DAAyD;AAE9F,OAAO,MAAMC,sBAAsBF,iBAAiB;IAClDG,aAAa;AACf,GAAGC,OAAO,CAAC,CAAC,EAAEC,UAAU,EAAEC,GAAG,EAAE;IAC7B,MAAMC,cAAcN,qBAAqB;QAAEI;QAAYC;IAAI;IAE3D,IAAI,CAACC,aAAa;QAChB,OAAO;YACLC,SAAS;gBAAC;oBAAEC,MAAM;oBAAQC,MAAM,CAAC,eAAe,EAAEL,WAAW,WAAW,CAAC;gBAAC;aAAE;YAC5EM,SAAS;QACX;IACF;IAEA,OAAO;QACLH,SAAS;YACP;gBACEC,MAAM;gBACNC,MAAM,CAAC,mBAAmB,EAAEL,WAAW,gBAAgB,EAAEO,KAAKC,SAAS,CAACN,aAAa,QAAQ,CAAC;YAChG;SACD;QACDO,mBAAmB;YACjBT;YACAU,QAAQR;QACV;IACF;AACF,GAAE"}
@@ -0,0 +1,2 @@
1
+ export declare const updateGlobalTool: import("../../../types.js").GlobalTool;
2
+ //# sourceMappingURL=updateTool.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateTool.d.ts","sourceRoot":"","sources":["../../../../src/mcp/builtin/globals/updateTool.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,gBAAgB,wCAkG3B,CAAA"}
@@ -0,0 +1,94 @@
1
+ import { z } from 'zod';
2
+ import { defineGlobalTool } from '../../../defineTool.js';
3
+ import { getLogger } from '../../../utils/getLogger.js';
4
+ import { getGlobalVirtualFieldNames, stripVirtualFields } from '../../../utils/getVirtualFieldNames.js';
5
+ import { localAPIDefaults } from '../../../utils/localAPIDefaults.js';
6
+ import { transformPointDataToPayload } from '../../../utils/transformPointDataToPayload.js';
7
+ import { validateGlobalData } from '../validateEntityData.js';
8
+ const DEFAULT_DESCRIPTION = 'Update any Payload global by passing the global slug and data.';
9
+ export const updateGlobalTool = defineGlobalTool({
10
+ description: DEFAULT_DESCRIPTION,
11
+ input: z.object({
12
+ data: z.record(z.string(), z.unknown()).describe('The global fields to update'),
13
+ depth: z.number().describe('Optional: Depth of relationships to populate').optional().default(0),
14
+ draft: z.boolean().describe('Optional: Whether to save as draft (default: false)').optional().default(false),
15
+ fallbackLocale: z.string().describe('Optional: fallback locale code to use when requested locale is not available').optional(),
16
+ locale: z.string().describe('Optional: locale code to update data in (e.g., "en", "es"). Use "all" to update all locales for localized fields').optional(),
17
+ select: z.string().describe("Optional: define exactly which fields you'd like to return in the response (JSON), e.g., '{\"siteName\": true}'").optional()
18
+ })
19
+ }).handler(async ({ authorizedMCP, globalSlug, input, req })=>{
20
+ const payload = req.payload;
21
+ const logger = getLogger({
22
+ payload
23
+ });
24
+ const { data, depth, draft, fallbackLocale, locale, select } = input;
25
+ logger.info(`Updating global: ${globalSlug}, draft: ${draft}${locale ? `, locale: ${locale}` : ''}`);
26
+ try {
27
+ const virtualFieldNames = getGlobalVirtualFieldNames(payload.config, globalSlug);
28
+ const inputData = stripVirtualFields(data, virtualFieldNames);
29
+ const validationError = validateGlobalData({
30
+ data: inputData,
31
+ globalSlug,
32
+ req
33
+ });
34
+ if (validationError) {
35
+ return validationError;
36
+ }
37
+ const parsedData = transformPointDataToPayload(inputData);
38
+ let selectClause;
39
+ if (select) {
40
+ try {
41
+ selectClause = JSON.parse(select);
42
+ } catch {
43
+ logger.warn(`Invalid select clause JSON for global: ${select}`);
44
+ return {
45
+ content: [
46
+ {
47
+ type: 'text',
48
+ text: 'Error: Invalid JSON in select clause'
49
+ }
50
+ ]
51
+ };
52
+ }
53
+ }
54
+ const updateOptions = {
55
+ slug: globalSlug,
56
+ data: parsedData,
57
+ depth,
58
+ draft,
59
+ ...localAPIDefaults(authorizedMCP)
60
+ };
61
+ if (locale) {
62
+ updateOptions.locale = locale;
63
+ }
64
+ if (fallbackLocale) {
65
+ updateOptions.fallbackLocale = fallbackLocale;
66
+ }
67
+ if (selectClause) {
68
+ updateOptions.select = selectClause;
69
+ }
70
+ const result = await payload.updateGlobal(updateOptions);
71
+ return {
72
+ content: [
73
+ {
74
+ type: 'text',
75
+ text: `Global "${globalSlug}" updated successfully!\n\`\`\`json\n${JSON.stringify(result)}\n\`\`\``
76
+ }
77
+ ],
78
+ doc: result
79
+ };
80
+ } catch (error) {
81
+ const errorMessage = error instanceof Error ? error.message : 'Unknown error';
82
+ logger.error(`Error updating global ${globalSlug}: ${errorMessage}`);
83
+ return {
84
+ content: [
85
+ {
86
+ type: 'text',
87
+ text: `Error updating global "${globalSlug}": ${errorMessage}`
88
+ }
89
+ ]
90
+ };
91
+ }
92
+ });
93
+
94
+ //# sourceMappingURL=updateTool.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/mcp/builtin/globals/updateTool.ts"],"sourcesContent":["import type { SelectType } from 'payload'\n\nimport { z } from 'zod'\n\nimport { defineGlobalTool } from '../../../defineTool.js'\nimport { getLogger } from '../../../utils/getLogger.js'\nimport {\n getGlobalVirtualFieldNames,\n stripVirtualFields,\n} from '../../../utils/getVirtualFieldNames.js'\nimport { localAPIDefaults } from '../../../utils/localAPIDefaults.js'\nimport { transformPointDataToPayload } from '../../../utils/transformPointDataToPayload.js'\nimport { validateGlobalData } from '../validateEntityData.js'\n\nconst DEFAULT_DESCRIPTION = 'Update any Payload global by passing the global slug and data.'\n\nexport const updateGlobalTool = defineGlobalTool({\n description: DEFAULT_DESCRIPTION,\n input: z.object({\n data: z.record(z.string(), z.unknown()).describe('The global fields to update'),\n depth: z\n .number()\n .describe('Optional: Depth of relationships to populate')\n .optional()\n .default(0),\n draft: z\n .boolean()\n .describe('Optional: Whether to save as draft (default: false)')\n .optional()\n .default(false),\n fallbackLocale: z\n .string()\n .describe('Optional: fallback locale code to use when requested locale is not available')\n .optional(),\n locale: z\n .string()\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 .optional(),\n select: z\n .string()\n .describe(\n \"Optional: define exactly which fields you'd like to return in the response (JSON), e.g., '{\\\"siteName\\\": true}'\",\n )\n .optional(),\n }),\n}).handler(async ({ authorizedMCP, globalSlug, input, req }) => {\n const payload = req.payload\n const logger = getLogger({ payload })\n\n const { data, depth, draft, fallbackLocale, locale, select } = input\n\n logger.info(\n `Updating global: ${globalSlug}, draft: ${draft}${locale ? `, locale: ${locale}` : ''}`,\n )\n\n try {\n const virtualFieldNames = getGlobalVirtualFieldNames(payload.config, globalSlug)\n const inputData = stripVirtualFields(data, virtualFieldNames)\n const validationError = validateGlobalData({ data: inputData, globalSlug, req })\n\n if (validationError) {\n return validationError\n }\n\n const parsedData = transformPointDataToPayload(inputData)\n\n let selectClause: SelectType | undefined\n if (select) {\n try {\n selectClause = JSON.parse(select) as SelectType\n } catch {\n logger.warn(`Invalid select clause JSON for global: ${select}`)\n return { content: [{ type: 'text', text: 'Error: Invalid JSON in select clause' }] }\n }\n }\n\n const updateOptions: Parameters<typeof payload.updateGlobal>[0] = {\n slug: globalSlug,\n data: parsedData,\n depth,\n draft,\n ...localAPIDefaults(authorizedMCP),\n }\n\n if (locale) {\n updateOptions.locale = locale\n }\n if (fallbackLocale) {\n updateOptions.fallbackLocale = fallbackLocale\n }\n if (selectClause) {\n updateOptions.select = selectClause\n }\n\n const result = await payload.updateGlobal(updateOptions)\n\n return {\n content: [\n {\n type: 'text',\n text: `Global \"${globalSlug}\" updated successfully!\\n\\`\\`\\`json\\n${JSON.stringify(result)}\\n\\`\\`\\``,\n },\n ],\n doc: result as Record<string, unknown>,\n }\n } catch (error) {\n const errorMessage = error instanceof Error ? error.message : 'Unknown error'\n logger.error(`Error updating global ${globalSlug}: ${errorMessage}`)\n return {\n content: [{ type: 'text', text: `Error updating global \"${globalSlug}\": ${errorMessage}` }],\n }\n }\n})\n"],"names":["z","defineGlobalTool","getLogger","getGlobalVirtualFieldNames","stripVirtualFields","localAPIDefaults","transformPointDataToPayload","validateGlobalData","DEFAULT_DESCRIPTION","updateGlobalTool","description","input","object","data","record","string","unknown","describe","depth","number","optional","default","draft","boolean","fallbackLocale","locale","select","handler","authorizedMCP","globalSlug","req","payload","logger","info","virtualFieldNames","config","inputData","validationError","parsedData","selectClause","JSON","parse","warn","content","type","text","updateOptions","slug","result","updateGlobal","stringify","doc","error","errorMessage","Error","message"],"mappings":"AAEA,SAASA,CAAC,QAAQ,MAAK;AAEvB,SAASC,gBAAgB,QAAQ,yBAAwB;AACzD,SAASC,SAAS,QAAQ,8BAA6B;AACvD,SACEC,0BAA0B,EAC1BC,kBAAkB,QACb,yCAAwC;AAC/C,SAASC,gBAAgB,QAAQ,qCAAoC;AACrE,SAASC,2BAA2B,QAAQ,gDAA+C;AAC3F,SAASC,kBAAkB,QAAQ,2BAA0B;AAE7D,MAAMC,sBAAsB;AAE5B,OAAO,MAAMC,mBAAmBR,iBAAiB;IAC/CS,aAAaF;IACbG,OAAOX,EAAEY,MAAM,CAAC;QACdC,MAAMb,EAAEc,MAAM,CAACd,EAAEe,MAAM,IAAIf,EAAEgB,OAAO,IAAIC,QAAQ,CAAC;QACjDC,OAAOlB,EACJmB,MAAM,GACNF,QAAQ,CAAC,gDACTG,QAAQ,GACRC,OAAO,CAAC;QACXC,OAAOtB,EACJuB,OAAO,GACPN,QAAQ,CAAC,uDACTG,QAAQ,GACRC,OAAO,CAAC;QACXG,gBAAgBxB,EACbe,MAAM,GACNE,QAAQ,CAAC,gFACTG,QAAQ;QACXK,QAAQzB,EACLe,MAAM,GACNE,QAAQ,CACP,oHAEDG,QAAQ;QACXM,QAAQ1B,EACLe,MAAM,GACNE,QAAQ,CACP,mHAEDG,QAAQ;IACb;AACF,GAAGO,OAAO,CAAC,OAAO,EAAEC,aAAa,EAAEC,UAAU,EAAElB,KAAK,EAAEmB,GAAG,EAAE;IACzD,MAAMC,UAAUD,IAAIC,OAAO;IAC3B,MAAMC,SAAS9B,UAAU;QAAE6B;IAAQ;IAEnC,MAAM,EAAElB,IAAI,EAAEK,KAAK,EAAEI,KAAK,EAAEE,cAAc,EAAEC,MAA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B,KAAK,CAAC,CAAC,sBAAsB,EAAEvB,WAAW,EAAE,EAAEwB,cAAc;QACnE,OAAO;YACLV,SAAS;gBAAC;oBAAEC,MAAM;oBAAQC,MAAM,CAAC,uBAAuB,EAAEhB,WAAW,GAAG,EAAEwB,cAAc;gBAAC;aAAE;QAC7F;IACF;AACF,GAAE"}
@@ -0,0 +1,14 @@
1
+ import type { CollectionSlug, GlobalSlug, PayloadRequest } from 'payload';
2
+ import type { MCPToolResponse } from '../../types.js';
3
+ export declare const validateCollectionData: ({ collectionSlug, data, partial, req, }: {
4
+ collectionSlug: CollectionSlug;
5
+ data: Record<string, unknown>;
6
+ partial?: boolean;
7
+ req: PayloadRequest;
8
+ }) => MCPToolResponse | null;
9
+ export declare const validateGlobalData: ({ data, globalSlug, req, }: {
10
+ data: Record<string, unknown>;
11
+ globalSlug: GlobalSlug;
12
+ req: PayloadRequest;
13
+ }) => MCPToolResponse | null;
14
+ //# sourceMappingURL=validateEntityData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validateEntityData.d.ts","sourceRoot":"","sources":["../../../src/mcp/builtin/validateEntityData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAmB,MAAM,SAAS,CAAA;AAI1F,OAAO,KAAK,EAAkB,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAuBrE,eAAO,MAAM,sBAAsB,GAAI,yCAKpC;IACD,cAAc,EAAE,cAAc,CAAA;IAC9B,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,GAAG,EAAE,cAAc,CAAA;CACpB,KAAG,eAAe,GAAG,IAQlB,CAAA;AAEJ,eAAO,MAAM,kBAAkB,GAAI,4BAIhC;IACD,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAC7B,UAAU,EAAE,UAAU,CAAA;IACtB,GAAG,EAAE,cAAc,CAAA;CACpB,KAAG,eAAe,GAAG,IAQlB,CAAA"}
@@ -0,0 +1,82 @@
1
+ import { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/server';
2
+ import { getCollectionInputSchema, getGlobalInputSchema } from '../../utils/schemaConversion/getEntityInputSchema.js';
3
+ /**
4
+ * Keep the default `shortcircuit: true` - `false` makes validating nested rich text exponentially slow.
5
+ */ const validator = new CfWorkerJsonSchemaValidator({
6
+ shortcircuit: true
7
+ });
8
+ /**
9
+ * - Caches each entity's schema and validator, so both are only built on the first request.
10
+ * - Keyed by payload config, then by entity type, slug, partial and language.
11
+ */ const validatorCache = new WeakMap();
12
+ export const validateCollectionData = ({ collectionSlug, data, partial, req })=>validateData({
13
+ slug: collectionSlug,
14
+ buildSchema: ()=>getCollectionInputSchema({
15
+ collectionSlug,
16
+ req
17
+ }),
18
+ data,
19
+ entity: 'collection',
20
+ partial,
21
+ req
22
+ });
23
+ export const validateGlobalData = ({ data, globalSlug, req })=>validateData({
24
+ slug: globalSlug,
25
+ buildSchema: ()=>getGlobalInputSchema({
26
+ globalSlug,
27
+ req
28
+ }),
29
+ data,
30
+ entity: 'global',
31
+ partial: true,
32
+ req
33
+ });
34
+ const validateData = ({ slug, buildSchema, data, entity, partial, req })=>{
35
+ let cache = validatorCache.get(req.payload.config);
36
+ if (!cache) {
37
+ cache = new Map();
38
+ validatorCache.set(req.payload.config, cache);
39
+ }
40
+ const cacheKey = `${entity}:${slug}:${partial ? 'partial' : 'full'}:${req.i18n.language}`;
41
+ let entityValidator = cache.get(cacheKey);
42
+ if (!entityValidator) {
43
+ const schema = buildSchema();
44
+ if (!schema) {
45
+ return null;
46
+ }
47
+ entityValidator = {
48
+ schema,
49
+ validate: validator.getValidator(partial ? withoutRequired(schema) : schema)
50
+ };
51
+ cache.set(cacheKey, entityValidator);
52
+ }
53
+ const result = entityValidator.validate(data);
54
+ if (result.valid) {
55
+ return null;
56
+ }
57
+ const { schema } = entityValidator;
58
+ return {
59
+ content: [
60
+ {
61
+ type: 'text',
62
+ text: `Invalid data for ${entity} "${slug}": ${result.errorMessage}\n\nUse this schema for data:\n\`\`\`json\n${JSON.stringify(schema)}\n\`\`\``
63
+ }
64
+ ],
65
+ isError: true,
66
+ structuredContent: {
67
+ [`${entity}Slug`]: slug,
68
+ errors: [
69
+ {
70
+ message: result.errorMessage
71
+ }
72
+ ],
73
+ schema
74
+ }
75
+ };
76
+ };
77
+ /** Updates are partial — drop the schema's top-level `required` before validating. */ const withoutRequired = (schema)=>{
78
+ const { required: _required, ...rest } = schema;
79
+ return rest;
80
+ };
81
+
82
+ //# sourceMappingURL=validateEntityData.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/mcp/builtin/validateEntityData.ts"],"sourcesContent":["import type { CollectionSlug, GlobalSlug, PayloadRequest, SanitizedConfig } from 'payload'\n\nimport { CfWorkerJsonSchemaValidator } from '@modelcontextprotocol/server'\n\nimport type { JsonSchemaType, MCPToolResponse } from '../../types.js'\n\nimport {\n getCollectionInputSchema,\n getGlobalInputSchema,\n} from '../../utils/schemaConversion/getEntityInputSchema.js'\n\n/**\n * Keep the default `shortcircuit: true` - `false` makes validating nested rich text exponentially slow.\n */\nconst validator = new CfWorkerJsonSchemaValidator({ shortcircuit: true })\n\ntype EntityValidator = {\n schema: JsonSchemaType\n validate: ReturnType<(typeof validator)['getValidator']>\n}\n\n/**\n * - Caches each entity's schema and validator, so both are only built on the first request.\n * - Keyed by payload config, then by entity type, slug, partial and language.\n */\nconst validatorCache = new WeakMap<SanitizedConfig, Map<string, EntityValidator>>()\n\nexport const validateCollectionData = ({\n collectionSlug,\n data,\n partial,\n req,\n}: {\n collectionSlug: CollectionSlug\n data: Record<string, unknown>\n partial?: boolean\n req: PayloadRequest\n}): MCPToolResponse | null =>\n validateData({\n slug: collectionSlug,\n buildSchema: () => getCollectionInputSchema({ collectionSlug, req }),\n data,\n entity: 'collection',\n partial,\n req,\n })\n\nexport const validateGlobalData = ({\n data,\n globalSlug,\n req,\n}: {\n data: Record<string, unknown>\n globalSlug: GlobalSlug\n req: PayloadRequest\n}): MCPToolResponse | null =>\n validateData({\n slug: globalSlug,\n buildSchema: () => getGlobalInputSchema({ globalSlug, req }),\n data,\n entity: 'global',\n partial: true,\n req,\n })\n\nconst validateData = ({\n slug,\n buildSchema,\n data,\n entity,\n partial,\n req,\n}: {\n buildSchema: () => JsonSchemaType | null\n data: Record<string, unknown>\n entity: 'collection' | 'global'\n partial?: boolean\n req: PayloadRequest\n slug: string\n}): MCPToolResponse | null => {\n let cache = validatorCache.get(req.payload.config)\n if (!cache) {\n cache = new Map()\n validatorCache.set(req.payload.config, cache)\n }\n\n const cacheKey = `${entity}:${slug}:${partial ? 'partial' : 'full'}:${req.i18n.language}`\n let entityValidator = cache.get(cacheKey)\n\n if (!entityValidator) {\n const schema = buildSchema()\n\n if (!schema) {\n return null\n }\n\n entityValidator = {\n schema,\n validate: validator.getValidator(partial ? withoutRequired(schema) : schema),\n }\n cache.set(cacheKey, entityValidator)\n }\n\n const result = entityValidator.validate(data)\n\n if (result.valid) {\n return null\n }\n\n const { schema } = entityValidator\n\n return {\n content: [\n {\n type: 'text',\n text: `Invalid data for ${entity} \"${slug}\": ${result.errorMessage}\\n\\nUse this schema for data:\\n\\`\\`\\`json\\n${JSON.stringify(schema)}\\n\\`\\`\\``,\n },\n ],\n isError: true,\n structuredContent: {\n [`${entity}Slug`]: slug,\n errors: [{ message: result.errorMessage }],\n schema,\n },\n }\n}\n\n/** Updates are partial — drop the schema's top-level `required` before validating. */\nconst withoutRequired = (schema: JsonSchemaType): JsonSchemaType => {\n const { required: _required, ...rest } = schema\n return rest\n}\n"],"names":["CfWorkerJsonSchemaValidator","getCollectionInputSchema","getGlobalInputSchema","validator","shortcircuit","validatorCache","WeakMap","validateCollectionData","collectionSlug","data","partial","req","validateData","slug","buildSchema","entity","validateGlobalData","globalSlug","cache","get","payload","config","Map","set","cacheKey","i18n","language","entityValidator","schema","validate","getValidator","withoutRequired","result","valid","content","type","text","errorMessage","JSON","stringify","isError","structuredContent","errors","message","required","_required","rest"],"mappings":"AAEA,SAASA,2BAA2B,QAAQ,+BAA8B;AAI1E,SACEC,wBAAwB,EACxBC,oBAAoB,QACf,uDAAsD;AAE7D;;CAEC,GACD,MAAMC,YAAY,IAAIH,4BAA4B;IAAEI,cAAc;AAAK;AAOvE;;;CAGC,GACD,MAAMC,iBAAiB,IAAIC;AAE3B,OAAO,MAAMC,yBAAyB,CAAC,EACrCC,cAAc,EACdC,IAAI,EACJC,OAAO,EACPC,GAAG,EAMJ,GACCC,aAAa;QACXC,MAAML;QACNM,aAAa,IAAMb,yBAAyB;gBAAEO;gBAAgBG;YAAI;QAClEF;QACAM,QAAQ;QACRL;QACAC;IACF,GAAE;AAEJ,OAAO,MAAMK,qBAAqB,CAAC,EACjCP,IAAI,EACJQ,UAAU,EACVN,GAAG,EAKJ,GACCC,aAAa;QACXC,MAAMI;QACNH,aAAa,IAAMZ,qBAAqB;gBAAEe;gBAAYN;YAAI;QAC1DF;QACAM,QAAQ;QACRL,SAAS;QACTC;IACF,GAAE;AAEJ,MAAMC,eAAe,CAAC,EACpBC,IAAI,EACJC,WAAW,EACXL,IAAI,EACJM,MAAM,EACNL,OAAO,EACPC,GAAG,EAQJ;IACC,IAAIO,QAAQb,eAAec,GAAG,CAACR,IAAIS,OAAO,CAACC,MAAM;IACjD,IAAI,CAACH,OAAO;QACVA,QAAQ,IAAII;QACZjB,eAAekB,GAAG,CAACZ,IAAIS,OAAO,CAACC,MAAM,EAAEH;IACzC;IAEA,MAAMM,WAAW,GAAGT,OAAO,CAAC,EAAEF,KAAK,CAAC,EAAEH,UAAU,YAAY,OAAO,CAAC,EAAEC,IAAIc,IAAI,CAACC,QAAQ,EAAE;IACzF,IAAIC,kBAAkBT,MAAMC,GAAG,CAACK;IAEhC,IAAI,CAACG,iBAAiB;QACpB,MAAMC,SAASd;QAEf,IAAI,CAACc,QAAQ;YACX,OAAO;QACT;QAEAD,kBAAkB;YAChBC;YACAC,UAAU1B,UAAU2B,YAAY,CAACpB,UAAUqB,gBAAgBH,UAAUA;QACvE;QACAV,MAAMK,GAAG,CAACC,UAAUG;IACtB;IAEA,MAAMK,SAASL,gBAAgBE,QAAQ,CAACpB;IAExC,IAAIuB,OAAOC,KAAK,EAAE;QAChB,OAAO;IACT;IAEA,MAAM,EAAEL,MAAM,EAAE,GAAGD;IAEnB,OAAO;QACLO,SAAS;YACP;gBACEC,MAAM;gBACNC,MAAM,CAAC,iBAAiB,EAAErB,OAAO,EAAE,EAAEF,KAAK,GAAG,EAAEmB,OAAOK,YAAY,CAAC,2CAA2C,EAAEC,KAAKC,SAAS,CAACX,QAAQ,QAAQ,CAAC;YAClJ;SACD;QACDY,SAAS;QACTC,mBAAmB;YACjB,CAAC,GAAG1B,OAAO,IAAI,CAAC,CAAC,EAAEF;YACnB6B,QAAQ;gBAAC;oBAAEC,SAASX,OAAOK,YAAY;gBAAC;aAAE;YAC1CT;QACF;IACF;AACF;AAEA,oFAAoF,GACpF,MAAMG,kBAAkB,CAACH;IACvB,MAAM,EAAEgB,UAAUC,SAAS,EAAE,GAAGC,MAAM,GAAGlB;IACzC,OAAOkB;AACT"}
@@ -0,0 +1,105 @@
1
+ import type { CollectionTool, GlobalTool, Tool } from '../types.js';
2
+ export declare const TOOL_BUILTINS: {
3
+ getConfigInfo: {
4
+ label: string;
5
+ mcpName: string;
6
+ tool: Tool;
7
+ };
8
+ };
9
+ /**
10
+ * The static built-in collection CRUD tools. Keys here are the source of truth
11
+ * for `MCPCollectionBuiltinName` — adding/removing an entry updates the type
12
+ * automatically.
13
+ */
14
+ export declare const COLLECTION_BUILTINS: {
15
+ create: {
16
+ mcpName: string;
17
+ tool: CollectionTool;
18
+ };
19
+ delete: {
20
+ mcpName: string;
21
+ tool: CollectionTool;
22
+ };
23
+ find: {
24
+ mcpName: string;
25
+ tool: CollectionTool;
26
+ };
27
+ getCollectionSchema: {
28
+ mcpName: string;
29
+ tool: CollectionTool;
30
+ };
31
+ update: {
32
+ mcpName: string;
33
+ tool: CollectionTool;
34
+ };
35
+ };
36
+ /**
37
+ * The static auth tools surfaced under auth-enabled collections. Each entry
38
+ * carries the admin-UI label alongside the tool. Keys are the source of truth
39
+ * for `MCPCollectionAuthToolName`.
40
+ */
41
+ export declare const COLLECTION_AUTH_BUILTINS: {
42
+ auth: {
43
+ label: string;
44
+ mcpName: string;
45
+ tool: CollectionTool;
46
+ };
47
+ forgotPassword: {
48
+ label: string;
49
+ mcpName: string;
50
+ tool: CollectionTool;
51
+ };
52
+ login: {
53
+ label: string;
54
+ mcpName: string;
55
+ tool: CollectionTool;
56
+ };
57
+ resetPassword: {
58
+ label: string;
59
+ mcpName: string;
60
+ tool: CollectionTool;
61
+ };
62
+ unlock: {
63
+ label: string;
64
+ mcpName: string;
65
+ tool: CollectionTool;
66
+ };
67
+ verify: {
68
+ label: string;
69
+ mcpName: string;
70
+ tool: CollectionTool;
71
+ };
72
+ };
73
+ /**
74
+ * The static built-in global tools. Keys are the source of truth for
75
+ * `MCPGlobalBuiltinName`.
76
+ */
77
+ export declare const GLOBAL_BUILTINS: {
78
+ find: {
79
+ mcpName: string;
80
+ tool: GlobalTool;
81
+ };
82
+ getGlobalSchema: {
83
+ mcpName: string;
84
+ tool: GlobalTool;
85
+ };
86
+ update: {
87
+ mcpName: string;
88
+ tool: GlobalTool;
89
+ };
90
+ };
91
+ export type MCPCollectionBuiltinName = keyof typeof COLLECTION_BUILTINS;
92
+ export type MCPCollectionAuthToolName = keyof typeof COLLECTION_AUTH_BUILTINS;
93
+ export type MCPGlobalBuiltinName = keyof typeof GLOBAL_BUILTINS;
94
+ export type MCPTopLevelBuiltinName = keyof typeof TOOL_BUILTINS;
95
+ /**
96
+ * Pre-typed `Object.entries` for each registry. The cast from `string` to the
97
+ * literal key union lives here once so consumers can iterate without their own
98
+ * cast — TypeScript's `Object.entries` always widens keys to `string`, which
99
+ * defeats the narrow type lookups on `MCPCollectionToolsMap`.
100
+ */
101
+ export declare const TOOL_BUILTIN_ENTRIES: Array<[MCPTopLevelBuiltinName, (typeof TOOL_BUILTINS)[MCPTopLevelBuiltinName]]>;
102
+ export declare const COLLECTION_BUILTIN_ENTRIES: Array<[MCPCollectionBuiltinName, (typeof COLLECTION_BUILTINS)[MCPCollectionBuiltinName]]>;
103
+ export declare const COLLECTION_AUTH_BUILTIN_ENTRIES: Array<[MCPCollectionAuthToolName, (typeof COLLECTION_AUTH_BUILTINS)[MCPCollectionAuthToolName]]>;
104
+ export declare const GLOBAL_BUILTIN_ENTRIES: Array<[MCPGlobalBuiltinName, (typeof GLOBAL_BUILTINS)[MCPGlobalBuiltinName]]>;
105
+ //# sourceMappingURL=builtinTools.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builtinTools.d.ts","sourceRoot":"","sources":["../../src/mcp/builtinTools.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,aAAa,CAAA;AAoBnE,eAAO,MAAM,aAAa;;;;;;CAEgD,CAAA;AAE1E;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;CAMqC,CAAA;AAErE;;;;GAIG;AACH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAe+C,CAAA;AAEpF;;;GAGG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;CAIqC,CAAA;AAEjE,MAAM,MAAM,wBAAwB,GAAG,MAAM,OAAO,mBAAmB,CAAA;AAEvE,MAAM,MAAM,yBAAyB,GAAG,MAAM,OAAO,wBAAwB,CAAA;AAE7E,MAAM,MAAM,oBAAoB,GAAG,MAAM,OAAO,eAAe,CAAA;AAE/D,MAAM,MAAM,sBAAsB,GAAG,MAAM,OAAO,aAAa,CAAA;AAE/D;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB,EAAoC,KAAK,CACxE,CAAC,sBAAsB,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