A simple CRM (Customer Relationship Management) server that manages contacts and deals with search, lead creation, and deal stage updates.
This CRM server has readable tool definitions with basic descriptions, but falls short of production standards in multiple critical areas. All three tools are explicitly registered via @mcp.tool() decorators in main.py with descriptions present, but parameter documentation is minimal, output schemas are undocumented, and error handling is absent. The descriptions are functional but generic (10 - 20 chars below the 50 - 200 char baseline for LLM-optimized text). Parameter types are inferred from Python type hints and are present, but descriptions lack context about constraints, formats, and expected values. Error responses are hardcoded strings ('Deal not found.') with no recovery guidance. No input validation, no pagination support, no field naming conventions followed (e.g., search_contact returns generic dicts without clear field documentation). The mock database leaks implementation details rather than abstracting a clean API contract.
Add a new lead to the CRM.
Search for contacts by name or email.
Update the stage of an existing deal (e.g., 'Negotiation', 'Closed Won').
Output schemas undocumented. search_contact returns List[dict], create_lead returns {success, contact}, update_deal_stage returns str, LLM cannot plan downstream calls or extract specific fields. Field names and types must be declared in tool schema.
Parameter descriptions lack actionable constraints. 'query' in search_contact has no min/max length, format, or examples. 'stage' in update_deal_stage accepts free-form strings with no enum or valid values listed. LLMs will hallucinate invalid values.
Error handling provides no recovery guidance. update_deal_stage returns bare 'Deal not found.' with no suggestions. Pattern demands errors state what went wrong, why, and what to do next (e.g., 'Deal ID 99 not found. Call list_all_deals() to see valid IDs.').
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 49 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 41 | - | v1 |
No input validation. create_lead accepts any name and email with no length limits, format checks, or duplicate detection. A malicious or confused agent could inject empty strings, 100KB names, or invalid email formats.
Mock database is ephemeral and non-idempotent. Repeated calls to create_lead with identical inputs produce duplicate records. No ID-based deduplication or conflict detection. Agents rely on idempotent behavior for safe retries.
Descriptions are below LLM-optimized baseline (50 - 200 chars). search_contact is 37 chars, create_lead is 29 chars, update_deal_stage is 78 chars. They lack context about when to use each tool vs alternatives, what fields are returned, or dependencies.
Response field naming inconsistent. search_contact returns {id, name, email, status}; create_lead wraps in {success, contact}; update_deal_stage returns plain string. Inconsistent structures force LLMs to handle multiple response shapes for similar operations, increasing error likelihood.
No pagination or result limiting. search_contact returns all matching contacts without limit. If database grows to thousands, response balloons and wastes context. No limit parameter, no offset/cursor, no total count.
update_deal_stage accepts free-form 'stage' string with no enum. Valid values are hinted in docstring ('Negotiation', 'Closed Won') as examples, not constraints. LLM may pass 'negotiation' (lowercase), 'In Negotiation', 'Pending', or 'unknown_stage' and fail silently.