Skip to main content
Glama

agora_search

Search for products across the web using natural language queries, with options to filter by price range, sort results, and paginate through listings.

Instructions

Search for products matching the query in Agora. Args: q: The search query. count: The number of products to return per page. page: The page number. price_min: The minimum price. Optional price_max: The maximum price. Optional sort: The sort field: price:relevance. order: The sort order: asc or desc. Returns: The search results.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
qYes
price_minNo
price_maxNo
countNo
pageNo
sortNorelevance
orderNodesc

Implementation Reference

  • The main handler function for the 'agora_search' tool. It searches for products using the Agora client based on query and filters, then handles and returns the response.
    async def agora_search(q: str, price_min: int = 0, price_max: int = 100000, count: int = 20, page: int = 1, sort: str = "relevance", order: str = "desc") -> Dict: """ Search for products matching the query in Agora. Args: q: The search query. count: The number of products to return per page. page: The page number. price_min: The minimum price. Optional price_max: The maximum price. Optional sort: The sort field: price:relevance. order: The sort order: asc or desc. Returns: The search results. """ response = get_agora().search_products( query=q, count=count, page=page, price_min=price_min, price_max=price_max, sort=sort, order=order ) return handle_response(response)
  • The @mcp.tool() decorator registers the agora_search function as an MCP tool.
    @mcp.tool()
  • Helper function to lazily initialize and return the Agora client instance, used by agora_search.
    def get_agora(): """Get or create an Agora instance. We want to create the class instance inside the tool, so the init errors will bubble up to the tool and hence the MCP client instead of silently failing during the server creation. """ return Agora()
  • Helper function to process responses from Agora API calls, used by agora_search.
    def handle_response(response): """ Handle responses from Agora methods. """ if hasattr(response, 'status_code'): # This is a raw response object try: return response.status_code, response.json() except: return response.status_code, response.text # This is already processed data (like a dictionary) return response
  • Docstring providing input parameters and return type description, serving as schema documentation for the tool.
    """ Search for products matching the query in Agora. Args: q: The search query. count: The number of products to return per page. page: The page number. price_min: The minimum price. Optional price_max: The maximum price. Optional sort: The sort field: price:relevance. order: The sort order: asc or desc. Returns: The search results. """

Latest Blog Posts

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/Fewsats/agora-mcp'

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