@govcraft/payload-cms-mcp 1.0.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 (121) hide show
  1. package/README.md +164 -0
  2. package/dist/config/index.d.ts +27 -0
  3. package/dist/config/index.js +31 -0
  4. package/dist/config/index.js.map +1 -0
  5. package/dist/controllers/mcp.controller.d.ts +7 -0
  6. package/dist/controllers/mcp.controller.js +328 -0
  7. package/dist/controllers/mcp.controller.js.map +1 -0
  8. package/dist/controllers/payload-mcp.controller.d.ts +4 -0
  9. package/dist/controllers/payload-mcp.controller.js +185 -0
  10. package/dist/controllers/payload-mcp.controller.js.map +1 -0
  11. package/dist/generate-tools.d.ts +1 -0
  12. package/dist/generate-tools.js +1417 -0
  13. package/dist/generate-tools.js.map +1 -0
  14. package/dist/index.d.ts +2 -0
  15. package/dist/index.js +16 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/mcp/anthropic-mcp.d.ts +3 -0
  18. package/dist/mcp/anthropic-mcp.js +332 -0
  19. package/dist/mcp/anthropic-mcp.js.map +1 -0
  20. package/dist/mcp/generated/index.d.ts +44 -0
  21. package/dist/mcp/generated/index.js +45 -0
  22. package/dist/mcp/generated/index.js.map +1 -0
  23. package/dist/mcp/generated/payload-tools.d.ts +7 -0
  24. package/dist/mcp/generated/payload-tools.js +69 -0
  25. package/dist/mcp/generated/payload-tools.js.map +1 -0
  26. package/dist/mcp/generated/payload-tools.json +13024 -0
  27. package/dist/mcp/generated/tools/create.json +9138 -0
  28. package/dist/mcp/generated/tools/createAccess.json +10 -0
  29. package/dist/mcp/generated/tools/createAfterChangeHook.json +9 -0
  30. package/dist/mcp/generated/tools/createAfterDeleteHook.json +9 -0
  31. package/dist/mcp/generated/tools/createAfterErrorHook.json +9 -0
  32. package/dist/mcp/generated/tools/createAfterForgotPasswordHook.json +9 -0
  33. package/dist/mcp/generated/tools/createAfterLoginHook.json +9 -0
  34. package/dist/mcp/generated/tools/createAfterLogoutHook.json +9 -0
  35. package/dist/mcp/generated/tools/createAfterMeHook.json +9 -0
  36. package/dist/mcp/generated/tools/createAfterOperationHook.json +9 -0
  37. package/dist/mcp/generated/tools/createAfterReadHook.json +9 -0
  38. package/dist/mcp/generated/tools/createAfterRefreshHook.json +9 -0
  39. package/dist/mcp/generated/tools/createArrayField.json +90 -0
  40. package/dist/mcp/generated/tools/createBeforeChangeHook.json +9 -0
  41. package/dist/mcp/generated/tools/createBeforeDeleteHook.json +9 -0
  42. package/dist/mcp/generated/tools/createBeforeLoginHook.json +9 -0
  43. package/dist/mcp/generated/tools/createBeforeOperationHook.json +9 -0
  44. package/dist/mcp/generated/tools/createBeforeReadHook.json +9 -0
  45. package/dist/mcp/generated/tools/createBeforeValidateHook.json +9 -0
  46. package/dist/mcp/generated/tools/createBlocksField.json +79 -0
  47. package/dist/mcp/generated/tools/createCodeField.json +79 -0
  48. package/dist/mcp/generated/tools/createCollection.json +422 -0
  49. package/dist/mcp/generated/tools/createCollectionAdminOptions.json +2789 -0
  50. package/dist/mcp/generated/tools/createDateField.json +84 -0
  51. package/dist/mcp/generated/tools/createEmailField.json +87 -0
  52. package/dist/mcp/generated/tools/createField.json +31 -0
  53. package/dist/mcp/generated/tools/createGlobal.json +220 -0
  54. package/dist/mcp/generated/tools/createGroupField.json +79 -0
  55. package/dist/mcp/generated/tools/createJSONField.json +79 -0
  56. package/dist/mcp/generated/tools/createJoinField.json +79 -0
  57. package/dist/mcp/generated/tools/createMeHook.json +9 -0
  58. package/dist/mcp/generated/tools/createNumberField.json +31 -0
  59. package/dist/mcp/generated/tools/createPointField.json +79 -0
  60. package/dist/mcp/generated/tools/createPolymorphicRelationshipField.json +31 -0
  61. package/dist/mcp/generated/tools/createRadioField.json +94 -0
  62. package/dist/mcp/generated/tools/createRefreshHook.json +9 -0
  63. package/dist/mcp/generated/tools/createRelationshipField.json +31 -0
  64. package/dist/mcp/generated/tools/createRichTextField.json +79 -0
  65. package/dist/mcp/generated/tools/createSelectField.json +31 -0
  66. package/dist/mcp/generated/tools/createSingleRelationshipField.json +31 -0
  67. package/dist/mcp/generated/tools/createTextField.json +31 -0
  68. package/dist/mcp/generated/tools/createTextareaField.json +87 -0
  69. package/dist/mcp/generated/tools/createUploadField.json +31 -0
  70. package/dist/mcp/handler.d.ts +6 -0
  71. package/dist/mcp/handler.js +147 -0
  72. package/dist/mcp/handler.js.map +1 -0
  73. package/dist/mcp/index.d.ts +1 -0
  74. package/dist/mcp/index.js +28 -0
  75. package/dist/mcp/index.js.map +1 -0
  76. package/dist/mcp/io/index.d.ts +2 -0
  77. package/dist/mcp/io/index.js +31 -0
  78. package/dist/mcp/io/index.js.map +1 -0
  79. package/dist/mcp/io/stdin.d.ts +2 -0
  80. package/dist/mcp/io/stdin.js +118 -0
  81. package/dist/mcp/io/stdin.js.map +1 -0
  82. package/dist/mcp/session.d.ts +16 -0
  83. package/dist/mcp/session.js +85 -0
  84. package/dist/mcp/session.js.map +1 -0
  85. package/dist/mcp/sse.d.ts +10 -0
  86. package/dist/mcp/sse.js +86 -0
  87. package/dist/mcp/sse.js.map +1 -0
  88. package/dist/mcp/tools/calculator.d.ts +2 -0
  89. package/dist/mcp/tools/calculator.js +68 -0
  90. package/dist/mcp/tools/calculator.js.map +1 -0
  91. package/dist/mcp/tools/index.d.ts +3 -0
  92. package/dist/mcp/tools/index.js +6 -0
  93. package/dist/mcp/tools/index.js.map +1 -0
  94. package/dist/mcp/tools/list-tools.d.ts +2 -0
  95. package/dist/mcp/tools/list-tools.js +47 -0
  96. package/dist/mcp/tools/list-tools.js.map +1 -0
  97. package/dist/mcp/tools/payload-tools-loader.d.ts +2 -0
  98. package/dist/mcp/tools/payload-tools-loader.js +21 -0
  99. package/dist/mcp/tools/payload-tools-loader.js.map +1 -0
  100. package/dist/mcp/types.d.ts +69 -0
  101. package/dist/mcp/types.js +2 -0
  102. package/dist/mcp/types.js.map +1 -0
  103. package/dist/middleware/errorHandler.d.ts +14 -0
  104. package/dist/middleware/errorHandler.js +25 -0
  105. package/dist/middleware/errorHandler.js.map +1 -0
  106. package/dist/middleware/notFoundHandler.d.ts +2 -0
  107. package/dist/middleware/notFoundHandler.js +8 -0
  108. package/dist/middleware/notFoundHandler.js.map +1 -0
  109. package/dist/routes/health.d.ts +2 -0
  110. package/dist/routes/health.js +18 -0
  111. package/dist/routes/health.js.map +1 -0
  112. package/dist/routes/mcp.d.ts +2 -0
  113. package/dist/routes/mcp.js +11 -0
  114. package/dist/routes/mcp.js.map +1 -0
  115. package/dist/routes/payload-mcp.routes.d.ts +3 -0
  116. package/dist/routes/payload-mcp.routes.js +8 -0
  117. package/dist/routes/payload-mcp.routes.js.map +1 -0
  118. package/dist/utils/logger.d.ts +2 -0
  119. package/dist/utils/logger.js +35 -0
  120. package/dist/utils/logger.js.map +1 -0
  121. package/package.json +64 -0
@@ -0,0 +1,84 @@
1
+ {
2
+ "name": "createDateField",
3
+ "description": "Creates a Payload CMS 3.0 DateField configuration\n\nExample:\n```typescript\n{\n name: 'dateField',\n type: 'date',\n required: true,\n label: 'Date Field',\n // Custom validation example\n validate: (value, { siblingData, operation }) => {\n // Validation logic based on the value, sibling data, or operation\n if (operation === 'create' && !value) {\n return 'This field is required for new records';\n }\n return true;\n }\n}\n```",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "format": "date-time",
7
+ "description": "Date string (ISO format)",
8
+ "properties": {
9
+ "name": {
10
+ "type": "string",
11
+ "description": "The name of the field, used as the property name in the database"
12
+ },
13
+ "type": {
14
+ "type": "string",
15
+ "enum": [
16
+ "date"
17
+ ],
18
+ "description": "The type of field"
19
+ },
20
+ "label": {
21
+ "type": "string",
22
+ "description": "The label shown in the admin UI"
23
+ },
24
+ "required": {
25
+ "type": "boolean",
26
+ "description": "Whether this field is required"
27
+ },
28
+ "admin": {
29
+ "type": "object",
30
+ "description": "Admin panel configuration for this field",
31
+ "properties": {
32
+ "description": {
33
+ "type": "string",
34
+ "description": "Additional description shown in the admin UI"
35
+ },
36
+ "position": {
37
+ "type": "string",
38
+ "enum": [
39
+ "sidebar"
40
+ ],
41
+ "description": "Position of the field in the admin UI"
42
+ },
43
+ "width": {
44
+ "type": "string",
45
+ "description": "Width of the field in the admin UI"
46
+ },
47
+ "style": {
48
+ "type": "object",
49
+ "description": "Custom CSS styles for the field"
50
+ },
51
+ "className": {
52
+ "type": "string",
53
+ "description": "CSS class name for the field"
54
+ },
55
+ "readOnly": {
56
+ "type": "boolean",
57
+ "description": "Whether the field is read-only in the admin UI"
58
+ },
59
+ "hidden": {
60
+ "type": "boolean",
61
+ "description": "Whether the field is hidden in the admin UI"
62
+ },
63
+ "condition": {
64
+ "type": "string",
65
+ "description": "Condition for showing/hiding the field"
66
+ }
67
+ }
68
+ },
69
+ "defaultValue": {
70
+ "type": "string",
71
+ "description": "Default date value"
72
+ },
73
+ "validate": {
74
+ "type": "string",
75
+ "description": "Custom validation function that returns true if valid or an error message string if invalid"
76
+ }
77
+ },
78
+ "required": [
79
+ "name",
80
+ "type"
81
+ ]
82
+ },
83
+ "template": "{\n name: '{name}', // Database field name\n type: 'date',\n label: 'Date Field', // Label shown in the admin UI\n required: true,\n admin: {\n date: {\n pickerAppearance: 'dayAndTime', // 'dayOnly', 'timeOnly', or 'dayAndTime'\n },\n },\n // Optional: Add custom validation\n validate: (value) => {\n const date = new Date(value);\n if (date < new Date()) {\n return 'Date must be in the future';\n }\n return true; // Return true if valid\n },\n}"
84
+ }
@@ -0,0 +1,87 @@
1
+ {
2
+ "name": "createEmailField",
3
+ "description": "Creates a Payload CMS 3.0 EmailField configuration\n\nExample:\n```typescript\n{\n name: 'emailField',\n type: 'email',\n required: true,\n label: 'Email Field',\n // Custom validation example\n validate: (value, { siblingData, operation }) => {\n // Validation logic based on the value, sibling data, or operation\n if (operation === 'create' && !value) {\n return 'This field is required for new records';\n }\n return true;\n }\n}\n```",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "description": "Payload.EmailField configuration object",
7
+ "properties": {
8
+ "name": {
9
+ "type": "string",
10
+ "description": "The name of the field, used as the property name in the database"
11
+ },
12
+ "type": {
13
+ "type": "string",
14
+ "enum": [
15
+ "email"
16
+ ],
17
+ "description": "The type of field"
18
+ },
19
+ "label": {
20
+ "type": "string",
21
+ "description": "The label shown in the admin UI"
22
+ },
23
+ "required": {
24
+ "type": "boolean",
25
+ "description": "Whether this field is required"
26
+ },
27
+ "admin": {
28
+ "type": "object",
29
+ "description": "Admin panel configuration for this field",
30
+ "properties": {
31
+ "description": {
32
+ "type": "string",
33
+ "description": "Additional description shown in the admin UI"
34
+ },
35
+ "position": {
36
+ "type": "string",
37
+ "enum": [
38
+ "sidebar"
39
+ ],
40
+ "description": "Position of the field in the admin UI"
41
+ },
42
+ "width": {
43
+ "type": "string",
44
+ "description": "Width of the field in the admin UI"
45
+ },
46
+ "style": {
47
+ "type": "object",
48
+ "description": "Custom CSS styles for the field"
49
+ },
50
+ "className": {
51
+ "type": "string",
52
+ "description": "CSS class name for the field"
53
+ },
54
+ "readOnly": {
55
+ "type": "boolean",
56
+ "description": "Whether the field is read-only in the admin UI"
57
+ },
58
+ "hidden": {
59
+ "type": "boolean",
60
+ "description": "Whether the field is hidden in the admin UI"
61
+ },
62
+ "condition": {
63
+ "type": "string",
64
+ "description": "Condition for showing/hiding the field"
65
+ }
66
+ }
67
+ },
68
+ "minLength": {
69
+ "type": "number",
70
+ "description": "Minimum length of the text"
71
+ },
72
+ "maxLength": {
73
+ "type": "number",
74
+ "description": "Maximum length of the text"
75
+ },
76
+ "validate": {
77
+ "type": "string",
78
+ "description": "Custom validation function that returns true if valid or an error message string if invalid"
79
+ }
80
+ },
81
+ "required": [
82
+ "name",
83
+ "type"
84
+ ]
85
+ },
86
+ "template": "{\n name: '{name}', // Database field name\n type: 'email',\n label: 'Email Field', // Label shown in the admin UI\n required: true,\n // Optional: Add custom validation beyond the built-in email validation\n validate: (value) => {\n if (value && !value.includes('@example.com')) {\n return 'Only example.com email addresses are allowed';\n }\n return true; // Return true if valid\n },\n // Optional: Admin UI configuration\n admin: {\n description: 'Enter a valid email address',\n position: 'sidebar'\n }\n}"
87
+ }
@@ -0,0 +1,31 @@
1
+ {
2
+ "name": "createField",
3
+ "description": "Creates a Payload CMS 3.0 Field configuration\n\nExample:\n```typescript\n{\n name: 'Field',\n type: '',\n required: true,\n label: ' Field',\n // Custom validation example\n validate: (value, { siblingData, operation }) => {\n // Validation logic based on the value, sibling data, or operation\n if (operation === 'create' && !value) {\n return 'This field is required for new records';\n }\n return true;\n }\n}\n```",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "name": {
8
+ "type": "string",
9
+ "description": "The name of the field"
10
+ },
11
+ "type": {
12
+ "type": "string",
13
+ "description": "The type of field"
14
+ },
15
+ "label": {
16
+ "type": "string",
17
+ "description": "The label shown in the admin UI"
18
+ },
19
+ "required": {
20
+ "type": "boolean",
21
+ "description": "Whether this field is required"
22
+ }
23
+ },
24
+ "required": [
25
+ "name",
26
+ "type"
27
+ ],
28
+ "description": "Field configuration"
29
+ },
30
+ "template": "{\n name: '{name}', // Database field name\n type: 'text',\n label: 'Text Field', // Label shown in the admin UI\n required: true,\n minLength: 2,\n maxLength: 100,\n // Optional: Add custom validation\n validate: (value, { siblingData }) => {\n if (value && value.toLowerCase().includes('forbidden')) {\n return 'This field cannot contain the word \"forbidden\"';\n }\n return true; // Return true if valid\n },\n // Optional: Admin UI configuration\n admin: {\n description: 'Enter text content here',\n position: 'sidebar',\n width: '50%',\n readOnly: false,\n hidden: false\n }\n}"
31
+ }
@@ -0,0 +1,220 @@
1
+ {
2
+ "name": "createGlobal",
3
+ "description": "Creates a Payload CMS 3.0 GlobalConfig configuration",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {
7
+ "endpoints": {
8
+ "oneOf": [
9
+ {
10
+ "type": "object",
11
+ "description": "false configuration object"
12
+ },
13
+ {
14
+ "type": "array",
15
+ "items": {
16
+ "type": "object",
17
+ "properties": {
18
+ "custom": {
19
+ "type": "object",
20
+ "properties": {}
21
+ },
22
+ "handler": {
23
+ "type": "string",
24
+ "description": "Function expression (e.g., \"({ req }) => req.user.role === 'admin'\")"
25
+ },
26
+ "method": {
27
+ "type": "string",
28
+ "enum": [
29
+ "connect",
30
+ "delete",
31
+ "get",
32
+ "head",
33
+ "options",
34
+ "patch",
35
+ "post",
36
+ "put"
37
+ ],
38
+ "description": "One of the allowed string values"
39
+ },
40
+ "path": {
41
+ "type": "string"
42
+ },
43
+ "root": {
44
+ "type": "object",
45
+ "description": "never configuration object"
46
+ }
47
+ },
48
+ "required": [
49
+ "method",
50
+ "path"
51
+ ]
52
+ }
53
+ }
54
+ ],
55
+ "description": "One of the allowed types"
56
+ },
57
+ "fields": {
58
+ "type": "array",
59
+ "items": {
60
+ "type": "object",
61
+ "properties": {
62
+ "name": {
63
+ "type": "string",
64
+ "description": "The name of the field"
65
+ },
66
+ "type": {
67
+ "type": "string",
68
+ "description": "The type of field"
69
+ },
70
+ "label": {
71
+ "type": "string",
72
+ "description": "The label shown in the admin UI"
73
+ },
74
+ "required": {
75
+ "type": "boolean",
76
+ "description": "Whether this field is required"
77
+ },
78
+ "admin": {
79
+ "type": "object",
80
+ "description": "Admin panel configuration for this field",
81
+ "properties": {
82
+ "description": {
83
+ "type": "string",
84
+ "description": "Additional description shown in the admin UI"
85
+ },
86
+ "position": {
87
+ "type": "string",
88
+ "enum": [
89
+ "sidebar"
90
+ ],
91
+ "description": "Position of the field in the admin UI"
92
+ },
93
+ "width": {
94
+ "type": "string",
95
+ "description": "Width of the field in the admin UI"
96
+ },
97
+ "style": {
98
+ "type": "object",
99
+ "description": "Custom CSS styles for the field"
100
+ },
101
+ "className": {
102
+ "type": "string",
103
+ "description": "CSS class name for the field"
104
+ },
105
+ "readOnly": {
106
+ "type": "boolean",
107
+ "description": "Whether the field is read-only in the admin UI"
108
+ },
109
+ "hidden": {
110
+ "type": "boolean",
111
+ "description": "Whether the field is hidden in the admin UI"
112
+ },
113
+ "condition": {
114
+ "type": "string",
115
+ "description": "Condition for showing/hiding the field"
116
+ },
117
+ "components": {
118
+ "type": "object",
119
+ "description": "Custom components for the field",
120
+ "properties": {
121
+ "Field": {
122
+ "type": "string",
123
+ "description": "Custom field component"
124
+ },
125
+ "Cell": {
126
+ "type": "string",
127
+ "description": "Custom cell component for list views"
128
+ },
129
+ "Filter": {
130
+ "type": "string",
131
+ "description": "Custom filter component"
132
+ }
133
+ }
134
+ }
135
+ }
136
+ }
137
+ },
138
+ "required": [
139
+ "name",
140
+ "type"
141
+ ]
142
+ },
143
+ "description": "Array of field configurations"
144
+ },
145
+ "flattenedFields": {
146
+ "type": "array",
147
+ "items": {
148
+ "type": "object",
149
+ "description": "any configuration object"
150
+ },
151
+ "description": "Fields in the database schema structure\nRows / collapsible / tabs w/o name `fields` merged to top, UIs are excluded"
152
+ },
153
+ "slug": {
154
+ "type": "string"
155
+ },
156
+ "versions": {
157
+ "type": "object",
158
+ "properties": {
159
+ "drafts": {
160
+ "oneOf": [
161
+ {
162
+ "type": "object",
163
+ "description": "false configuration object"
164
+ },
165
+ {
166
+ "type": "object",
167
+ "properties": {
168
+ "autosave": {
169
+ "oneOf": [
170
+ {
171
+ "type": "object",
172
+ "description": "false configuration object"
173
+ },
174
+ {
175
+ "type": "object",
176
+ "properties": {
177
+ "interval": {
178
+ "type": "number"
179
+ }
180
+ }
181
+ }
182
+ ],
183
+ "description": "One of the allowed types"
184
+ },
185
+ "schedulePublish": {
186
+ "type": "boolean"
187
+ },
188
+ "validate": {
189
+ "type": "boolean"
190
+ }
191
+ },
192
+ "required": [
193
+ "autosave",
194
+ "schedulePublish",
195
+ "validate"
196
+ ]
197
+ }
198
+ ],
199
+ "description": "One of the allowed types"
200
+ },
201
+ "max": {
202
+ "type": "number"
203
+ }
204
+ },
205
+ "required": [
206
+ "drafts",
207
+ "max"
208
+ ]
209
+ }
210
+ },
211
+ "required": [
212
+ "endpoints",
213
+ "fields",
214
+ "flattenedFields",
215
+ "slug",
216
+ "versions"
217
+ ]
218
+ },
219
+ "template": "// Global configuration for Payload CMS\nexport const {slug} = {\n slug: '{slug}', // URL-friendly identifier for this global\n admin: {\n group: 'Settings', // Group in the admin UI\n },\n // Define the fields for this global\n fields: [\n // Add your fields here\n {fields}\n ],\n // Optional: Add hooks, access control, etc.\n ...{rest}\n};"
220
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "createGroupField",
3
+ "description": "Creates a Payload CMS 3.0 GroupField configuration\n\nExample:\n```typescript\n{\n name: 'groupField',\n type: 'group',\n required: true,\n label: 'Group Field',\n // Custom validation example\n validate: (value, { siblingData, operation }) => {\n // Validation logic based on the value, sibling data, or operation\n if (operation === 'create' && !value) {\n return 'This field is required for new records';\n }\n return true;\n }\n}\n```",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "description": "Payload.GroupField configuration object",
7
+ "properties": {
8
+ "name": {
9
+ "type": "string",
10
+ "description": "The name of the field, used as the property name in the database"
11
+ },
12
+ "type": {
13
+ "type": "string",
14
+ "enum": [
15
+ "group"
16
+ ],
17
+ "description": "The type of field"
18
+ },
19
+ "label": {
20
+ "type": "string",
21
+ "description": "The label shown in the admin UI"
22
+ },
23
+ "required": {
24
+ "type": "boolean",
25
+ "description": "Whether this field is required"
26
+ },
27
+ "admin": {
28
+ "type": "object",
29
+ "description": "Admin panel configuration for this field",
30
+ "properties": {
31
+ "description": {
32
+ "type": "string",
33
+ "description": "Additional description shown in the admin UI"
34
+ },
35
+ "position": {
36
+ "type": "string",
37
+ "enum": [
38
+ "sidebar"
39
+ ],
40
+ "description": "Position of the field in the admin UI"
41
+ },
42
+ "width": {
43
+ "type": "string",
44
+ "description": "Width of the field in the admin UI"
45
+ },
46
+ "style": {
47
+ "type": "object",
48
+ "description": "Custom CSS styles for the field"
49
+ },
50
+ "className": {
51
+ "type": "string",
52
+ "description": "CSS class name for the field"
53
+ },
54
+ "readOnly": {
55
+ "type": "boolean",
56
+ "description": "Whether the field is read-only in the admin UI"
57
+ },
58
+ "hidden": {
59
+ "type": "boolean",
60
+ "description": "Whether the field is hidden in the admin UI"
61
+ },
62
+ "condition": {
63
+ "type": "string",
64
+ "description": "Condition for showing/hiding the field"
65
+ }
66
+ }
67
+ },
68
+ "validate": {
69
+ "type": "string",
70
+ "description": "Custom validation function that returns true if valid or an error message string if invalid"
71
+ }
72
+ },
73
+ "required": [
74
+ "name",
75
+ "type"
76
+ ]
77
+ },
78
+ "template": "{\n name: '{name}', // Database field name\n type: 'group',\n label: 'Group Field', // Label shown in the admin UI\n fields: [\n {\n name: 'groupedField1',\n type: 'text',\n required: true,\n },\n {\n name: 'groupedField2',\n type: 'number',\n },\n // Add more fields as needed\n ],\n // Optional: Add custom validation for the entire group\n validate: (value) => {\n if (value && (!value.groupedField1 || !value.groupedField2)) {\n return 'Both fields in the group are required';\n }\n return true; // Return true if valid\n },\n}"
79
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "createJSONField",
3
+ "description": "Creates a Payload CMS 3.0 JSONField configuration\n\nExample:\n```typescript\n{\n name: 'jsonField',\n type: 'json',\n required: true,\n label: 'Json Field',\n // Custom validation example\n validate: (value, { siblingData, operation }) => {\n // Validation logic based on the value, sibling data, or operation\n if (operation === 'create' && !value) {\n return 'This field is required for new records';\n }\n return true;\n }\n}\n```",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "description": "Payload.JSONField configuration object",
7
+ "properties": {
8
+ "name": {
9
+ "type": "string",
10
+ "description": "The name of the field, used as the property name in the database"
11
+ },
12
+ "type": {
13
+ "type": "string",
14
+ "enum": [
15
+ "json"
16
+ ],
17
+ "description": "The type of field"
18
+ },
19
+ "label": {
20
+ "type": "string",
21
+ "description": "The label shown in the admin UI"
22
+ },
23
+ "required": {
24
+ "type": "boolean",
25
+ "description": "Whether this field is required"
26
+ },
27
+ "admin": {
28
+ "type": "object",
29
+ "description": "Admin panel configuration for this field",
30
+ "properties": {
31
+ "description": {
32
+ "type": "string",
33
+ "description": "Additional description shown in the admin UI"
34
+ },
35
+ "position": {
36
+ "type": "string",
37
+ "enum": [
38
+ "sidebar"
39
+ ],
40
+ "description": "Position of the field in the admin UI"
41
+ },
42
+ "width": {
43
+ "type": "string",
44
+ "description": "Width of the field in the admin UI"
45
+ },
46
+ "style": {
47
+ "type": "object",
48
+ "description": "Custom CSS styles for the field"
49
+ },
50
+ "className": {
51
+ "type": "string",
52
+ "description": "CSS class name for the field"
53
+ },
54
+ "readOnly": {
55
+ "type": "boolean",
56
+ "description": "Whether the field is read-only in the admin UI"
57
+ },
58
+ "hidden": {
59
+ "type": "boolean",
60
+ "description": "Whether the field is hidden in the admin UI"
61
+ },
62
+ "condition": {
63
+ "type": "string",
64
+ "description": "Condition for showing/hiding the field"
65
+ }
66
+ }
67
+ },
68
+ "validate": {
69
+ "type": "string",
70
+ "description": "Custom validation function that returns true if valid or an error message string if invalid"
71
+ }
72
+ },
73
+ "required": [
74
+ "name",
75
+ "type"
76
+ ]
77
+ },
78
+ "template": "{\n name: '{name}', // Database field name\n type: 'json',\n label: 'JSON Field', // Label shown in the admin UI\n // Optional: Add custom validation\n validate: (value) => {\n try {\n if (typeof value === 'string') {\n JSON.parse(value);\n }\n return true; // Return true if valid\n } catch (err) {\n return 'Invalid JSON format';\n }\n },\n}"
79
+ }
@@ -0,0 +1,79 @@
1
+ {
2
+ "name": "createJoinField",
3
+ "description": "Creates a Payload CMS 3.0 JoinField configuration\n\nA virtual field that loads in related collections by querying a relationship or upload field.\n\nExample:\n```typescript\n{\n name: 'joinField',\n type: 'join',\n required: true,\n label: 'Join Field',\n // Custom validation example\n validate: (value, { siblingData, operation }) => {\n // Validation logic based on the value, sibling data, or operation\n if (operation === 'create' && !value) {\n return 'This field is required for new records';\n }\n return true;\n }\n}\n```",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "description": "Payload.JoinField configuration object",
7
+ "properties": {
8
+ "name": {
9
+ "type": "string",
10
+ "description": "The name of the field, used as the property name in the database"
11
+ },
12
+ "type": {
13
+ "type": "string",
14
+ "enum": [
15
+ "join"
16
+ ],
17
+ "description": "The type of field"
18
+ },
19
+ "label": {
20
+ "type": "string",
21
+ "description": "The label shown in the admin UI"
22
+ },
23
+ "required": {
24
+ "type": "boolean",
25
+ "description": "Whether this field is required"
26
+ },
27
+ "admin": {
28
+ "type": "object",
29
+ "description": "Admin panel configuration for this field",
30
+ "properties": {
31
+ "description": {
32
+ "type": "string",
33
+ "description": "Additional description shown in the admin UI"
34
+ },
35
+ "position": {
36
+ "type": "string",
37
+ "enum": [
38
+ "sidebar"
39
+ ],
40
+ "description": "Position of the field in the admin UI"
41
+ },
42
+ "width": {
43
+ "type": "string",
44
+ "description": "Width of the field in the admin UI"
45
+ },
46
+ "style": {
47
+ "type": "object",
48
+ "description": "Custom CSS styles for the field"
49
+ },
50
+ "className": {
51
+ "type": "string",
52
+ "description": "CSS class name for the field"
53
+ },
54
+ "readOnly": {
55
+ "type": "boolean",
56
+ "description": "Whether the field is read-only in the admin UI"
57
+ },
58
+ "hidden": {
59
+ "type": "boolean",
60
+ "description": "Whether the field is hidden in the admin UI"
61
+ },
62
+ "condition": {
63
+ "type": "string",
64
+ "description": "Condition for showing/hiding the field"
65
+ }
66
+ }
67
+ },
68
+ "validate": {
69
+ "type": "string",
70
+ "description": "Custom validation function that returns true if valid or an error message string if invalid"
71
+ }
72
+ },
73
+ "required": [
74
+ "name",
75
+ "type"
76
+ ]
77
+ },
78
+ "template": "{\n name: '{name}', // Database field name\n type: 'join',\n label: 'Join Field', // Label shown in the admin UI\n required: true,\n // Add field-specific properties here\n \n // Optional: Add custom validation\n validate: (value, { siblingData, operation }) => {\n // Custom validation logic based on the value, sibling data, or operation\n if (!value && operation === 'create') {\n return 'This field is required for new records';\n }\n return true; // Return true if valid\n },\n ...{rest}\n}"
79
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "name": "createMeHook",
3
+ "description": "Creates a Payload CMS 3.0 MeHook configuration",
4
+ "inputSchema": {
5
+ "type": "object",
6
+ "properties": {}
7
+ },
8
+ "template": "/**\n * Generic Payload CMS hook\n * See documentation for specific hook parameters\n */\nconst hook = (args) => {\n // Extract relevant properties from args based on hook type\n const { req } = args;\n \n // Example: Log hook execution\n logger.info('Hook executed');\n \n // For hooks that modify data, return the modified data\n // For other hooks, return as appropriate for the hook type\n return args.data ? { ...args.data, modified: true } : undefined;\n};"
9
+ }