An MCP server that provides weather information using the WeatherAPI.com service
Two tools with basic but incomplete definitions. Both have clear verb-noun naming (get_current_weather, get_forecast) and input schemas with typed parameters. However, descriptions are minimal (under 50 chars), parameter descriptions lack context about format/constraints, and output schemas are entirely undocumented. No error handling guidance, no pagination support despite forecast returning variable-length results, and API key exposed in source code (security risk). Tool definitions are directly visible in weather.py via @mcp.tool() decorators, so no inference penalty applies.
Get current weather for a location.
Get weather forecast for a location (default 3 days).
API key hardcoded in source code (weather.py line 13: API_KEY = '0d492b93dc734774b47174357250908'). Credentials must never appear in tool parameters or source, use server-side secret injection via environment variables or vault.
Tool descriptions are too brief (10-30 chars). 'Get current weather for a location' and 'Get weather forecast for a location (default 3 days)' lack context about when to use each tool, what data is returned, or prerequisites. Descriptions should be 50-200 chars and answer: what does it do, when to use it, what does it return?
Parameter descriptions are missing or trivial. 'Latitude coordinate of the location' and 'Longitude coordinate of the location' do not specify format, range, or valid bounds. LLMs cannot infer that latitude must be -90 to 90 or longitude -180 to 180. Add explicit constraints: 'Latitude in range -90 to 90 (decimal degrees)' and 'Longitude in range -180 to 180 (decimal degrees)'.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 46 | <=2025-11-25 | v2 |
Output schema is completely undocumented. Both tools return plain text strings with no structured schema. LLMs cannot plan downstream operations or extract specific fields. Return structured JSON with typed fields (e.g. {location: string, condition: string, temperature_c: number, humidity_percent: number, wind_kph: number}) so agents can compose results.
No error handling guidance. If the API fails (invalid coordinates, rate limit, network timeout), the tool returns a generic string like 'Unable to fetch current weather data.' LLMs cannot determine if the error is retryable, user-fixable, or fatal. Add error classification and recovery hints: 'Invalid coordinates (latitude must be -90 to 90). Try search_locations() first.' or 'API rate limit exceeded. Retry in 60 seconds.'