Skip to main content
Glama

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); } });

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