Skip to main content
Glama

Roll Back Import Session

rollback_import_session
DestructiveIdempotent

Roll back a committed import — staged or inline (governed two-step, destructive): for sales-order imports, soft-deletes every order the session created and removes their seeded demand records so velocity/forecasting return to the pre-import state; for purchase-order imports, soft-deletes the POs; for customer-return imports (staged or import_customer_returns), soft-deletes the return orders so demand stops netting them. Catalog entities the import created (items, customers, UOMs, suppliers) are NOT removed — they may be referenced elsewhere; say so when reporting. Call with preview=true first, then repeat with the previewReceipt and a fresh idempotencyKey.

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>"
    },
    "name": "rollback_import_session"
  }
}

Input Schema

NameRequiredDescriptionDefault
previewNoSet true for the dry-run preview.
idempotencyKeyNoCaller-generated idempotency key; required with previewReceipt.
previewReceiptNoThe receipt returned by the preview call.
importSessionIdYesThe import session id (GUID).

Output Schema

NameRequiredDescriptionDefault
okNo
noteNo
expiresAtNo
actionItemIdNo
confirmationNo
correlationIdNo
ordersDeletedNo
approvalResultNo
idempotencyKeyNo
ordersToDeleteNo
previewReceiptNo
idempotentReplayNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A4.6/5.0
Behavior5/5

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

Goes well past the destructiveHint annotation by specifying the concrete blast radius: soft-deletes every order the session created, removes seeded demand records so velocity/forecasting return to pre-import state, and stops demand netting for returns. It also discloses the deliberate boundary (catalog entities survive because they may be referenced elsewhere) and instructs the agent to report that limitation, which is behavioral context no annotation carries.

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?

Front-loaded with the action and the '(governed two-step, destructive)' flag, then the per-entity consequences, then the required call sequence — a sensible ordering with no filler. It loses a point for long semicolon-chained sentences that make the per-type behavior harder to scan than a short list would.

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 destructive multi-step mutation, the definition covers precondition, per-type effects, non-effects, reporting guidance, and the exact two-call protocol, while an output schema and rich annotations handle return shape and safety hints. Nothing an agent needs before committing to the destructive call is absent.

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

Parameters4/5

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

Schema coverage is 100%, so baseline would be 3, but the description adds real meaning the schema does not: that preview and the real call are a governed pair, that previewReceipt comes from the preview response, and that idempotencyKey must be fresh on the second call. Only importSessionId's GUID origin is left to the schema, which is fine.

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 ('Roll back a committed import') and then breaks the effect down per import type (sales orders, purchase orders, customer returns), so an agent knows exactly which session kinds this applies to. It also explicitly contrasts with what it does NOT touch (items, customers, UOMs, suppliers), which distinguishes it from any cleanup/delete sibling.

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?

Gives a clear precondition (the import must be committed — it is not a cancel for in-flight sessions) and an explicit mandatory two-step procedure: preview=true first, then repeat with the previewReceipt and a fresh idempotencyKey. It also names a when-not case for catalog entities. What is missing is a pointer to alternatives such as resume/inspect paths (get_import_session) or a forward-fix instead of rollback.

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