Skip to main content
Glama

get-shop-details

Retrieve comprehensive shop details, such as shipping countries, to support informed decisions and updates for Shopify store configurations.

Instructions

Get extended shop details including shipping countries

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • src/index.ts:553-571 (registration)
    Registers the MCP tool 'get-shop-details' with empty input schema and inline handler that calls ShopifyClient.loadShopDetail
    server.tool( "get-shop-details", "Get extended shop details including shipping countries", {}, async () => { const client = new ShopifyClient(); try { const shopDetails = await client.loadShopDetail( SHOPIFY_ACCESS_TOKEN, MYSHOPIFY_DOMAIN ); return { content: [{ type: "text", text: JSON.stringify(shopDetails, null, 2) }], }; } catch (error) { return handleError("Failed to retrieve extended shop details", error); } } );
  • Implements the core logic of fetching extended shop details (shipsToCountries) via GraphQL query in ShopifyClient
    async loadShopDetail( accessToken: string, shop: string ): Promise<ShopResponse> { const myshopifyDomain = await this.getMyShopifyDomain(accessToken, shop); const graphqlQuery = gql` { shop { shipsToCountries } } `; const res = await this.shopifyGraphqlRequest<ShopResponse>({ url: `https://${myshopifyDomain}/admin/api/${this.SHOPIFY_API_VERSION}/graphql.json`, accessToken, query: graphqlQuery, }); return res.data; }
  • Type definition for the response structure returned by loadShopDetail
    export type ShopResponse = { data: { shop: { shipsToCountries: string[]; }; }; };
  • Interface definition for loadShopDetail method in ShopifyClientPort
    loadShopDetail(accessToken: string, shop: string): Promise<ShopResponse>; }
  • Utility function used by tool handlers to format and return errors in MCP response 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, }; }

Other Tools

Related 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