Example MCP server implementation demonstrating Math and Weather services using FastMCP with SSE and stdio transports, integrated with LangChain and LanGraph
This MCP server defines 3 simple arithmetic and weather tools using FastMCP. All tools have minimal but present descriptions and basic input schemas. However, the descriptions are extremely terse (10-28 characters), falling well below the baseline of 194 characters. No output schemas are documented. Parameters lack detailed guidance on valid ranges, formats, or constraints. Error handling is absent, there is no recovery guidance, actionable error messages, or validation hints. The tools are purely read-only utility functions with no state mutation, but the lack of comprehensive documentation and error handling severely limits production readiness. The server demonstrates basic tool registration but lacks the depth expected of production-grade tools.
Add two numbers
Get weather for location.
Multiply two numbers
Descriptions are critically short (10-28 characters). Baseline is 194 characters average. LLMs rely on descriptions to select tools, these are too terse to provide decision-making context. Example: 'Add two numbers' should explain WHEN to use add vs multiply, what edge cases exist, and what the output represents.
No output schemas documented. LLMs cannot reason about downstream tool chaining or data extraction. All three tools return simple types (int, str) but the response structure, edge cases, and error conditions are not formally specified.
No error handling or recovery guidance. The weather tool (get_weather) returns mock data for hardcoded locations and a generic fallback for unknown locations. There is no error recovery path, no structured error classification (retryable vs user-fixable), and no guidance for the LLM on what to do when weather is unavailable.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | F | 45 | 2026-07-28+ | v2 |
| 2026-03-09 | F | 40 | - | v1 |
Numeric parameters (a, b) lack constraints. No minimum/maximum, no guidance on acceptable ranges. An LLM could pass arbitrarily large integers, causing overflow or performance issues. The baseline rubric requires explicit ranges for numeric params (e.g. 'integer in range [-1000000, 1000000]').
The location parameter in get_weather has no enum constraint and no format guidance. The mock implementation accepts hardcoded strings ('nyc', 'sf', 'la') but does not document this. LLMs will guess at valid values and frequently fail.
No validation of inputs or error messages guiding self-correction. If an LLM passes an invalid location to get_weather or extremely large numbers to add/multiply, there is no structured error response explaining what went wrong or how to fix it.