list_webhooks
List webhook subscriptions on your Shopify store to audit existing automation hooks. Filter by topic (e.g., ORDERS_CREATE) to view delivery format, endpoint, and filters per subscription.
Instructions
List webhook subscriptions on the store. Each subscription wires a Shopify event topic (ORDERS_CREATE, PRODUCTS_UPDATE, INVENTORY_LEVELS_UPDATE, etc.) to a delivery target — typically an HTTPS callback URL, but Pub/Sub and EventBridge are also supported. Returns each subscription's topic, delivery format (JSON/XML), endpoint, API version, and any field/metafield filters applied. Filter by topic to scope the result. Use this to audit existing automation hooks before creating new ones.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| first | No | ||
| topics | No | Filter by WebhookSubscriptionTopic values, e.g. ['ORDERS_CREATE', 'PRODUCTS_UPDATE']. Use uppercase underscore form. | |
| after | No |
Implementation Reference
- src/tools/webhooks.ts:199-231 (handler)The 'list_webhooks' tool handler executed via server.tool(). It accepts pagination (first, after) and topic filtering, queries Shopify GraphQL LIST_WEBHOOKS_QUERY, and returns formatted summaries of webhook subscriptions.
server.tool( "list_webhooks", "List webhook subscriptions on the store. Each subscription wires a Shopify event topic (ORDERS_CREATE, PRODUCTS_UPDATE, INVENTORY_LEVELS_UPDATE, etc.) to a delivery target — typically an HTTPS callback URL, but Pub/Sub and EventBridge are also supported. Returns each subscription's topic, delivery format (JSON/XML), endpoint, API version, and any field/metafield filters applied. Filter by topic to scope the result. Use this to audit existing automation hooks before creating new ones.", listWebhooksSchema, async (args) => { const data = await client.graphql<{ webhookSubscriptions: Connection<WebhookSubscriptionNode>; }>(LIST_WEBHOOKS_QUERY, { first: args.first, after: args.after, topics: args.topics, }); const edges = data.webhookSubscriptions.edges; if (edges.length === 0) { return { content: [ { type: "text" as const, text: "No webhook subscriptions." }, ], }; } return { content: [ { type: "text" as const, text: [ `Found ${edges.length} webhook subscription(s):`, ...edges.map(({ node }) => summarizeWebhook(node)), ].join("\n"), }, ], }; }, ); - src/tools/webhooks.ts:124-133 (schema)Zod schema for list_webhooks input: first (1-100, default 20), topics (optional array of strings), after (optional cursor string).
const listWebhooksSchema = { first: z.number().int().min(1).max(100).default(20), topics: z .array(z.string()) .optional() .describe( "Filter by WebhookSubscriptionTopic values, e.g. ['ORDERS_CREATE', 'PRODUCTS_UPDATE']. Use uppercase underscore form.", ), after: z.string().optional(), }; - src/server.ts:66-66 (registration)Registration of all webhook tools (including list_webhooks) via registerWebhookTools(s, shopify) in the buildServer() function.
registerWebhookTools(s, shopify); - src/tools/webhooks.ts:195-231 (registration)The export function registerWebhookTools that registers the tool on the MCP server, binding the name 'list_webhooks' with its schema and handler.
export function registerWebhookTools( server: McpServer, client: ShopifyClient, ): void { server.tool( "list_webhooks", "List webhook subscriptions on the store. Each subscription wires a Shopify event topic (ORDERS_CREATE, PRODUCTS_UPDATE, INVENTORY_LEVELS_UPDATE, etc.) to a delivery target — typically an HTTPS callback URL, but Pub/Sub and EventBridge are also supported. Returns each subscription's topic, delivery format (JSON/XML), endpoint, API version, and any field/metafield filters applied. Filter by topic to scope the result. Use this to audit existing automation hooks before creating new ones.", listWebhooksSchema, async (args) => { const data = await client.graphql<{ webhookSubscriptions: Connection<WebhookSubscriptionNode>; }>(LIST_WEBHOOKS_QUERY, { first: args.first, after: args.after, topics: args.topics, }); const edges = data.webhookSubscriptions.edges; if (edges.length === 0) { return { content: [ { type: "text" as const, text: "No webhook subscriptions." }, ], }; } return { content: [ { type: "text" as const, text: [ `Found ${edges.length} webhook subscription(s):`, ...edges.map(({ node }) => summarizeWebhook(node)), ].join("\n"), }, ], }; }, ); - src/server.ts:22-22 (registration)Import statement for registerWebhookTools from the webhooks.ts tool module.
import { registerWebhookTools } from "./tools/webhooks.js";