Skip to main content
Glama
amir-bengherbi

Shopify MCP Server

get-shop

Retrieve Shopify store details including business information, settings, and configuration data through the Shopify MCP Server's GraphQL API.

Instructions

Get shop details

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Inline anonymous function that serves as the handler for the 'get-shop' tool. Instantiates ShopifyClient, fetches shop details via loadShop, and returns formatted JSON response or error.
    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 helper method loadShop in the ShopifyClient class responsible for making the REST API call to retrieve the shop object from Shopify Admin API.
    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;
    }
  • Helper utility function used in the get-shop handler to standardize error responses.
    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,
      };
    }
  • src/index.ts:513-523 (registration)
    Registration of the 'get-shop' tool on the MCP server using server.tool method with empty schema and inline handler.
    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);
      }
    });
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.

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/amir-bengherbi/shopify-mcp-server'

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