Skip to main content
Glama
verify_v4_fix.py4.41 kB
#!/usr/bin/env python3 """Comprehensive verification of all fixes including v4 API update.""" import sys def verify_app_py(): """Verify app.py uses correct API version.""" print("Checking app.py...") with open('app.py', 'r') as f: content = f.read() # Check API version if 'api.spacexdata.com/v5' in content: print(" ❌ FAIL: Still using v5 API") return False if 'api.spacexdata.com/v4' not in content: print(" ❌ FAIL: Not using v4 API") return False print(" ✓ Correct API version (v4)") # Check timeout if content.count('timeout=30') != 3: print(f" ❌ FAIL: Expected 3 timeout=30, found {content.count('timeout=30')}") return False print(" ✓ All 3 HTTP requests have timeout=30") # Check no print statements if 'print(' in content: print(" ❌ FAIL: print() statements still exist") return False print(" ✓ No print() statements") # Check sys.stderr.write if content.count('sys.stderr.write') != 3: print(f" ❌ FAIL: Expected 3 sys.stderr.write, found {content.count('sys.stderr.write')}") return False print(" ✓ All 3 error messages use sys.stderr.write") return True def verify_server_py(): """Verify server.py has isError field.""" print("\nChecking server.py...") with open('server.py', 'r') as f: content = f.read() # Check isError field if content.count('"isError": False') != 3: print(f" ❌ FAIL: Expected 3 'isError': False, found {content.count('\"isError\": False')}") return False print(" ✓ All 3 tool responses have isError field") # Check protocol version if '"protocolVersion": "2024-11-05"' not in content: print(" ❌ FAIL: Wrong MCP protocol version") return False print(" ✓ Correct MCP protocol version (2024-11-05)") return True def verify_test_app_py(): """Verify test_app.py uses v4 URLs.""" print("\nChecking test_app.py...") with open('test_app.py', 'r') as f: content = f.read() # Check API version in tests if 'api.spacexdata.com/v5' in content: print(" ❌ FAIL: Tests still reference v5 API") return False v4_count = content.count('api.spacexdata.com/v4') if v4_count != 4: # Should have 4 assertions for v4 URLs print(f" ❌ FAIL: Expected 4 v4 URL assertions, found {v4_count}") return False print(" ✓ All test assertions use v4 API URLs") return True def verify_readme(): """Verify README.md encoding.""" print("\nChecking README.md...") try: with open('README.md', 'r', encoding='utf-8') as f: content = f.read() if 'SpaceX MCP' not in content: print(" ❌ FAIL: Title not found") return False print(" ✓ File is readable as UTF-8") if 'Özellikler' not in content: print(" ❌ FAIL: Turkish characters not rendering") return False print(" ✓ Turkish characters render correctly") return True except UnicodeDecodeError: print(" ❌ FAIL: File is not UTF-8") return False def main(): """Run all verifications.""" print("=" * 60) print("COMPREHENSIVE VERIFICATION - ALL FIXES INCLUDING V4 API") print("=" * 60) results = [] results.append(("app.py (v4 API + fixes)", verify_app_py())) results.append(("server.py (isError field)", verify_server_py())) results.append(("test_app.py (v4 URLs)", verify_test_app_py())) results.append(("README.md encoding", verify_readme())) print("\n" + "=" * 60) print("RESULTS SUMMARY") print("=" * 60) all_passed = True for name, result in results: status = "✓ PASS" if result else "❌ FAIL" print(f"{status}: {name}") if not result: all_passed = False print("=" * 60) if all_passed: print("✓ ALL FIXES VERIFIED SUCCESSFULLY!") print("\nCRITICAL FIX APPLIED:") print(" - SpaceX API corrected from v5 → v4") print(" - get_company_info() now works correctly") return 0 else: print("❌ SOME FIXES FAILED VERIFICATION") return 1 if __name__ == "__main__": sys.exit(main())

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/rftsngl/SpaceX-mcp'

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