Skip to main content
Glama
smithery-ai

Shopify Update MCP Server

by smithery-ai

get-order

Retrieve a specific Shopify order by its ID to view details, track status, or process updates within the Shopify Update MCP Server.

Instructions

Get a single order by ID

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
orderIdYesID of the order to retrieve

Implementation Reference

  • src/index.ts:348-369 (registration)
    Registration of the 'get-order' MCP tool, including input schema (orderId: string) and inline handler that uses ShopifyClient.loadOrder to fetch and return the order as JSON.
    server.tool(
      "get-order",
      "Get a single order by ID",
      {
        orderId: z.string().describe("ID of the order to retrieve"),
      },
      async ({ orderId }) => {
        const client = new ShopifyClient();
        try {
          const order = await client.loadOrder(
            SHOPIFY_ACCESS_TOKEN,
            MYSHOPIFY_DOMAIN,
            { orderId }
          );
          return {
            content: [{ type: "text", text: JSON.stringify(order, null, 2) }],
          };
        } catch (error) {
          return handleError("Failed to retrieve order", error);
        }
      }
    );
  • The handler function executes the tool logic: instantiates ShopifyClient, calls loadOrder with access token, shop domain, and orderId, returns formatted JSON response or error.
    async ({ orderId }) => {
      const client = new ShopifyClient();
      try {
        const order = await client.loadOrder(
          SHOPIFY_ACCESS_TOKEN,
          MYSHOPIFY_DOMAIN,
          { orderId }
        );
        return {
          content: [{ type: "text", text: JSON.stringify(order, null, 2) }],
        };
      } catch (error) {
        return handleError("Failed to retrieve order", error);
      }
    }
  • Zod input schema for the tool: requires orderId as string.
    {
      orderId: z.string().describe("ID of the order to retrieve"),
    },
  • Core helper method loadOrder that performs a GET request to Shopify Admin API to retrieve the specific order by ID, optionally specifying fields.
    async loadOrder(
      accessToken: string,
      shop: string,
      queryParams: ShopifyLoadOrderQueryParams
    ): Promise<ShopifyOrder> {
      const res = await this.shopifyHTTPRequest<{ order: ShopifyOrder }>({
        method: "GET",
        url: `https://${shop}/admin/api/${this.SHOPIFY_API_VERSION}/orders/${queryParams.orderId}.json`,
        accessToken,
        params: {
          fields: this.getOrdersFields(queryParams.fields),
        },
      });
    
      return res.data.order;
    }
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 for behavioral disclosure. It states 'Get' which implies a read operation, but doesn't clarify if it's safe (non-destructive), requires authentication, has rate limits, or what the output format might be. The description is minimal and lacks essential behavioral details.

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 extremely concise with a single sentence ('Get a single order by ID'), front-loaded and free of unnecessary words. It efficiently conveys the core purpose without any wasted text.

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

Completeness2/5

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

Given the tool's simplicity (1 parameter, no output schema, no annotations), the description is incomplete. It doesn't explain what 'get' entails operationally, potential errors, or return values, leaving gaps in understanding for effective tool use by an agent.

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?

The input schema has 100% description coverage, with the 'orderId' parameter clearly documented. The description adds no additional parameter semantics beyond what the schema provides, so it meets the baseline score of 3 for high schema coverage without extra value.

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') and resource ('a single order by ID'), making the purpose understandable. However, it doesn't distinguish this tool from sibling tools like 'get-orders' (which presumably retrieves multiple orders) or specify what 'get' entails (e.g., read-only retrieval).

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?

No guidance is provided on when to use this tool versus alternatives. It doesn't mention sibling tools like 'get-orders' for listing orders or 'complete-draft-order' for order processing, leaving the agent to infer usage from context without explicit direction.

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/smithery-ai/shopify-mcp-server-main-1'

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