Fairhaul Freight Margins

v0.1.0
io.github.fpavia111-creator/fairhaul-freight-margins Checked 2 days ago Published 5 days ago

Compares 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.

ParameterTypeDescription
path *stringA CSV, TSV, Excel .xlsx, JSON or JSONL file under the root
asstringSource kind to read it as (default: every kind this agent declares, best match first)
sheetstring | integerExcel 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.

ParameterTypeDescription
orders *stringOrders 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
alternativesarrayOther thresholds to estimate, for comparison
costsstringOptional freight cost per shipment (shipment id, cost); shared shipments are split across their orders by value
max_freight_pctnumberFlag orders whose freight is more than this percent of order value and not fully charged (default 10)
thresholdnumberYour 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).

ParameterTypeDescription
orders *stringOrders 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
alternativesarrayOther thresholds to estimate, for comparison
costsstringOptional freight cost per shipment (shipment id, cost); shared shipments are split across their orders by value
max_freight_pctnumberFlag orders whose freight is more than this percent of order value and not fully charged (default 10)
out_dirstringFolder under --root for the report (default fairhaul-out/margins)
thresholdnumberYour 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.

ParameterTypeDescription
orders *stringOrders 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
alternativesarrayOther thresholds to estimate, for comparison
costsstringOptional freight cost per shipment (shipment id, cost); shared shipments are split across their orders by value
fromstringYour name
max_freight_pctnumberFlag orders whose freight is more than this percent of order value and not fully charged (default 10)
namestringName for this review (default freight-terms)
out_dirstringFolder under --root for the files this writes (default fairhaul-out/margins).
thresholdnumberYour free-shipping threshold in order value, if you have one
tostringSales or pricing owner
topintegerHow 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.

ParameterTypeDescription
draft *stringDraft path returned by the draft tool
draft_sha256 *stringsha256 returned by the draft tool
accept_open_issuesbooleanSet true, together with a note, to go ahead while open markers or issues remain. Default false (refused while any remain).
notestringWhy it is fine to go ahead with open issues; required when accept_open_issues is true. Kept in the audit log.
out_dirstringFolder under --root for the files this writes (default fairhaul-out/margins).
tostringWho 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.