Skip to main content
Glama

get_order_status

Check the current delivery status of an order placed through The Investor Hat Store using the order ID returned after purchase.

Instructions

Check the status of a placed order by order ID.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
order_idYesOrder ID returned from place_order

Implementation Reference

  • main.py:432-463 (handler)
    The async handler function for get_order_status. It takes an order_id from the request body, fetches the order from Shopify via shopify_get, then queries Printful for tracking/shipping info, and returns order details including printful status and tracking data.
    @app.post("/tools/get_order_status")
    async def get_order_status(request: Request):
        body = await request.json()
        order_id = body.get("order_id")
    
        data = await shopify_get(f"orders/{order_id}.json")
        order = data["order"]
    
        # Try Printful
        printful_data = None
        async with httpx.AsyncClient(timeout=10) as client:
            pf = await client.get(f"{PRINTFUL_BASE}/orders/@{order_id}", headers=PRINTFUL_HEADERS)
            if pf.status_code == 200:
                pf_result = pf.json().get("result", {})
                shipments = pf_result.get("shipments", [])
                printful_data = {
                    "status": pf_result.get("status"),
                    "tracking": {
                        "carrier": shipments[0].get("carrier") if shipments else None,
                        "tracking_number": shipments[0].get("tracking_number") if shipments else None,
                        "tracking_url": shipments[0].get("tracking_url") if shipments else None,
                    } if shipments else None,
                }
    
        return {
            "order_id": str(order["id"]),
            "order_number": order.get("order_number"),
            "financial_status": order.get("financial_status"),
            "fulfillment_status": order.get("fulfillment_status") or "unfulfilled",
            "created_at": order.get("created_at"),
            "printful": printful_data,
        }
  • MCP manifest registration of get_order_status tool with its input schema requiring order_id (string).
    {
        "name": "get_order_status",
        "description": "Get order status and Printful tracking info by order ID.",
        "price": None,
        "inputSchema": {
            "type": "object",
            "properties": {
                "order_id": {"type": "string"},
            },
            "required": ["order_id"],
        },
    },
  • main.py:526-537 (registration)
    Registration in the MCP Tools list (used by the /mcp protocol endpoint) for get_order_status with input schema requiring order_id.
        {
            "name": "get_order_status",
            "description": "Check the status of a placed order by order ID.",
            "inputSchema": {
                "type": "object",
                "properties": {
                    "order_id": {"type": "string", "description": "Order ID returned from place_order"}
                },
                "required": ["order_id"]
            }
        }
    ]
  • main.py:567-580 (registration)
    Routing registration in the MCP tools/call handler that maps the tool name 'get_order_status' to the REST endpoint '/tools/get_order_status'.
    elif method == "tools/call":
        tool_name = body.get("params", {}).get("name", "")
        tool_args = body.get("params", {}).get("arguments", {})
        # Route to existing tool handlers
        from fastapi.testclient import TestClient
        # Forward to the REST endpoint
        rest_map = {
            "search_products": "/tools/search_products",
            "get_product": "/tools/get_product",
            "get_quote": "/tools/get_quote",
            "place_order": "/tools/place_order",
            "get_order_status": "/tools/get_order_status",
        }
  • The shopify_get helper function used by the handler to fetch order data from Shopify API.
    async def shopify_get(path: str, params: dict = {}):
        async with httpx.AsyncClient(timeout=15) as client:
            r = await client.get(f"{SHOPIFY_BASE}/{path}", headers=SHOPIFY_HEADERS, params=params)
            r.raise_for_status()
            return r.json()
Behavior2/5

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

No annotations are provided, so the description is the sole source for behavioral traits. It describes a read operation but fails to mention error handling (e.g., invalid order_id), permissions, or rate limits. This is a significant gap for a tool with zero annotations.

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?

A single sentence that is clear and front-loaded with the core purpose. Every word is necessary, with no superfluous information.

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

Completeness4/5

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

The description covers the essential purpose and input for a simple tool with one parameter and no output schema. It could be improved by hinting at the output shape (e.g., 'returns order status details'), but it remains functionally complete for basic 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 coverage is 100%, providing a description for the single parameter 'order_id' ('Order ID returned from place_order'). The tool description adds no additional semantics beyond what the schema already states, meeting the baseline but not exceeding it.

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 'Check the status of a placed order by order ID,' specifying the verb (check), resource (status of an order), and input (order ID). It distinguishes itself from siblings like get_product, get_quote, place_order, and search_products.

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 use after placing an order but provides no explicit guidance on when to use this tool versus alternatives (e.g., get_product for product details). No exclusions or prerequisites are mentioned.

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