Skip to main content
Glama

Create Import Session

create_import_session

Start a STAGED historical import for a large or file-based history — the scalable alternative to the inline import tools (which cap at 500 orders per call). Supports three kinds: "salesOrderHistory" (demand velocity), "purchaseOrderHistory" (lead-time observation + vendor graph) and "customerReturnHistory" (returns that net demand — the file form of import_customer_returns; storeId names the store whose warehouse the returns came back to). For PO history, storeId names the store whose warehouse the orders were bought into, so open POs show on its receiving and on-order views. Route large PO CSVs (>500 rows) through this session path instead of calling import_historical_purchase_orders in chunks — it removes the 500-call cap and lets the customer upload once. Returns an uploadUrl: give it to the customer and ask them to open it in a browser and drop their raw export (CSV or XLSX, one header row, up to 25 MB). Nothing else is needed from them — the server parses and profiles every row. Poll get_import_session to see the file arrive, then set_import_mapping → commit_import_session. Spark retains at most the latest 36 calendar months represented by the file; older rows are reported and omitted automatically.

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

Input Schema

NameRequiredDescriptionDefault
kindNoImport kind: "salesOrderHistory" (default), "purchaseOrderHistory" or "customerReturnHistory".salesOrderHistory
storeIdNoOptional STORE id (GUID). Sales history is recorded on this store (the tenant's default store when omitted); returns and purchase orders land in this store's warehouse. Omitted on purchaseOrderHistory, the orders land in the tenant's only internal warehouse, or in none when it has several — pass a storeId then. Get store ids from list_warehouses (each warehouse row lists its stores with their storeId) — a warehouse id is not a store id, even though a warehouse's companion store shares its name.
clientIdNoOperator (unpinned) credentials on 3PL tenants: the target client id (GUID) the imported history belongs to — get ids from list_clients. Client-pinned credentials omit this; the credential decides.
createMissingEntitiesNoCreate items, customers, and UOMs the history references but the tenant doesn't have yet (default true).

Output Schema

NameRequiredDescriptionDefault
okNo
uploadUrlNo
instructionsNo
importSessionIdNo
sessionExpiresAtNo
uploadTokenExpiresAtNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.7/5.0
Behavior4/5

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

Annotations already declare this is a non-read-only, non-destructive, non-idempotent, closed-world mutation. The description goes well beyond that by disclosing the uploadUrl handoff, the file constraints (CSV/XLSX, one header row, 25 MB), server-side parsing/profiling, and the 36-month retention policy with automatic omission of older rows. It does not state permission/auth requirements or what happens to a session that is abandoned, so a 4 rather than 5.

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?

The opening sentence front-loads the purpose and the alternative, and the workflow order is stated sequentially. It is a dense single block, however, and the storeId rationale and 36-month retention detail lengthen it beyond what a first-pass reader needs.

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?

For a session-creating mutation with an output schema, this covers everything an agent needs: when to choose it, what it returns, what the caller must do with the URL, the size/format limits, and the exact downstream tool sequence. The retention caveat closes the remaining gap about data truncation.

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?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning: it explains what each kind represents and clarifies storeId's role per kind (returns land in the store's warehouse, POs land in the warehouse the orders were bought into, and the multi-warehouse failure case when omitted). That is interpretive value beyond the schema's wording.

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 ("Start a STAGED historical import") and enumerates the three supported kinds with domain meaning for each (demand velocity, lead-time observation, returns netting demand). It explicitly positions itself against the inline import siblings ("the scalable alternative to the inline import tools"), so an agent can distinguish it without opening schemas.

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?

Gives explicit when-to-use conditions: large or file-based history, PO CSVs over 500 rows, customer uploads over the 500-call cap. It names the alternative it replaces (import_historical_purchase_orders in chunks) and lays out the follow-on sequence (poll get_import_session, then set_import_mapping, then commit_import_session).

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