feat: enrich tool instructions, system prompts, and error hints
...
1. models.py — enriched Field descriptions with:
- ✓/✗ query examples in descriptions
- ILIKE semantics for city/district/metro
- currency+price coupling warnings
- rooms_count: 0=studio note
- pagination strategy hints
- Removed min_similarity from SearchSimilarInput (now hardcoded 0.7 in tools.py)
2. tools.py — added intelligent response layers:
- _build_fallback_hint() — returns strategy tips on 0 results
(switch tool, drop filters, simplify query, check language)
- _build_invalid_query_hint() — detects stop-words & short queries,
returns formatting tips with good/bad examples
- describe_schema() enriched with:
- usage_guidelines (when vector vs FTS)
- query_examples (good/bad for both search types)
- filter_combinations (recommended / avoid)
- pagination_strategy
3. main.py — enriched tool docstrings with:
- "When to use" vs other tools
- Filter best practices
- Fallback behavior description
- Added @mcp.prompt() 'search_guide' — full agent guide
- Added module docstring with server purpose, data scope, language
4. test_models.py — updated for removed min_similarity,
added tests for description hints presence
10 tests pass, ruff clean.
Co-Authored-By: Claude <noreply@anthropic.com>
Eugene Sukhodolskiy
committed
1 day ago