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.
    """
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It only states what the tool does (search) and lists parameters/returns. It doesn't disclose important behavioral traits like whether this is a read-only operation, authentication requirements, rate limits, pagination behavior beyond basic parameters, or error conditions. The description is minimal and lacks operational context.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with a clear purpose statement followed by organized parameter documentation. Every sentence earns its place: the opening statement defines the tool, and the parameter list provides essential usage information without redundancy. The formatting with 'Args:' and 'Returns:' sections enhances readability.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's moderate complexity (7 parameters, search functionality) and absence of both annotations and output schema, the description is partially complete. It adequately documents parameters and basic purpose but lacks important contextual information about authentication, error handling, result format, and differentiation from sibling tools. For a search tool with no structured metadata, more operational context would be beneficial.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description provides semantic meaning for all 7 parameters beyond what the schema offers (0% coverage). It explains what each parameter controls: 'q' is the search query, 'count' controls results per page, 'page' is page number, price filters are optional, and sort/order control ranking. This compensates well for the schema's lack of descriptions, though it doesn't provide format details like valid sort values beyond 'price:relevance'.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Search for products matching the query in Agora.' This specifies the verb (search), resource (products), and context (Agora platform). However, it doesn't explicitly differentiate from sibling tools like 'agora_get_product_detail' which retrieves specific products rather than searching.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'agora_get_product_detail' for retrieving specific products or 'agora_get_user_orders' for order-related queries. There's no context about when search is appropriate versus direct retrieval.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other 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