Skip to content

Connect Unleashed to ChatGPT: Manage Stock, Orders and Assemblies

Learn how to connect Unleashed to ChatGPT using a managed MCP server. Automate inventory, sales orders, and assemblies with natural language.

Riya Sethi Riya Sethi · · 10 min read

If you need to connect Unleashed to ChatGPT to automate inventory checks, manage sales orders, or orchestrate complex manufacturing assemblies, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between ChatGPT's tool calls and Unleashed's highly specific REST APIs. You can either build, host, and maintain this infrastructure yourself, or use a managed integration platform like Truto to dynamically generate a secure, authenticated MCP server URL.

If your team uses Claude, check out our guide on connecting Unleashed to Claude or explore our broader architectural overview on connecting Unleashed to AI Agents.

Giving a Large Language Model (LLM) read and write access to an inventory management system like Unleashed is a severe engineering challenge. Unleashed enforces strict data validation, complex foreign key relationships between products, warehouses, and tax rates, and a rigid state machine for order lifecycles. If you try to wire ChatGPT directly to the Unleashed API, your LLM will hallucinate payloads, violate state transitions, and fail on proprietary date formats.

This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for Unleashed, connect it natively to ChatGPT, and execute complex supply chain workflows using natural language.

The Engineering Reality of the Unleashed API

A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable way for models to discover tools, implementing it against Unleashed's API is exceptionally painful (see our build vs buy analysis).

If you decide to build a custom MCP server for Unleashed, you own the entire API lifecycle. Here are the specific integration challenges that break standard CRUD assumptions when working with Unleashed:

Proprietary WCF Date Formats

Unleashed's API relies heavily on Microsoft WCF JSON date serialization. When you query an assembly or purchase order, dates are returned as strings formatted like /Date(1598918400000)/. However, the API strictly rejects this format on input. If an LLM tries to pass the exact date string it received back into an update payload, the Unleashed API will throw an error. Your custom MCP server must intercept all payloads, parse the WCF timestamps, and convert them to proper ISO-8601 strings before forwarding the request. Truto handles this translation automatically, abstracting the complexity away from the LLM.

Rigid State Machine Transitions

Unleashed does not treat order statuses as simple strings you can PATCH. A Purchase Order, Sales Order, or Assembly exists in specific states - "Parked", "Placed", or "Completed". You cannot simply update a JSON field to "OrderStatus": "Completed". Instead, the API requires distinct RPC-like calls to finalize records, triggering irreversible downstream accounting and inventory posting. Your custom MCP server must map standard LLM intents into these specific endpoint invocations (e.g., mapping "complete the order" to the /Complete endpoint, not an update method).

Currency, Tax, and Ledger Constraints

Creating records in Unleashed requires deep contextual awareness. If an LLM attempts to create a Purchase Order, the Currency field must match the supplier's default currency exactly, and a valid exchange rate must exist in the system settings. Furthermore, tax codes and rates must map perfectly to existing purchase or sales taxes in the account, and line item totals (SubTotal, TaxTotal, Total) must mathematically match the parent record totals perfectly. Without a tightly constrained JSON Schema provided by a managed MCP server, an LLM will consistently fail these validation checks.

How to Generate an Unleashed MCP Server

Truto derives MCP tools dynamically from the API documentation and resource configurations of your connected Unleashed account. There is no manual schema mapping required. You can generate a scoped MCP server either through the Truto dashboard or programmatically via the API.

Method 1: Via the Truto UI

For one-off agent deployments or testing, generating a URL from the dashboard is the fastest path.

  1. Navigate to your connected Unleashed instance on the Integrated Accounts page.
  2. Click the MCP Servers tab.
  3. Click Create MCP Server.
  4. Select your desired configuration (e.g., name the server "Unleashed Supply Chain", select allowed methods like read and write, and apply tags like products or assemblies).
  5. Click save and copy the generated MCP server URL (it will look like https://api.truto.one/mcp/a1b2c3d4...). Treat this URL as a sensitive credential.

Method 2: Via the Truto API

For programmatic, multi-tenant deployments where you need to spin up servers for hundreds of customers dynamically, use the API. You need the integrated_account_id for the specific Unleashed connection.

curl -X POST https://api.truto.one/integrated-account/$INTEGRATED_ACCOUNT_ID/mcp \
  -H "Authorization: Bearer $TRUTO_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ChatGPT Inventory Manager",
    "config": {
      "methods": ["read", "write", "custom"],
      "tags": ["inventory", "assemblies", "sales_orders", "purchase_orders"]
    }
  }'

Truto responds with a JSON object containing the secure url. This single URL handles all routing, authentication, and token validation logic behind the scenes.

How to Connect the Unleashed MCP Server to ChatGPT

Once you have your Truto MCP server URL, you must register it with your client so the LLM can discover and execute the Unleashed tools.

Method 1: Via the ChatGPT UI (Custom Connectors)

If you are using ChatGPT Pro, Plus, Business, Enterprise, or Education accounts, you can add the server directly via the interface.

  1. Open ChatGPT and navigate to Settings -> Apps -> Advanced settings.
  2. Toggle Developer mode to ON.
  3. Under the MCP servers / Custom connectors section, click Add new.
  4. Give the connector a descriptive name (e.g., "Unleashed ERP").
  5. Paste the Truto MCP URL into the Server URL field.
  6. Click Save.

ChatGPT will immediately perform a JSON-RPC handshake with the URL, pulling down the full inventory of Unleashed tools, complete with descriptions and JSON schemas.

Method 2: Via Manual Configuration (server-sse)

If you are orchestrating ChatGPT via an API-driven agent framework (like LangChain or an open-source MCP client) or using a local desktop client that supports standard MCP config files, you can connect using the Server-Sent Events (SSE) transport protocol.

Add the following to your MCP configuration file (mcp.json or equivalent):

{
  "mcpServers": {
    "unleashed-erp": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "--url",
        "https://api.truto.one/mcp/YOUR_TRUTO_TOKEN"
      ]
    }
  }
}

Restart your agent or client. The framework will spin up the SSE transport layer, connecting natively to Truto's secure endpoint.

Hero Tools for Unleashed Operations

Truto dynamically generates over 100 tools for Unleashed, but exposing all of them at once can overwhelm an LLM's context window. We recommend using Truto's tag and method filtering to constrain the MCP server to the specific operations your agent needs.

Here are the highest-leverage tools for automating Unleashed workflows.

1. Check Live Stock on Hand (list_all_unleashed_stock_on_hands)

This tool is essential for inventory querying. It returns paginated items including product code, warehouse location, on-hand quantities, allocated quantities, available quantities, and average cost. Products with zero transactions are natively excluded by Unleashed.

"Check the current stock on hand for product code 'WIDGET-01' across all warehouses. Are there enough available units to fulfill a new order of 500?"

2. Orchestrate Manufacturing Assemblies (create_a_unleashed_assembly)

Allows the agent to create a new assembly (Bill of Materials style) in a "Parked" state. The LLM must pass an array of AssemblyLines, specifying the component products and quantities required to build the finished good.

"Create a new assembly for 50 units of 'PREMIUM-BIKE'. Source the components from the 'Main Warehouse' and send the finished goods to the 'Retail Hub'."

3. Complete Purchase Orders (unleashed_purchase_orders_complete)

A custom RPC-style tool that transitions a Purchase Order out of the "Parked" or "Placed" state into the "Completed" state. This triggers Unleashed to finalize the order and log the financials. It takes no request body, only the order_guid.

"Take purchase order GUID 1234-abcd and mark it as completed."

4. Manage Sales Shipments (list_all_unleashed_sales_shipments)

Retrieves sales shipments with powerful filters for date ranges, order numbers, statuses, warehouses, or specific serial/batch numbers. Crucial for customer support agents tracking logistics.

"Find all dispatched sales shipments from the last 7 days that originated from the 'East Coast' warehouse."

5. Create Supplier Returns (create_a_unleashed_supplier_return)

Allows an agent to initiate a return against a specific Purchase Order. The LLM must reference the original PO and populate the SupplierReturnLines. Note that Unleashed returns an empty body on success for this endpoint, so the agent relies on a clean 200 response to confirm the action.

"Create a supplier return for purchase order PO-9921. We are returning 15 units of 'FAULTY-PART-B' because they failed quality inspection."

6. Adjust Stock Levels (create_a_unleashed_stock_adjustment)

Permits the agent to perform manual stock adjustments. The LLM must supply a valid AdjustmentReason that already exists in the account, along with the NewQuantity and the total NewActualValue.

"Execute a stock adjustment for product 'OLD-STOCK-99'. Set the new on-hand quantity to zero and the new actual value to zero. Use the adjustment reason 'Damaged in transit'."

For a complete list of endpoints, including custom fields and complex nested schemas, view the full Unleashed integration page.

Workflows in Action

With your MCP server connected, ChatGPT can execute multi-step supply chain operations by chaining these tools together.

Scenario 1: Production Planner Resolving Shortages

A production planner notices a spike in demand for a specific manufactured product and asks ChatGPT to ensure there is enough stock, orchestrating assemblies if necessary.

"I need to fulfill an order for 200 units of 'DELUXE-CHAIR'. Check our current stock on hand. If we are short, check the Bill of Materials for this product, verify if we have enough raw materials in the 'Main Warehouse', and create a parked assembly to build the missing units."

How the agent executes this:

  1. Calls list_all_unleashed_stock_on_hands filtering by the product code to check current availability.
  2. Identifies a shortage (e.g., only 50 units available, needing 150 more).
  3. Calls list_all_unleashed_bill_of_materials to retrieve the components required to build 150 chairs.
  4. Calls list_all_unleashed_stock_on_hands again, iterating through the required components to ensure raw material availability.
  5. Calls create_a_unleashed_assembly, constructing the JSON payload with the exact AssemblyLines and quantities needed, returning the newly created Assembly GUID to the user.
sequenceDiagram
  participant User as User
  participant ChatGPT as "ChatGPT (LLM)"
  participant Truto as "Truto MCP Server"
  participant API as "Unleashed API"

  User ->> ChatGPT: "Check stock for DELUXE-CHAIR...<br>Create assembly if short."
  ChatGPT ->> Truto: Call list_all_unleashed_stock_on_hands
  Truto ->> API: GET /StockOnHand?product=DELUXE-CHAIR
  API -->> Truto: Returns 50 units
  Truto -->> ChatGPT: JSON Result (Short 150 units)
  
  ChatGPT ->> Truto: Call list_all_unleashed_bill_of_materials
  Truto ->> API: GET /BillOfMaterials
  API -->> Truto: Returns BOM lines
  Truto -->> ChatGPT: JSON Result (Wood, Screws, Fabric)
  
  ChatGPT ->> Truto: Call create_a_unleashed_assembly
  Truto ->> API: POST /Assemblies
  API -->> Truto: Returns Assembly GUID
  Truto -->> ChatGPT: JSON Result (Parked Assembly)
  ChatGPT -->> User: "Created parked assembly for 150 units."

Scenario 2: Expediting a Sales Order and Shipment

A customer service representative needs to rapidly process an urgent B2B order and ensure the warehouse knows to ship it immediately.

"Find sales order SO-5541. Update its status to 'Completed', and then immediately create a sales shipment for it from the 'Central' warehouse."

How the agent executes this:

  1. Calls list_all_unleashed_sales_orders with the orderNumber filter to retrieve the exact Order GUID and line item details.
  2. Calls unleashed_sales_orders_complete passing the Order GUID to finalize the order in the ledger.
  3. Calls create_a_unleashed_sales_shipment referencing the OrderNumber and mapping the SalesOrderLineNumber for each product to authorize the dispatch.

Handling Rate Limits in Production

When building autonomous agents that aggressively query inventory and loop through line items, you will eventually hit Unleashed's rate limits.

Factual note on rate limits: Truto does not retry, throttle, or apply backoff on rate limit errors. When an upstream API like Unleashed returns an HTTP 429, Truto passes that error directly to the caller. Truto normalizes the upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) following the IETF specification.

The caller (your AI agent framework or ChatGPT client) is strictly responsible for interpreting these headers and executing its own retry and backoff logic. Do not rely on Truto to automatically absorb or queue requests when limits are exceeded.

Security and Access Control

When giving an LLM access to your financial and inventory ledgers, strict boundary enforcement is non-negotiable. Truto's MCP servers are designed with zero-trust principles:

  • Method Filtering: You can strictly limit an MCP token to only read operations, completely preventing the LLM from executing create, update, or delete actions against Unleashed, effectively eliminating the risk of accidental data modification.
  • Tag Filtering: Scope the LLM's visibility by tagging specific resources. For example, you can expose ["sales_orders", "stock"] while hiding sensitive endpoints like ["taxes", "bank_accounts"].
  • Require API Token Auth: For internal deployments, enable require_api_token_auth. This forces the caller to provide a valid Truto API token in addition to the MCP URL, ensuring the URL alone cannot be abused if leaked.
  • Time-to-Live (Expires At): Grant temporary access by setting an expires_at timestamp. Truto automatically destroys the token when the time elapses, perfect for temporary agent sessions.

Stop Wrestling with ERP Integrations

Building a custom MCP server for Unleashed means fighting with WCF date parsers, reverse-engineering rigid state machines, and writing endless TypeScript interfaces for complex nested objects like Bills of Materials and Sales Shipments.

Truto eliminates this overhead. By dynamically generating highly accurate, schema-validated tools directly from the API documentation, Truto lets your engineers focus on building intelligent agent workflows instead of maintaining integration boilerplate.

FAQ

How does ChatGPT authenticate with the Unleashed API?
ChatGPT authenticates using a secure Model Context Protocol (MCP) server URL generated by Truto. Truto securely stores the underlying Unleashed API credentials and handles all routing, translation, and token management behind the scenes.
Can I prevent ChatGPT from deleting inventory or orders in Unleashed?
Yes. When generating the MCP server in Truto, you can use Method Filtering to restrict the server to 'read' operations only, ensuring ChatGPT cannot execute 'create', 'update', or 'delete' requests against your Unleashed data.
How do Truto MCP servers handle Unleashed's rate limits?
Truto does not retry, throttle, or apply backoff on rate limit errors. When Unleashed returns an HTTP 429, Truto passes that error to the caller with normalized standard rate limit headers. Your AI agent is responsible for retry and backoff logic.
Do I have to write custom schemas to expose Unleashed custom statuses?
No. Truto dynamically derives the MCP tool definitions directly from the Unleashed API documentation and integration configurations, including custom fields and dynamic statuses. No manual coding or schema writing is required.

More from our Blog