MCP server for product management with FastAPI integration and LangGraph agent support
ProductMCP has 4 tools with basic descriptions and schemas, but significant gaps prevent higher scores. All tools have descriptions (10-50 chars, below the 50-200 char LLM-optimized baseline), and input schemas are present but minimal. list_products and get_statistics have empty input objects ({}), which is correct but offers no parameter guidance. add_product has the most complete schema with 4 parameters, each with type and description. However, descriptions lack context about when to use each tool, what they return, or error recovery paths. No tool documents output schemas, pagination, or error handling guidance. The server lacks tool annotations (readOnlyHint, destructiveHint) despite having clear READ_ONLY vs WRITE risk classifications. Error handling is minimal, get_product mentions ValueError but provides no recovery guidance. Overall, this is a functional but minimal implementation typical of early-stage MCP servers.
Add a new product and return it.
Return a single product by ID. Raises: ValueError: If the product is not found.
Return product statistics (count and average price).
Return all available products.
Descriptions are too short (10-50 chars) and lack LLM-optimized context. Should be 50-200 chars explaining WHAT, WHEN, and WHAT IT RETURNS. E.g., 'list_products' should say 'Retrieve all available products with ID, name, price, category, and stock status. Use this to discover inventory before filtering or adding items.'
No output schemas documented. LLMs cannot plan downstream calls or extract fields without knowing what list_products, get_product, and add_product return. Document return types: e.g., 'Returns list of {id: int, name: str, price: float, category: str, in_stock: bool}' and 'Returns single product object or error if not found.'
Missing tool annotations. add_product is destructive (WRITE risk) but has no destructiveHint. list_products, get_product, get_statistics are READ_ONLY but lack readOnlyHint. Annotations help LLMs reason about retry safety and side effects.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 49 | <=2025-11-25 | v2 |
Error handling lacks recovery guidance. get_product docstring mentions 'Raises ValueError if not found' but provides no actionable next step for the LLM. Should say: 'If product not found, try list_products() to see available IDs or search by category.'
Parameter descriptions for add_product lack format/constraint details. 'price' should specify 'positive number, e.g., 9.99'. 'category' should list valid options or say 'any string'. 'in_stock' default is true but description doesn't explain the default behavior.