Skip to main content
Glama
xlsx-for-ai

xlsx-for-ai

by senoff

shopify_variant_metafields_import

Destructive

Import per-SKU Shopify variant metafields from CSV or XLSX files and map each column to Shopify metafield definitions for bulk updates.

Instructions

Use this when you need to import per-variant (per-SKU) metafields, mapped to Shopify's metafield definitions.

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": "shopify_variant_metafields_import"
  }
}

Input Schema

NameRequiredDescriptionDefault
fileNoThe spreadsheet file, handed off by a host that fills in the OpenAI file-parameter convention (openai/fileParams) from an uploaded or attached file. The server downloads download_url once, server-side; never a local sandbox path.
optionsNoReserved for future producer options.
file_b64NoBase64-encoded CSV or XLSX with one row per variant: a Variant SKU column plus one `Variant Metafield: <namespace>.<key> [<type>]` column per metafield. Send exactly one file source: file_b64 (this field), file_url, file_handle, or file_text together with file_name.
file_urlNohttps URL of the spreadsheet file (e.g. a shared Google Drive, Google Sheets, Dropbox, OneDrive or S3 link; must be viewable by anyone with the link). The server downloads it directly. Provide this OR file_handle.
filenameNoOriginal filename (optional; used in ledger prose).
file_nameNoFile name with its extension (.csv, .tsv or .json), used with file_text.
file_textNoUse only for a small CSV, TSV or JSON file whose full text you already have. Practical limit about 2,000 cells or 40 KB (the server hard cap is 256 KB); above that use file_url, or xlsx_upload_link and file_handle. Requires file_name. Never encode or retype a binary file by hand. Provide this OR file_url OR file_handle.
file_handleNoHandle returned by xlsx_upload_link, once the user has uploaded the spreadsheet file on that page. Use this when the user attached the file in chat or has no link. Provide this OR file_url.
file_sha256NoHex SHA-256 of the exact file_text UTF-8 text. Optional; checked when given.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Addedv4.3.1

TDQS

A3.7/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare destructive=true and non-idempotent, covering the safety profile. The description adds that metafields must map to Shopify's metafield definitions, a useful prerequisite, but does not explain overwrite semantics, required permissions, or what happens on duplicate SKUs.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

A single front-loaded sentence with no wasted words. It efficiently conveys the primary use case and scope.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 9-parameter destructive import with multiple mutually exclusive file sources, the description is minimal. The rich schema covers parameter details and annotations cover safety, but the description could still mention the file-source handoff or overwrite risk to be complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the detailed file input options and column format are fully documented in the schema. The description adds no parameter-specific meaning beyond the per-SKU scope, so the baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific verb (import) and resource (per-variant metafields), and the per-SKU scope distinguishes it from product-level metafield imports. It does not explicitly name a sibling, so it is clear but not maximally differentiated.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Provides an explicit when-to-use condition ('when you need to import per-variant metafields'), which implicitly contrasts with product-level imports. However, it does not state when not to use it or name alternatives like shopify_product_metafields_import or shopify_metafields_safe_reimport.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.