Skip to main content
Glama

agora_search

Search for products in Agora MCP by specifying queries, price ranges, and sorting options. Retrieve results with pagination to discover and purchase items across the web.

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
countNo
orderNodesc
pageNo
price_maxNo
price_minNo
qYes
sortNorelevance

Implementation Reference

  • The main execution logic for the 'agora_search' tool: registers the async function via @mcp.tool(), validates inputs via type hints, calls Agora client's search_products method, and processes the response.
    @mcp.tool() 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)
  • Helper function to lazily instantiate the Agora client inside tool execution.
    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 standardize Agora API responses into status code and data.
    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

Other Tools

Related Tools

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