Skip to main content
Glama

search_products

Find hats in The Investor Hat Store catalog by entering search terms to view available items with names, descriptions, and prices.

Instructions

Search for products in the hat store. Returns available hats with names, descriptions, and prices.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
queryNoSearch query (e.g. 'accredited investor hat')

Implementation Reference

  • main.py:237-265 (handler)
    The handler implementation for the search_products tool, which processes the request, calls the Shopify API, and formats the response.
    @app.post("/tools/search_products")
    async def search_products(request: Request):
        body = await request.json()
        query = body.get("query", "")
        limit = body.get("limit", 10)
    
        # Use full-text search if available, fall back to title filter
        params = {"limit": limit, "status": "active"}
        if query:
            params["title"] = query
        data = await shopify_get("products.json", params)
        products = data.get("products", [])
    
        return {
            "products": [
                {
                    "id": str(p["id"]),
                    "title": p["title"],
                    "handle": p["handle"],
                    "url": f"https://shop.masonborda.com/products/{p['handle']}",
                    "variants": [
                        {
                            "id": str(v["id"]),
                            "title": v["title"],
                            "price_usd": float(v["price"]),
                            "price_usdc": float(v["price"]),  # 1:1 peg
                            "sku": v.get("sku", ""),
                        }
                        for v in p.get("variants", [])
Behavior2/5

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

No annotations are provided, so the description carries full burden. It mentions the return format (names, descriptions, prices) but doesn't disclose important behavioral traits like whether results are paginated, sorted, filtered by availability, or if there are rate limits. For a search tool with zero annotation coverage, this leaves significant gaps in understanding how the tool behaves beyond basic functionality.

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

Conciseness4/5

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

The description is appropriately concise with two clear sentences. The first states the action and domain, the second specifies the return format. There's no wasted verbiage, though it could be slightly more structured by explicitly separating purpose from output details.

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 (search functionality with one parameter), no annotations, and no output schema, the description provides basic purpose and output format but lacks completeness. It doesn't cover important context like search scope limitations, result ordering, pagination, error conditions, or how it differs meaningfully from get_product. For a search tool, this leaves the agent with insufficient guidance.

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

Parameters3/5

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

Schema description coverage is 100% (the single 'query' parameter is fully described in the schema), so the baseline is 3. The description doesn't add any parameter-specific information beyond what's in the schema - it doesn't explain query syntax, matching behavior, or examples beyond what the schema already provides. No extra value is added for parameter understanding.

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 in the hat store' specifies the verb (search) and resource (products/hats). It distinguishes from siblings like get_product (single product retrieval) and get_order_status (order tracking). However, it doesn't explicitly mention the domain limitation to hats, which is implied but could be more specific.

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

Usage Guidelines3/5

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

The description implies usage for finding available hats, suggesting it's for browsing rather than specific retrieval (get_product) or transactional actions (place_order). However, it lacks explicit guidance on when to use this versus alternatives like get_product for known IDs or get_quote for pricing inquiries. No when-not-to-use or prerequisite information is provided.

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/masonicGIT/shop-mcp-server'

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