get-metafields
Retrieve metafields for any Shopify resource by owner ID, and filter with namespace.key keys to return only needed fields and reduce response size.
Instructions
Get metafields for any Shopify resource (products, orders, customers, variants, collections, etc.). Supports 'keys' filter to fetch only specific metafields by namespace.key.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| keys | No | IMPORTANT: Always specify this when you only need specific metafields. Format: namespace.key (e.g. ['custom.color', 'custom.size']). Returns only matching metafields instead of all, significantly reducing response size. When provided, the 'namespace' parameter is ignored. | |
| after | No | Cursor for pagination | |
| first | No | Number of metafields to return (max 50) | |
| ownerId | Yes | GID of the resource (product, order, customer, variant, collection, etc.) | |
| namespace | No | Filter metafields by namespace. Ignored when 'keys' is provided. |