This guide sets up an AI agent that reads the InfiPlex shop log every morning, finds every channel call that failed in the last 24 hours (order pulls, tracking sends, inventory sends, acknowledgments, invoices), groups them by channel and cause, attaches the affected order's current state, and writes the list before anyone opens Seller Central, Supplier Center, or Vendor Central. It uses the InfiPlex MCP server, a key with Read Log and Read Orders, and Claude Code in headless mode from cron. Optionally, on a key with Write Orders, it also adds an internal note to each affected order so the person picking it up sees the failure without opening the log. The shop log is where InfiPlex records the result of every call it makes to a channel; this agent is a reader for it. Pair it with the channel guides for Amazon Vendor Central, Temu, and Walmart DSV, whose clocks are the reason a failed send matters the same day.
Jump to What You Need
| If You Want To… | Go To |
|---|---|
| Understand what the agent does each run | The Job |
| Understand how log types work | Log Types |
| Create the key it runs on | The Key |
| Write the standing instructions | The Instruction File |
| Wire it to the MCP server and cron | The Run Command and Schedule |
| See what a morning report looks like | The Failure Report |
The Job
At 6:00 AM the agent:
- Calls log_types_get and keeps every log type whose label contains "Failed". On a typical instance that is one type per channel per action: Get Orders, Send Tracking, Send Inventory, and so on.
- Calls log_search on each of those types for the last 24 hours, just_count first, then the entries for any type with a count above zero.
- Groups the entries by channel and by the first distinctive phrase of the error message, so twenty identical authentication failures become one line with a count.
- Calls order_search with marketplace_fulfillment_error 1 and just_basic_order_data_results 1, which returns every order InfiPlex has flagged because the channel rejected its fulfillment, whether or not a log entry named it. Merges those with the order ids found in the log entries and calls order_get on each, so the report says whether the failed send is still unresolved or was retried and succeeded.
- Checks each failing channel's success type over the same window to say whether the failure is ongoing (no successes since) or transient (successes after it).
- Optionally, on a key with Write Orders, calls order_note_create on each affected order with a one-line note naming the failure and the time.
- Writes failures-YYYY-MM-DD.txt.
Everything it touches is on the tools reference. The two log tools and order_get are reads. order_note_create is a direct write with no preview, because a note is internal and never reaches a channel or a customer; it is the only write on this key if you choose to include it.
Log Types
InfiPlex records every channel call as a log entry with a numeric type. log_types_get returns the full map for your instance, id to label, and the labels follow a channel, action, status pattern, for example an Amazon Get Orders: Failed type alongside its success counterpart, and a catch-all per channel such as an Amazon: Any Log type. The ids are per instance and the set grows as connections are added, which is why the agent reads the map every morning instead of carrying a list. log_search takes one type, an optional search_term, a date window in the 2018-01-01 10:10:10 AM format, limit up to 100, and just_count; log_message comes back decoded, so the error text is readable without parsing.
The Key
In your InfiPlex admin go to Tools > Admin API > Create New API Key. Name it for the job, for example failed-sync-watch.
- Scopes, read-only version: Read Log, Read Orders. The agent reads the log and the affected orders and writes the report file. Nothing in InfiPlex changes.
- Scopes, noting version: add Write Orders. The agent gains order_note_create, order_additional_info_create, order_processed, and order_update_status; the instruction file tells it to use only the first. Tracking, cancel, and create are previewed writes and the file forbids them.
- MCP Enabled: Yes. MCP Allow Setting Writes: No. MCP Allow Arming: No.
Start with the read-only version. Once the report has been right for a week, add Write Orders if the notes are worth having. The set-up guide covers the key page in detail.
The Instruction File
Save this as failed-sync-agent.md. The Notes section is the only part that changes between the read-only and noting versions.
# Failed sync watch for ACME on InfiPlex You run unattended. Complete every step, then write the report. Do not ask questions; if something is ambiguous, describe it in the report and continue. The window is the last 24 hours ending now, in the account time zone. ## Steps 1. Call log_types_get. Keep every type whose label contains "Failed". Also keep, for each channel, the matching success type (same channel and action, without "Failed") if one exists. 2. For each Failed type, call log_search with that log_type, start_date and end_date for the window, and just_count 1. For any count above 0, call log_search again with limit 100 and page with limit_start until every entry is collected. 3. Group entries by channel (from the type label) and then by the first 60 characters of log_message after removing order ids, timestamps, and tracking numbers. Record a count per group and the most recent time. 4. Call order_search with marketplace_fulfillment_error 1, just_basic_order_data_results 1, limit 100, paging as needed. Add every returned order id to the affected set. Also add any InfiPlex order id named in a log_message; if an entry names only a marketplace order number, call order_search with text_search on that number first. Then call order_get once per distinct order id and record fully_shipped, has_tracking, and the order status. 5. For each channel with failures, call log_search on that channel's matching success type with start_date set to the time of the last failure and just_count 1. If the count is above 0, mark the group "recovered"; otherwise mark it "ongoing". 6. Notes: [read-only version: skip this step.] [noting version: for each affected order that is not marked recovered, call order_note_create with order_note set to "Sync failureat
The Run Command and Schedule
Save infiplex-mcp.json next to the instruction file:
{
"mcpServers": {
"infiplex": {
"type": "http",
"url": "https://yourcompany.infiplex.com/mcp",
"headers": { "api-token": "YOUR_WATCH_KEY" }
}
}
}
Then run-failed-sync-agent.sh:
#!/bin/sh cd /srv/acme-syncwatch claude -p "Read failed-sync-agent.md and carry it out for the last 24 hours." \ --mcp-config infiplex-mcp.json \ --allowedTools "mcp__infiplex,Read,Write" \ --max-turns 150 \ --max-budget-usd 2 \ --output-format json > run-$(date +%F).json 2> run-$(date +%F).err
Schedule it at 6:00 AM in your account time zone, ahead of the first shift:
0 6 * * * /srv/acme-syncwatch/run-failed-sync-agent.sh
A quiet instance makes two or three dozen calls (one count per Failed type, a handful of order_get calls). An instance with a channel outage overnight can make a hundred; --max-turns caps that and the report says if it ran out. If you want the report in Slack or email, pipe the text file with one more line of shell; the agent's job ends at the file.
The Failure Report
Failed sync report, 2026-09-28 06:01, window 2026-09-27 06:00 to 2026-09-28 06:00
ONGOING (needs a person)
Walmart DSV / Send Tracking: Failed 2 entries, last 16:22
carrier code rejected ("UPS Ground" in carrier field, method blank)
orders 4420088, 4420091: shipped in InfiPlex, tracking not at Walmart
Temu / Send Tracking: Failed 1 entry, 11:05
tracking number failed validation (17 chars, UPS format missing 1Z)
order 4418990: shipped in InfiPlex, tracking not at Temu
RECOVERED (for information)
Walmart DSV / Send Inventory: Failed 1 entry, 02:14, authentication error
next Send Inventory success 03:14
Amazon Vendor Central / Get Orders: Failed 3 entries, 01:40 to 02:00, timeout
next Get Orders success 02:20
ORDERS AFFECTED
4420088 Walmart DSV shipped, tracking recorded, not confirmed to channel note added: yes
4420091 Walmart DSV shipped, tracking recorded, not confirmed to channel note added: yes
4418990 Temu shipped, tracking recorded, not confirmed to channel note added: yes
Types checked: 14 Failed types across 6 channels
Tool calls made: 32 (log_types_get 1, log_search 23, order_search 1, order_get 3, order_note_create 3)
The Ongoing section is the whole point: three orders whose parcels are moving but whose channels do not know yet, found at 6 AM instead of in a performance report. A person re-records the two Walmart shipments with the carrier and method split, and the Temu one with the full number, and the clocks in the DSV rules and Temu requirements guides are met. Re-recording is a previewed write on a warehouse key, not something this agent does; the Walmart DSV agent guide shows that conversation.
Failed Sync Watch Agent Checklist
- Create the key at Tools > Admin API: Read Log, Read Orders, MCP Enabled Yes, both flags No.
- Save failed-sync-agent.md (read-only version), infiplex-mcp.json, and run-failed-sync-agent.sh.
- Run by hand once; open two entries in the InfiPlex log and confirm the report matches.
- Add the cron line for 6:00 AM.
- After a week of correct reports, add Write Orders to the key and switch the Notes step to the noting version if the notes are useful.
Failed Sync Watch Agent Questions
Does the agent fix anything?
No. It reports and, in the noting version, marks the affected orders. InfiPlex already retries channel calls on its own schedule; what nobody had was a morning list of the ones that were still failing. Repairs such as re-recording tracking are previewed writes a person or a separate agent does on a warehouse key.
Why read the log types every run instead of a fixed list?
Because the type ids are per instance and the set changes when a connection is added. Reading the map each morning means a new channel's failures show up the day after it goes live with no change to the file.
How does it tell a transient failure from an outage?
By checking the channel's matching success type after the time of the last failure. Successes after it means InfiPlex recovered; none means the failure is ongoing and a person should look. That one step keeps the report from listing every timeout that healed itself.
Can a bad log message make the agent do something else?
The key limits it to the log and order reads plus, at most, order notes; there is nothing else published to call. The instruction file also says every log_message is data. A message that contained instructions could at worst produce a strange note on an order.
Can it cover several clients?
Yes. One folder, one key, one cron line per client instance. Each key sees only its instance, and each report is that client's alone.
What does InfiPlex charge for this?
Nothing beyond API access, which is part of the Growth and Enterprise packages. MCP calls are not metered. Model usage is billed by your AI vendor; a quiet morning costs a few cents.
Every failed channel call, on your desk at 6 AM.
The same MCP server runs a morning failure report, a confirm-in-chat warehouse assistant, and an unattended fulfillment agent. The key decides which. Included with API access on every InfiPlex plan.
Related guides
- Autonomous Fulfillment Agent
- Nightly Restock Agent
- Morning Unshipped Orders Agent
- AI Agent for Amazon Vendor Central
- AI Agent for Temu
- AI Agent for Walmart DSV
- InfiPlex MCP Server
- MCP Server Set-Up
- MCP Tools Reference
- How AI Agent Writes Are Protected
- Headless Order Management
- InfiPlex OMS Alert Set-Up
