AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Shopify Admin Metafield Bulk Update

skill-40rty-ai-shopify-admin-skills-shopify-admin-metafield-bulk-update · by 40RTY-ai

Bulk set or delete metafields on products, variants, or customers filtered by tag or collection.

No reviews yet
0 installs
41 views
0.0% view→install

Install

$ agentstack add skill-40rty-ai-shopify-admin-skills-shopify-admin-metafield-bulk-update

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures
View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-40rty-ai-shopify-admin-skills-shopify-admin-metafield-bulk-update)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Shopify Admin Metafield Bulk Update? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

Purpose

Queries products (or variants, or customers) matching a filter and bulk-sets or bulk-deletes metafield values. Used for structured data updates like material composition, care instructions, product specifications, or custom attributes that power storefront features.

Prerequisites

  • Authenticated Shopify CLI session: shopify store auth --store --scopes read_products,write_products
  • API scopes: read_products, write_products
  • Metafield namespace and key must already exist or be created on first set

Parameters

| Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | store | string | yes | — | Store domain (e.g., mystore.myshopify.com) | | resourcetype | string | no | product | Resource to update: product, variant, or customer | | filter | string | yes | — | Filter query (e.g., tag:summer-2026, vendor:Nike) | | namespace | string | yes | — | Metafield namespace (e.g., custom) | | key | string | yes | — | Metafield key (e.g., material) | | value | string | no | — | Value to set. If omitted and action: delete, metafield is deleted | | valuetype | string | no | singlelinetextfield | Metafield type (e.g., single_line_text_field, boolean, number_integer) | | action | string | no | set | set or delete | | dryrun | bool | no | true | Preview without executing mutations | | format | string | no | human | Output format: human or json |

Safety

> ⚠️ metafieldsSet overwrites existing metafield values — there is no merge. metafieldsDelete permanently removes the metafield value from the resource. Run with dry_run: true to confirm the affected product list and verify namespace/key are correct before committing.

Workflow Steps

  1. OPERATION: products — query

Inputs: query: , first: 250, select metafield values for the target namespace/key, pagination cursor Expected output: Products with existing metafield values (for reference); paginate until hasNextPage: false

  1. OPERATION: metafieldsSet — mutation (if action: set)

Inputs: Array of { ownerId, namespace, key, value, type } objects Expected output: metafields { id, key, value }, userErrors

  1. OPERATION: metafieldsDelete — mutation (if action: delete)

Inputs: Array of { ownerId, namespace, key } objects Expected output: deletedMetafields { ownerId }, userErrors

GraphQL Operations

# products:query — validated against api_version 2025-01
query ProductsWithMetafield($query: String!, $namespace: String!, $key: String!, $after: String) {
  products(first: 250, after: $after, query: $query) {
    edges {
      node {
        id
        title
        metafield(namespace: $namespace, key: $key) {
          id
          value
          type
        }
      }
    }
    pageInfo {
      hasNextPage
      endCursor
    }
  }
}
# metafieldsSet:mutation — validated against api_version 2025-01
mutation MetafieldsSet($metafields: [MetafieldsSetInput!]!) {
  metafieldsSet(metafields: $metafields) {
    metafields {
      id
      namespace
      key
      value
      type
      owner {
        ... on Product {
          id
          title
        }
      }
    }
    userErrors {
      field
      message
      code
    }
  }
}
# metafieldsDelete:mutation — validated against api_version 2025-01
mutation MetafieldsDelete($metafields: [MetafieldIdentifierInput!]!) {
  metafieldsDelete(metafields: $metafields) {
    deletedMetafields {
      ownerId
      namespace
      key
    }
    userErrors {
      field
      message
    }
  }
}

Session Tracking

Claude MUST emit the following output at each stage. This is mandatory.

On start, emit:

╔══════════════════════════════════════════════╗
║  SKILL: Metafield Bulk Update                ║
║  Store:                        ║
║  Started:              ║
╚══════════════════════════════════════════════╝

After each step, emit:

[N/TOTAL]   
          → Params: 
          → Result: 

If dry_run: true, prefix every mutation step with [DRY RUN] and do not execute it.

On completion, emit:

For format: human (default):

══════════════════════════════════════════════
OUTCOME SUMMARY
  Resources matched:      
  Metafields set/deleted: 
  Errors:                 
  Output:                 metafield_update_.csv
══════════════════════════════════════════════

For format: json, emit:

{
  "skill": "metafield-bulk-update",
  "store": "",
  "started_at": "",
  "completed_at": "",
  "dry_run": true,
  "namespace": "",
  "key": "",
  "action": "set",
  "outcome": {
    "matched": 0,
    "updated": 0,
    "errors": 0,
    "output_file": "metafield_update_.csv"
  }
}

Output Format

CSV file metafield_update_.csv with columns: resource_type, resource_id, title, namespace, key, old_value, new_value, action

Error Handling

| Error | Cause | Recovery | |-------|-------|----------| | THROTTLED | API rate limit exceeded | Wait 2 seconds, retry up to 3 times | | userErrors — invalid type | value doesn't match value_type | Log error, skip resource, continue | | userErrors — namespace/key not found on delete | Metafield doesn't exist | Log as skipped (already absent) | | No products match filter | Filter too narrow | Exit with 0 matches |

Best Practices

  • metafieldsSet is batched — the mutation accepts up to 25 metafields per call. The skill automatically batches large product sets.
  • Always verify the namespace and key match your store's metafield definitions — typos create orphaned metafields that don't connect to any theme feature.
  • For storefront-powered metafields (e.g., displayed in product templates), confirm the theme reads the correct namespace/key before running at scale.
  • Use dry_run: true to preview exactly which products and current values will be affected before overwriting.

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.