Skip to main content
Glama

get_product

Retrieve detailed product information using a Shopify variant ID to support autonomous hat purchases with cryptocurrency.

Instructions

Get full details for a specific product by its Shopify variant ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
variant_idYesShopify variant ID of the product

Implementation Reference

  • main.py:275-300 (handler)
    The handler implementation for the 'get_product' tool, which fetches product details from Shopify and formats them for the MCP response.
    # --- Tool: get_product ---
    @app.post("/tools/get_product")
    async def get_product(request: Request):
        body = await request.json()
        product_id = body.get("product_id")
    
        data = await shopify_get(f"products/{product_id}.json")
        p = data["product"]
    
        return {
            "id": str(p["id"]),
            "title": p["title"],
            "description": p.get("body_html", "").replace("<p>", "").replace("</p>", "\n").strip(),
            "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"]),
                    "sku": v.get("sku", ""),
                    "available": v.get("inventory_quantity", 1) > 0,
                }
                for v in p.get("variants", [])
            ],
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It states it's a read operation ('Get'), which is helpful, but lacks critical details: it doesn't specify if authentication is required, rate limits, error handling (e.g., what happens if variant_id doesn't exist), or the format/scope of 'full details'. For a tool with zero annotation coverage, this leaves significant gaps in understanding its behavior.

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 a single, efficient sentence that directly states the tool's purpose without unnecessary words. It's front-loaded with the core action and resource, making it easy to parse. Every part of the sentence contributes meaning, earning its place.

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 low complexity (single parameter, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose but lacks details on behavior, output format, and usage context. Without annotations or output schema, the description should compensate more to be complete, but it falls short, leaving the agent with incomplete information for effective use.

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%, with the parameter 'variant_id' fully documented in the schema as 'Shopify variant ID of the product'. The description adds minimal value beyond this, only reiterating that it's for 'a specific product by its Shopify variant ID'. It doesn't provide additional context like valid ID ranges or examples. Baseline 3 is appropriate since the schema does the heavy lifting.

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 action ('Get full details') and resource ('a specific product'), specifying it's identified by 'Shopify variant ID'. It distinguishes from siblings like search_products (which likely returns multiple products) but doesn't explicitly contrast with get_order_status or get_quote. The purpose is specific but could be more precise about what 'full details' includes.

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 when you need details for a specific product variant, but provides no explicit guidance on when to use this versus alternatives like search_products (for broader queries) or other siblings. There's no mention of prerequisites, error conditions, or when-not-to-use scenarios. Usage is contextually implied but not clearly articulated.

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