Skip to main content
Glama

MCP Standards

by airmcp-com
test_search_debug.py•3.61 kB
#!/usr/bin/env python3 """ Debug Search Functionality Simple test to identify why search operations are failing. """ import asyncio import sys import os # Add project root to path sys.path.insert(0, os.path.abspath('.')) from src.mcp_standards.memory.v2.test_hybrid_memory import create_test_hybrid_memory async def debug_search(): """Debug search functionality step by step""" print("šŸ” Debugging Search Functionality") print("=" * 40) try: # Create memory router print("1. Creating memory router...") memory_router = await create_test_hybrid_memory() print("āœ… Memory router created") # Store a simple pattern first print("\n2. Storing test pattern...") pattern_id = await memory_router.store_pattern( "This is a simple test pattern for search debugging", {"test": "search_debug", "type": "simple"}, "debug_category" ) print(f"āœ… Pattern stored with ID: {pattern_id}") # Try basic search print("\n3. Testing basic search...") try: results = await memory_router.search_patterns( "simple test pattern", top_k=5, threshold=0.1 # Very low threshold ) print(f"āœ… Search completed, found {len(results) if results else 0} results") if results: for i, result in enumerate(results): print(f" Result {i+1}: {result}") else: print(" No results found") except Exception as e: print(f"āŒ Search failed: {e}") import traceback traceback.print_exc() # Test AgentDB search directly print("\n4. Testing AgentDB search directly...") try: agentdb_results = await memory_router.agentdb.search_patterns( "simple test pattern", top_k=5, threshold=0.1 ) print(f"āœ… AgentDB search: {len(agentdb_results) if agentdb_results else 0} results") if agentdb_results: for i, result in enumerate(agentdb_results): print(f" AgentDB Result {i+1}: {result}") except Exception as e: print(f"āŒ AgentDB search failed: {e}") import traceback traceback.print_exc() # Test SQLite search directly print("\n5. Testing SQLite search directly...") try: sqlite_results = await memory_router.sqlite.search_patterns( "simple test pattern", top_k=5 ) print(f"āœ… SQLite search: {len(sqlite_results) if sqlite_results else 0} results") if sqlite_results: for i, result in enumerate(sqlite_results): print(f" SQLite Result {i+1}: {result}") except Exception as e: print(f"āŒ SQLite search failed: {e}") import traceback traceback.print_exc() print("\n6. Checking pattern storage status...") # Check if patterns are actually stored try: # Check AgentDB statistics stats = await memory_router.agentdb.get_stats() print(f"āœ… AgentDB stats: {stats}") except Exception as e: print(f"āŒ Failed to get AgentDB stats: {e}") except Exception as e: print(f"āŒ Overall test failed: {e}") import traceback traceback.print_exc() if __name__ == "__main__": asyncio.run(debug_search())

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/airmcp-com/mcp-standards'

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