Skip to main content
Glama
smithery-ai

Shopify Update MCP Server

by smithery-ai

get-customers

Retrieve Shopify customer data with pagination support to manage and access customer lists efficiently.

Instructions

Get shopify customers with pagination support

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
limitNoLimit of customers to return
nextNoNext page cursor

Implementation Reference

  • src/index.ts:246-269 (registration)
    Registration of the 'get-customers' MCP tool, including input schema (limit, next) and inline handler that delegates to ShopifyClient.loadCustomers and formats response as JSON.
    server.tool(
      "get-customers",
      "Get shopify customers with pagination support",
      {
        limit: z.number().optional().describe("Limit of customers to return"),
        next: z.string().optional().describe("Next page cursor"),
      },
      async ({ limit, next }) => {
        const client = new ShopifyClient();
        try {
          const response = await client.loadCustomers(
            SHOPIFY_ACCESS_TOKEN,
            MYSHOPIFY_DOMAIN,
            limit,
            next
          );
          return {
            content: [{ type: "text", text: JSON.stringify(response, null, 2) }],
          };
        } catch (error) {
          return handleError("Failed to retrieve customers data", error);
        }
      }
    );
  • The MCP tool handler function for 'get-customers', which instantiates ShopifyClient and calls loadCustomers.
    async ({ limit, next }) => {
      const client = new ShopifyClient();
      try {
        const response = await client.loadCustomers(
          SHOPIFY_ACCESS_TOKEN,
          MYSHOPIFY_DOMAIN,
          limit,
          next
        );
        return {
          content: [{ type: "text", text: JSON.stringify(response, null, 2) }],
        };
      } catch (error) {
        return handleError("Failed to retrieve customers data", error);
      }
    }
  • Core implementation of customer loading via Shopify REST API GET /customers.json with pagination (limit, page_info), extracts next page from Link header.
    async loadCustomers(
      accessToken: string,
      shop: string,
      limit?: number,
      next?: string
    ): Promise<LoadCustomersResponse> {
      const res = await this.shopifyHTTPRequest<{ customers: any[] }>({
        method: "GET",
        url: `https://${shop}/admin/api/${this.SHOPIFY_API_VERSION}/customers.json`,
        accessToken,
        params: {
          limit: limit ?? 250,
          page_info: next,
          fields: ["id", "email", "tags"].join(","),
        },
      });
    
      const customers = res.data.customers;
      const nextPageInfo = ShopifyClient.getShopifyOrdersNextPage(
        res.headers.get("link")
      );
    
      return { customers, next: nextPageInfo };
    }
  • Type definition for the response of loadCustomers: array of ShopifyCustomer and optional next page cursor.
    export type LoadCustomersResponse = {
      customers: Array<ShopifyCustomer>;
      next?: string | undefined;
    };
  • Interface definition for ShopifyClientPort.loadCustomers method signature.
    loadCustomers(
      accessToken: string,
      myshopifyDomain: string,
      limit?: number,
      next?: string
    ): Promise<LoadCustomersResponse>;
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It mentions 'pagination support' which is useful context beyond the schema, but doesn't describe what the tool returns (customer objects? IDs only?), error conditions, authentication requirements, rate limits, or whether it's a read-only operation. For a retrieval tool with zero annotation coverage, this leaves significant behavioral gaps.

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 - a single sentence that communicates the core purpose and key feature (pagination). Every word earns its place with no wasted verbiage. It's front-loaded with the main action and resource, making it immediately scannable.

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 that this is a retrieval tool with no annotations and no output schema, the description is insufficiently complete. It doesn't explain what format the customers are returned in, what fields are included, whether authentication is required, or how errors are handled. The mention of pagination is helpful but doesn't compensate for the missing behavioral context that would help an agent use this tool effectively.

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 schema description coverage is 100%, so both parameters are already documented in the schema. The description adds no additional parameter information beyond what's in the schema - it doesn't explain typical values for 'limit', how pagination works with the 'next' cursor, or provide examples. This meets the baseline for high schema coverage but doesn't add 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 ('shopify customers'), making the purpose immediately understandable. It distinguishes this from other customer-related tools like 'tag-customer' by focusing on retrieval rather than modification. However, it doesn't explicitly differentiate from other list/retrieval tools like 'get-collections' or 'get-orders' beyond mentioning the specific resource type.

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?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention whether this is the primary way to retrieve customers, if there are other customer retrieval methods, or what specific use cases it addresses. The only contextual hint is 'pagination support,' but this doesn't help an agent choose between this and sibling tools.

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