Skip to main content
Glama

get_quote

Calculate shipping costs and USDC payment amount for hats purchased with cryptocurrency, then receive the wallet address to complete your transaction.

Instructions

Get a shipping quote and USDC payment amount for a product. Returns the wallet address to send payment to.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
variant_idYesShopify variant ID
shipping_nameYesRecipient full name
shipping_address1YesStreet address
shipping_cityYesCity
shipping_stateYesState (2-letter code)
shipping_zipYesZIP code
shipping_countryNoCountry code (default: US)

Implementation Reference

  • main.py:307-350 (handler)
    The `get_quote` handler calculates the product price and shipping, generates a unique quote ID, stores the quote details, and returns the payment instructions in USDC on the Base network.
    async def get_quote(request: Request):
        body = await request.json()
        variant_id = body.get("variant_id")
        quantity = body.get("quantity", 1)
        address = body.get("shipping_address", {})
    
        # Get variant price from Shopify
        data = await shopify_get(f"variants/{variant_id}.json")
        variant = data["variant"]
        unit_price = float(variant["price"])
        subtotal = unit_price * quantity
    
        # Standard shipping estimate (US $5, international $15)
        country = address.get("country_code", "US")
        shipping = 5.0 if country == "US" else 15.0
        total_usdc = round(subtotal + shipping, 2)
    
        quote_id = make_quote_id(variant_id, quantity)
        _quotes[quote_id] = {
            "variant_id": variant_id,
            "quantity": quantity,
            "total_usdc": total_usdc,
            "shipping_address": address,
            "expires_at": time.time() + 600,  # 10 min
            "product_title": variant.get("title", ""),
        }
    
        return {
            "quote_id": quote_id,
            "product": variant.get("title", ""),
            "quantity": quantity,
            "subtotal_usdc": subtotal,
            "shipping_usdc": shipping,
            "total_usdc": total_usdc,
            "payment_wallet": PAYMENT_WALLET,
            "network": "base",
            "token": "USDC",
            "token_contract": USDC_CONTRACT,
            "instructions": (
                f"Send exactly {total_usdc} USDC on Base network to {PAYMENT_WALLET}, "
                f"then call place_order with the transaction hash and this quote_id."
            ),
            "expires_in": "10 minutes",
        }
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 mentions the return values (quote, payment amount, wallet address) but doesn't cover important behavioral aspects like whether this is a read-only operation, if it has side effects, rate limits, authentication requirements, or error conditions. The description provides basic output information but misses critical behavioral 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 perfectly concise - two sentences that efficiently communicate the tool's core function and return values without any wasted words. It's front-loaded with the primary purpose and follows with essential output information.

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?

For a tool with 7 parameters, no annotations, and no output schema, the description provides basic purpose and output information but lacks completeness. It doesn't explain the relationship between shipping quote and USDC payment, doesn't mention currency or conversion details, and provides no error handling or behavioral context that would be crucial for proper tool invocation.

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%, so the schema fully documents all 7 parameters. The description adds no additional parameter semantics beyond what's in the schema - it doesn't explain relationships between parameters, format requirements beyond schema descriptions, or how parameters affect the quote calculation. Baseline 3 is appropriate when schema does all the parameter documentation work.

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

Purpose5/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 with specific verbs ('get a shipping quote and USDC payment amount') and resources ('for a product'), and distinguishes it from siblings like get_order_status or place_order by focusing on quote calculation rather than order management or product retrieval.

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 context (obtaining quotes before placing orders) but doesn't explicitly state when to use this tool versus alternatives like place_order or get_product. It provides no guidance on prerequisites or exclusions, leaving usage timing somewhat ambiguous.

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