get-shop-details
Retrieve comprehensive Shopify store information including shipping countries and operational details for integration and analysis purposes.
Instructions
Get extended shop details including shipping countries
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get-shop-details"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/index.ts:553-571 (registration)Registration of the 'get-shop-details' MCP tool, including empty input schema and inline handler function that instantiates ShopifyClient and delegates to loadShopDetail method.
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 handler logic in ShopifyClient.loadShopDetail: performs GraphQL query to fetch extended shop details (shipsToCountries). Called by the tool handler.
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; } - Helper method getMyShopifyDomain used by loadShopDetail to resolve the myshopify domain from shop details.
private async getMyShopifyDomain( accessToken: string, shop: string ): Promise<string> { // POST requests are getting converted into GET on custom domain, so we need to retrieve the myshopify domain from the shop object const loadedShop = await this.loadShop(accessToken, shop); return loadedShop.shop.myshopify_domain; }