Skip to main content
Glama
search_service.py1.4 kB
""" Abstract interface for the search system. """ from abc import ABC, abstractmethod from typing import List, Dict, Any class SearchService(ABC): """ Abstract interface for search services. Defines the methods that all search implementations must provide. """ @abstractmethod async def search(self, query: str, max_results: int = 10, language: str = "en") -> List[Dict[str, Any]]: """ Search for a query. Args: query: Search query max_results: Maximum number of results to return language: Language code (e.g., 'en', 'pt') Returns: List of dictionaries with title, URL, and description """ pass @abstractmethod async def search_with_retry(self, query: str, max_results: int = 10, language: str = "en", max_retries: int = 3, backoff_factor: float = 1.5) -> List[Dict[str, Any]]: """ Search with retry and exponential backoff. Args: query: Search query max_results: Maximum number of results to return language: Language code (e.g., 'en', 'pt') max_retries: Maximum number of retries backoff_factor: Backoff factor for exponential backoff Returns: List of dictionaries with title, URL, and description """ pass

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/cabrit0/mcp_server_reuneMacacada'

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