Skip to main content
Glama

MCP Orchestration Server

test_mumbai_weather.py•3.22 kB
#!/usr/bin/env python3 """ Test Mumbai weather fix """ import requests import json def test_mumbai_weather(): """Test that Mumbai weather query returns Mumbai weather.""" print("šŸŒ¤ļø Testing Mumbai Weather Fix") print("=" * 40) # Test different Mumbai weather queries mumbai_queries = [ "what is the weather in Mumbai", "weather in Mumbai", "Mumbai weather", "temperature in Mumbai", "weather for Mumbai" ] for query in mumbai_queries: print(f"\nšŸ” Testing: '{query}'") try: response = requests.post( 'http://localhost:8000/api/mcp/command', json={'command': query}, timeout=30 ) if response.status_code == 200: result = response.json() print(f"āœ… Status: {result.get('status')}") print(f"šŸ“ Location: {result.get('location', 'N/A')}") if result.get('location', '').lower() == 'mumbai': print("āœ… CORRECT: Mumbai weather returned!") else: print(f"āŒ WRONG: Got {result.get('location')} instead of Mumbai") if 'current' in result: current = result['current'] print(f"šŸŒ”ļø Temperature: {current.get('temperature', 'N/A')}") print(f"ā˜ļø Condition: {current.get('condition', 'N/A')}") if 'summary' in result: print(f"šŸ“ Summary: {result['summary']}") else: print(f"āŒ Request failed: {response.status_code}") except Exception as e: print(f"āŒ Error: {e}") # Test other cities to make sure they work too print(f"\nšŸŒ Testing Other Cities:") other_cities = [ "weather in London", "weather in New York", "weather in Tokyo" ] for query in other_cities: try: response = requests.post( 'http://localhost:8000/api/mcp/command', json={'command': query}, timeout=30 ) if response.status_code == 200: result = response.json() expected_city = query.split()[-1] # Get last word (city name) actual_city = result.get('location', '') print(f"šŸ” {query} → {actual_city}") if expected_city.lower() in actual_city.lower(): print("āœ… Correct location!") else: print(f"āŒ Expected {expected_city}, got {actual_city}") except Exception as e: print(f"āŒ Error testing {query}: {e}") print(f"\nšŸŽÆ MUMBAI WEATHER FIX TEST COMPLETE") print("=" * 40) print("āœ… Location extraction should now work correctly") print("āœ… Mumbai queries should return Mumbai weather") print("āœ… Other cities should work as expected") if __name__ == "__main__": test_mumbai_weather()

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Nisarg-123-web/MCP2'

If you have feedback or need assistance with the MCP directory API, please join our Discord server