Fairhaul Freight Margins
v0.1.0Compares the freight you charged each customer with what the freight actually cost
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
fairhaul_info
Show this pack: pinned model, mode, caps, Auto opt-ins, and the allow/ask/block decision for every tool.
fairhaul_inspect_input
Show how a CSV, TSV, Excel, JSON or JSONL file under the root would be read: its format, which export it looks like, which of its columns map to this pack's columns, and what each column holds. Returns column names and shapes only, never cell values. Use it before a tool when a file comes straight from another system.
| Parameter | Type | Description |
|---|---|---|
path * | string | A CSV, TSV, Excel .xlsx, JSON or JSONL file under the root |
as | string | Source kind to read it as (default: every kind this agent declares, best match first) |
sheet | string | integer | Excel sheet name or 0-based index (default: first visible sheet) |
margins_margins Compare freight charged with freight cost
[ALLOW] Per order: terms, value, freight charged and cost (split by value on shared shipments), gap, recovery and flags. Totals, policy leaks, by customer and by terms, and threshold estimates.
| Parameter | Type | Description |
|---|---|---|
orders * | string | Orders under --root (ERP or e-commerce export): order, customer, shipment id, order value, freight charged to the customer, freight terms, and freight cost if you have it per order |
alternatives | array | Other thresholds to estimate, for comparison |
costs | string | Optional freight cost per shipment (shipment id, cost); shared shipments are split across their orders by value |
max_freight_pct | number | Flag orders whose freight is more than this percent of order value and not fully charged (default 10) |
threshold | number | Your free-shipping threshold in order value, if you have one |
margins_write_report Write the freight recovery report
[ALLOW] Write margins.csv and .html (one row per order; by customer; by terms; threshold estimates) into out_dir (default fairhaul-out/margins).
| Parameter | Type | Description |
|---|---|---|
orders * | string | Orders under --root (ERP or e-commerce export): order, customer, shipment id, order value, freight charged to the customer, freight terms, and freight cost if you have it per order |
alternatives | array | Other thresholds to estimate, for comparison |
costs | string | Optional freight cost per shipment (shipment id, cost); shared shipments are split across their orders by value |
max_freight_pct | number | Flag orders whose freight is more than this percent of order value and not fully charged (default 10) |
out_dir | string | Folder under --root for the report (default fairhaul-out/margins) |
threshold | number | Your free-shipping threshold in order value, if you have one |
margins_draft_terms_change Draft a terms change
[ASK] Write drafts/terms_change-<name>.md: the freight recovery gap, policy leaks, the customers losing the most with a proposal to decide, and the free-shipping threshold estimates. Marked DRAFT. Applying it goes through margins_request_apply (one click); a person changes customer terms.
| Parameter | Type | Description |
|---|---|---|
orders * | string | Orders under --root (ERP or e-commerce export): order, customer, shipment id, order value, freight charged to the customer, freight terms, and freight cost if you have it per order |
alternatives | array | Other thresholds to estimate, for comparison |
costs | string | Optional freight cost per shipment (shipment id, cost); shared shipments are split across their orders by value |
from | string | Your name |
max_freight_pct | number | Flag orders whose freight is more than this percent of order value and not fully charged (default 10) |
name | string | Name for this review (default freight-terms) |
out_dir | string | Folder under --root for the files this writes (default fairhaul-out/margins). |
threshold | number | Your free-shipping threshold in order value, if you have one |
to | string | Sales or pricing owner |
top | integer | How many customers to list (default 5) |
margins_request_apply Approve the terms change (one click)
[ASK · production_deploy] After one named human click (even in Auto), record that the reviewed terms change draft is approved in terms_change-requests.csv. Tied to draft_sha256; refuses while open markers remain unless accept_open_issues is true with a note. Your sales or pricing owner acts on it; the agent never does.
| Parameter | Type | Description |
|---|---|---|
draft * | string | Draft path returned by the draft tool |
draft_sha256 * | string | sha256 returned by the draft tool |
accept_open_issues | boolean | Set true, together with a note, to go ahead while open markers or issues remain. Default false (refused while any remain). |
note | string | Why it is fine to go ahead with open issues; required when accept_open_issues is true. Kept in the audit log. |
out_dir | string | Folder under --root for the files this writes (default fairhaul-out/margins). |
to | string | Who it goes to; must match the draft when the draft names someone |
erp_update_customer_terms Erp update customer terms
[BLOCK · production_deploy] Listed so agents can see it is refused. Fairhaul Freight Margins never changes customer freight terms or prices.
ar_rebill_freight Ar rebill freight
[BLOCK · move_money] Listed so agents can see it is refused. Fairhaul Freight Margins never invoices customers for freight.