FastMCP Server with CSV-backed product lookup, transport tax calculation, and Telegram messaging
This server has 3 tools with varying quality. All tools have explicit registrations with names, descriptions, and schemas visible in main.py. Tool names use action verbs (transport_tax, search_cars_db, send_message_to_telegram). Descriptions are present and reasonably detailed (ranges 95-225 chars, within the 10-1024 baseline). Input schemas are properly typed with JSON Schema. However, there are notable gaps: (1) Output schemas are completely undocumented, tools return Python dicts/lists but the agent has no visibility into their structure; (2) Error handling is minimal, no actionable recovery guidance for LLM; (3) send_message_to_telegram mixes concerns (should separate message composition from delivery); (4) Parameter defaults are not well justified (chat_id=None in send_message_to_telegram creates ambiguity); (5) No tool annotations (destructiveHint, readOnlyHint) despite clear risk profiles. The search_cars_db tool loads CSV on every call, which is inefficient but correct. Overall, definitions are above-average for a community server, but fall short of production-grade strictness.
Search cars by brand and model in a database (case-insensitive). Looks for the query substring in "brand model" or "model brand". Returns matching entries including price (price_rub) and horsepower (engine_power_hp).
Send message to a Telegram chat using a bot.
Calculate the Moscow transport tax for a passenger car. Supports tax years 2015–2025.
Output schemas completely undocumented. Tools return dicts/lists/strings but the agent has zero visibility into structure. transport_tax returns an int (rubles, but this is only in docstring). search_cars_db returns a list of dicts with fields {brand, model, price_rub, engine_power_hp}, but agent must infer from docstring. send_message_to_telegram returns 'OK' or error text, ambiguous on success criteria.
Missing tool annotations (readOnlyHint, destructiveHint). transport_tax is marked READ_ONLY but schema lacks readOnlyHint. send_message_to_telegram is marked WRITE but schema lacks destructiveHint. These annotations guide LLM planning (agents know not to retry read-only ops or to confirm destructive ops). FastMCP supports these via decorator arguments but they are unused here.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-22 | C | 61 | <=2025-11-25 | v2 |
| 2026-03-09 | D | 51 | - | v1 |
Error handling lacks recovery guidance. transport_tax raises ValueError('Поддерживаются годы с 2015 по 2025'), error is in Russian and provides no actionable next step for LLM (should say something like 'Tax year must be 2015-2025; valid range exceeded'). search_cars_db silently returns empty list on empty query; no error feedback. send_message_to_telegram returns unstructured error strings ('Telegram API error: ...') without structured error classification (retryable vs user-fixable).
send_message_to_telegram mixes concerns. The tool both sends messages AND handles auth/fallback to env vars. Better pattern: accept chat_id as required parameter; let the client caller handle resolving a username/channel-name to chat_id via a separate lookup tool. Current design makes the tool less composable and couples message sending to environment-dependent configuration.
search_cars_db loads CSV from disk on every call (load_cars_data called inside the function). This is inefficient for repeated searches. Should load once at server startup into a module-level variable. Current design risks I/O bottleneck under load.
Parameter descriptions lack explicit constraints. transport_tax power parameter has no stated range (should specify what horsepower values are valid, e.g., '1-999 horsepower'). search_cars_db limit parameter is documented as 'If less than 1, at most one result is returned' but this is implicit logic, not a formal min bound. LLMs better understand 'limit >= 1' as explicit constraint.
send_message_to_telegram stores credentials as environment variables (TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID). This is correct (not in tool parameters), but no documentation of how to set these. Server should include setup instructions or fail fast at startup if env vars are missing.