A PayloadCMS plugin that integrates with MCP (Model Context Protocol) to enable AI model communication and context sharing within PayloadCMS applications
The server defines 9 tools for PayloadCMS CRUD operations with explicit tool registration via server.tool(). All tools have names, descriptions, and input schemas defined using Zod. However, the definitions have significant gaps: (1) Output schemas are NOT documented, responses are hardcoded as text blobs without structured field definitions; (2) Parameter descriptions are minimal (1 - 5 words), well below the baseline of 72 chars and leaving LLM intent unclear; (3) No error handling guidance, failures return raw text with no recovery hints; (4) Tool descriptions are 15 - 35 chars, below the 50 - 200 char optimal range; (5) No distinction between read-only and write operations in descriptions, despite varying risk profiles (READ_ONLY vs WRITE vs DESTRUCTIVE); (6) No pagination documented for find_documents despite accepting limit/page params; (7) No confirmation/dry-run pattern for destructive operations (delete_document). The Zod schema validation is present and properly typed, which is the strongest aspect. Tools are well-named with clear verbs (get_, create_, update_, delete_, find_). Naming conventions are correct. The composition is sound, each tool does one thing. However, the LLM-facing descriptions are under-optimized.
Create new document in any collection
Create multiple documents in batch
Delete document by ID
Clone existing document
Search/filter documents with query options
Get collection by name
Get all collections from payload
Output schemas are not documented. Tools return hardcoded text responses ('Created document with ID: ...') without specifying what fields the response contains or what structure the LLM should expect. This forces LLMs to parse unstructured text and prevents downstream tool chaining.
Parameter descriptions are minimal (1 - 5 words, e.g., 'Name of the collection to get'). Baseline is 72 chars. Descriptions lack guidance on valid formats, constraints, and when to use each parameter. For example, 'where' in find_documents has no explanation of query syntax or expected structure.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 68 | 2025-06-18+ | v2 |
| 2026-03-09 | C | 65 | 2024-11-05+ | v1 |
Get single document by ID
Update existing document by ID
Tool descriptions are 15 - 35 characters (optimal range: 50 - 200 chars). Descriptions do not explain WHEN to use each tool, WHAT it returns, or WHAT to do if it fails. For example, 'Delete document by ID' does not warn that this is irreversible or advise confirmation.
No error handling guidance. Responses are plain text with no structure for error classification or recovery hints. A failed deletion returns no indication of why it failed or what the LLM should do next. Pattern: recovery-guide.
Destructive operations (delete_document) lack confirmation or dry-run pattern. An LLM can invoke delete_document and permanently remove data without a confirmation step or safety guardrail.
Pagination is not documented for find_documents. The tool accepts 'limit' and 'page' parameters but the description does not explain pagination behavior, default page size, maximum limit, or total count return. This violates the paginated-result pattern.
Tool descriptions do not distinguish risk levels. get_document_by_id (READ_ONLY) and delete_document (DESTRUCTIVE) have equally brief descriptions despite vastly different consequences. Descriptions should warn about write/delete operations.
The 'data' parameter in create_document and create_multiple_documents is typed as z.record(z.any(), z.any()), which is overly permissive and provides no schema validation for document structure. This allows invalid data to be passed without LLM guidance on required vs optional fields.