Skip to main content
Glama

shopify_products

Fetch a paginated product catalog from any Shopify store. Customize page number and product count, up to 250 items per call.

Instructions

Fetch a paginated product catalog from any Shopify store. Up to 250 products per call.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
urlYesShopify store URL
pageNoPage number (default: 1)
limitNoProducts per page, max 250 (default: 50)

Implementation Reference

  • The main handler function that fetches paginated products from a Shopify store via /products.json endpoint. Normalizes the URL, clamps limit to 250, fetches products with page/limit params, and returns ShopifyProductsResult.
    export async function getShopifyProducts(
      storeUrl: string,
      page = 1,
      limit = 50
    ): Promise<ShopifyProductsResult> {
      const baseUrl = normalizeStoreUrl(storeUrl);
      const clampedLimit = Math.min(Math.max(1, limit), 250);
    
      const headers = {
        "User-Agent":
          "Mozilla/5.0 (compatible; IntelligenceAPI/1.0; +https://intelligence-api.io)",
        Accept: "application/json",
      };
    
      const res = await fetch(
        `${baseUrl}/products.json?limit=${clampedLimit}&page=${page}`,
        { headers }
      );
    
      if (!res.ok) {
        throw new Error(
          `Failed to fetch products from ${baseUrl}: HTTP ${res.status}`
        );
      }
    
      const json = (await res.json()) as { products?: ShopifyProduct[] };
      const products = json.products ?? [];
    
      return {
        store_url: baseUrl,
        page,
        limit: clampedLimit,
        total_fetched: products.length,
        products,
      };
    }
  • MCP tool dispatch handler for 'shopify_products'. Extracts url, page, limit from args and delegates to getShopifyProducts().
    case "shopify_products": {
      const { url, page, limit } = args as {
        url: string;
        page?: number;
        limit?: number;
      };
      result = await getShopifyProducts(url, page, limit);
      break;
    }
  • MCP tool registration with inputSchema defining required 'url' and optional 'page' and 'limit' parameters.
    {
      name: "shopify_products",
      description:
        "Fetch a paginated product catalog from any Shopify store. Up to 250 products per call.",
      inputSchema: {
        type: "object",
        properties: {
          url: {
            type: "string",
            description: "Shopify store URL",
          },
          page: {
            type: "number",
            description: "Page number (default: 1)",
          },
          limit: {
            type: "number",
            description: "Products per page, max 250 (default: 50)",
          },
        },
        required: ["url"],
      },
  • TypeScript interface ShopifyProductsResult defining the return shape: store_url, page, limit, total_fetched, and products array.
    export interface ShopifyProductsResult {
      store_url: string;
      page: number;
      limit: number;
      total_fetched: number;
      products: ShopifyProduct[];
    }
  • src/mcp-stdio.ts:48-70 (registration)
    MCP tool registration for 'shopify_products' in the ListToolsRequestSchema handler.
    {
      name: "shopify_products",
      description:
        "Fetch a paginated product catalog from any Shopify store. Up to 250 products per call.",
      inputSchema: {
        type: "object",
        properties: {
          url: {
            type: "string",
            description: "Shopify store URL",
          },
          page: {
            type: "number",
            description: "Page number (default: 1)",
          },
          limit: {
            type: "number",
            description: "Products per page, max 250 (default: 50)",
          },
        },
        required: ["url"],
      },
    },
  • Express route handler at GET /shopify/products that also uses getShopifyProducts().
    router.get("/shopify/products", async (req: Request, res: Response) => {
      const { url, page, limit } = req.query;
    
      if (!url || typeof url !== "string") {
        res.status(400).json({
          error: "Missing required query parameter: url",
          example: "/shopify/products?url=example.myshopify.com&page=1&limit=50",
        });
        return;
      }
    
      const pageNum = page ? parseInt(page as string, 10) : 1;
      const limitNum = limit ? parseInt(limit as string, 10) : 50;
    
      if (isNaN(pageNum) || pageNum < 1) {
        res.status(400).json({ error: "page must be a positive integer" });
        return;
      }
    
      if (isNaN(limitNum) || limitNum < 1 || limitNum > 250) {
        res.status(400).json({ error: "limit must be between 1 and 250" });
        return;
      }
    
      try {
        const result = await getShopifyProducts(url, pageNum, limitNum);
        res.json(result);
      } catch (err) {
Behavior2/5

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

With no annotations, the description must provide behavioral details. It only mentions pagination and the 250-product limit, but omits traits like rate limits, whether the tool is read-only, or error handling.

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?

Two sentences, no filler. First sentence states purpose, second adds a key constraint. Every word earns its place.

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?

Despite simple parameters, description lacks details on return format, error conditions, authentication needs, or sorting/filtering. Fails to fully exploit the no-annotation context.

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?

Input schema already describes all 3 parameters (100% coverage). The description adds minimal value: 'any Shopify store' for url and 'up to 250' for limit, which overlaps with schema's 'max 250'. Baseline score of 3 is appropriate.

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 'Fetch a paginated product catalog from any Shopify store', indicating a specific verb and resource. It distinguishes from siblings like amazon_product or maps_search which target different platforms.

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 on when to use this tool versus alternatives like shopify_analyze. Doesn't mention prerequisites or exclusions. The 'any Shopify store' hint is broad but lacks explicit when-to-use context.

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/samrothschild23/intelligence-api'

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