Skip to main content
Glama

Set Import Mapping

set_import_mapping
DestructiveIdempotent

Set (or replace) the declarative column mapping for a staged import session and validate it against EVERY staged row. Author the mapping from the profile get_import_session returns. For salesOrderHistory: fields keyed by canonical name (orderNumber, customerPurchaseOrder, orderDate, sku, upc, itemName, quantity, price, uomName, customerName, customerEmail); requires an identity field (orderNumber or customerPurchaseOrder), orderDate, quantity, and an item reference (sku/upc/itemName). For purchaseOrderHistory: fields (poNumber, supplierName, orderDate, receivedDate, expectedDate, status, supplierInvoiceNumber, note, sku, upc, itemName, quantity, unitCost, uom, minimumOrderQuantity); requires poNumber, supplierName, orderDate, quantity, and an item reference. For customerReturnHistory (one row per returned item): fields (returnNumber, returnDate, salesOrderReference, note, sku, upc, quantity, reason); requires returnNumber, returnDate, quantity and sku or upc; reason must be one of not_needed, wrong_product, other, cancelled (net demand), defective, damaged, fulfillment_error, refunded_not_returned (do not) — translate the export's own values with valueMap, e.g. {"Restock": "not_needed"}; unmapped blanks are treated as lost demand. Each field is bound to a source column (or a const), with optional dateFormats (orderDate/receivedDate/returnDate) and valueMap; filters include/exclude rows by column value (e.g. exclude Status=Cancelled). dateFormats are .NET custom format strings (MM-dd-yy, yyyy-MM-dd), NOT strftime — prefer a format the profile already reported in detectedDateFormats, or omit dateFormats and let the loose invariant parse handle it. The response is a bucketed validation report over the full dataset — iterate on the mapping until the skip rate is acceptable, then preview via commit_import_session. Invalid rows are excluded from the import, never silently fixed. Treat validation.warnings as blocking.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "importSessionId": "<importSessionId>",
      "mapping": "<mapping>"
    },
    "name": "set_import_mapping"
  }
}

Input Schema

NameRequiredDescriptionDefault
mappingYesThe declarative mapping (fields + filters).
importSessionIdYesThe import session id (GUID).

Output Schema

NameRequiredDescriptionDefault
okNo
validationNo
readyToPreviewNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.9/5.0
Behavior5/5

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

Annotations already declare destructiveHint=true and idempotentHint=true, but the description adds substantial context beyond that: validation covers the full dataset, invalid rows are excluded and never silently fixed, and validation.warnings are treated as blocking. These are operational traits the agent otherwise could not infer.

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

Conciseness4/5

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

Long, but the length is earned by the per-type field lists and the date-format trap. Purpose is front-loaded and the iterate-then-preview workflow closes it. Slightly dense with semicolon-chained clauses, but no wasted sentences.

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

Completeness5/5

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

With an output schema present, return values need not be explained, and the description still summarizes the response as a bucketed validation report. Between required fields per type, filters, valueMap, and dateFormats, an agent has enough to call this correctly on first attempt.

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

Parameters5/5

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

Though schema coverage is 100%, the description adds meaning well beyond the schema: canonical field names per import type, which fields are required for each, the allowed reason enum values, a valueMap translation example, and the .NET-vs-strftime dateFormats pitfall. This is far richer than the raw schema.

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

Purpose5/5

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

States a specific verb and resource: set/replace the declarative column mapping for a staged import session, and validate against every row. The 'set (or replace)' parenthetical and validation scope make it clearly distinct from commit_import_session or get_import_session.

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

Usage Guidelines5/5

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

Explicitly says to author the mapping from the profile get_import_session returns, to iterate until the skip rate is acceptable, and to preview via commit_import_session. Names the alternative and the condition that selects it, so the agent knows the workflow order.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.

Resources