get-shop-details
Retrieve comprehensive Shopify store information including shipping countries and extended shop details for store management and configuration.
Instructions
Get extended shop details including shipping countries
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:525-543 (handler)Registration and inline handler for the 'get-shop-details' MCP tool. It creates a ShopifyClient instance, calls loadShopDetail with environment variables, stringifies the response as text content, or handles errors.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); } } );
- Core helper function loadShopDetail in ShopifyClient class that resolves the myshopify domain, executes a GraphQL query to fetch the shop's shipsToCountries, and returns the ShopResponse.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 ShopResponse, the return type of loadShopDetail, containing the shop's shipping countries.export type ShopResponse = { data: { shop: { shipsToCountries: string[]; }; }; };
- Interface definition in ShopifyClientPort for the loadShopDetail method signature used by the tool handler.loadShopDetail(accessToken: string, shop: string): Promise<ShopResponse>;