Skip to main content
Glama
clavia-labs

Shopify Update MCP Server

by clavia-labs

get-shop

Retrieve Shopify store details including configuration, settings, and business information to manage store operations.

Instructions

Get shop details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The main handler function for the 'get-shop' tool. It instantiates a ShopifyClient, calls loadShop with the access token and shop domain, stringifies the shop data, and returns it in the expected MCP format. Handles errors using handleError.
    server.tool("get-shop", "Get shop details", {}, async () => {
      const client = new ShopifyClient();
      try {
        const shop = await client.loadShop(SHOPIFY_ACCESS_TOKEN, MYSHOPIFY_DOMAIN);
        return {
          content: [{ type: "text", text: JSON.stringify(shop, null, 2) }],
        };
      } catch (error) {
        return handleError("Failed to retrieve shop details", error);
      }
    });
  • src/index.ts:541-551 (registration)
    Registers the 'get-shop' tool on the MCP server with description 'Get shop details' and empty input schema.
    server.tool("get-shop", "Get shop details", {}, async () => {
      const client = new ShopifyClient();
      try {
        const shop = await client.loadShop(SHOPIFY_ACCESS_TOKEN, MYSHOPIFY_DOMAIN);
        return {
          content: [{ type: "text", text: JSON.stringify(shop, null, 2) }],
        };
      } catch (error) {
        return handleError("Failed to retrieve shop details", error);
      }
    });
  • Core implementation of shop data retrieval via HTTP GET request to Shopify's /admin/api/{version}/shop.json endpoint using shopifyHTTPRequest method.
    async loadShop(
      accessToken: string,
      shop: string
    ): Promise<LoadStorefrontsResponse> {
      const res = await this.shopifyHTTPRequest<LoadStorefrontsResponse>({
        method: "GET",
        url: `https://${shop}/admin/api/${this.SHOPIFY_API_VERSION}/shop.json`,
        accessToken,
      });
    
      return res.data;
    }
  • Utility function used by the get-shop handler to format and return error responses in MCP format.
    function handleError(
      defaultMessage: string,
      error: unknown
    ): {
      content: { type: "text"; text: string }[];
      isError: boolean;
    } {
      let errorMessage = defaultMessage;
      if (error instanceof CustomError) {
        errorMessage = `${defaultMessage}: ${error.message}`;
      }
      return {
        content: [{ type: "text", text: errorMessage }],
        isError: true,
      };
    }

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changedv1.0.0
    • addedInput schema / $schema
      Added value: +"http://json-schema.org/draft-07/schema#"
    • addedInput schema / properties
      Added value: +{}
  2. First observed

TDQS

C2.8/5.0
Behavior2/5

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

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Get shop details' implies a read-only operation, but it doesn't specify aspects like authentication requirements, rate limits, error conditions, or what the return data includes. This leaves significant gaps for an agent to understand how to use it effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with just three words, making it front-loaded and efficient. However, it may be overly brief, potentially under-specifying the tool's purpose compared to siblings like 'get-shop-details', which could confuse an agent.

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 complexity of a tool that likely retrieves shop information, the description is incomplete. With no annotations, no output schema, and a vague purpose, it fails to provide enough context for an agent to use it correctly, especially in distinguishing it from similar sibling tools.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 0 parameters with 100% coverage, meaning no parameters are documented in the schema. The description doesn't add parameter details, but since there are no parameters, this is acceptable. The baseline for 0 parameters is 4, as the description doesn't need to compensate for missing param info.

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

Purpose3/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Get shop details' clearly states the action (get) and resource (shop details), making the purpose understandable. However, it's somewhat vague about what specific details are retrieved, and it doesn't distinguish this tool from 'get-shop-details' among the sibling tools, which appears to serve a similar function.

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. Given the sibling tool 'get-shop-details', there's a clear need for differentiation, but the description offers no context, prerequisites, or exclusions to help an agent choose appropriately.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.