API surface
warehouse-ops-agent has no apis/openapi.yaml — its surface is small
enough that it is documented here in prose rather than generated. Every
route is a GET (CORS therefore allows only GET and the OPTIONS preflight,
for the origins in CORS_ALLOWED_ORIGINS), and neither surface is authenticated (see
ADR 0006). This page is kept current
by hand; if it drifts from internal/adapters/inbound/, the code is
authoritative.
REST (internal/adapters/inbound/http)
| Method & path | What it returns |
|---|---|
GET /healthz | {"status": "ok"} |
GET /daily-brief | The full synthesized DailyBrief: every monitored site's paths (the DAILY_BRIEF_PATH_TARGETS set: unset = built-in default target; unparseable JSON or an empty [] fails startup with a config error naming the variable, ADR 0017) with backlog/staffing/queue/stuck-task facts, plus ranked openExceptions. When WAREHOUSE_PLANNING_MCP_ENDPOINT is set, each path also carries an optional capacityOutlook (ADR 0013): normalizedRate (ORDER/hour), bottleneckStep, bindingConstraint, per-step steps, planning's warnings, over [windowStart, windowEnd) (CAPACITY_OUTLOOK_HORIZON, default 8h) — or only omittedReason when it could not be produced (path has no planningPathId, planning unreachable, no covering capacity window, …). The key is absent when planning is not configured; the section never fails the brief and never changes openExceptions. When SLOTTING_OPTIMIZATION_MCP_ENDPOINT is set the brief also carries one slotPlanWatch section, and when ORDER_MANAGEMENT_MCP_ENDPOINT is set one promiseHealth section (ADR 0024); both are fail-open (explicit unavailable lines, never a failed brief) and absent when unconfigured — see the HTTP routes page for their shapes. |
GET /flow-balance/{pathId}?buildingId=&shiftId= | The E1 FlowBalanceException correlation for one path; buildingId and shiftId are both REQUIRED (blank counts as missing) and scope the workforce-management staffing-gap lookup; 400 naming the missing parameter, before any upstream is asked. Optionally arbitrated by the ADR-0004 LLM reasoner (LLM_MODE) and enriched with the ADR-0008 labor-utilization correlation. 400 on a missing parameter or other use-case error; 503 if the use case isn't wired, which happens when FACILITY_LAYOUT_MCP_ENDPOINT is unset (ADR 0023). |
GET /explain-travel-factor?pathId=&fromLocationCode=&toLocationCode= | Calls facility-layout's estimate_travel_distance for the two REQUIRED, caller-supplied location codes and classifies the result (travel_significant/travel_negligible) against the ADR-0009 threshold. 400 if either location code is missing, or if facility-layout rejects the codes with a validation slug in its tool error (malformed-*, invalid-*, *-required, validation-failed, missing-location-code; fleet convention <slug>: <detail>, ADR 0018); 502 if facility-layout is unreachable or the call fails for any other reason — not-found, internal-error, any other slug, or slug-less text from an older facility-layout (an upstream degradation, not a caller error); 503 if the use case isn't wired. This agent never infers the two location codes itself — see ADR 0009. |
GET /console/orders/{id}/lifecycle | The console-bff read model (see ADR 0002): fans out to order-management, inventory-storage, wes-work-planning, and fulfillment-execution and stitches one order's cross-service lifecycle for warehouse-console's Order Lifecycle screen. Each stage degrades independently — one context being unreachable (including order-management itself, apart from a 404) leaves that stage null in a 200 response; there is no 502 path. 404 if order-management reports the order does not exist. |
GET /console/reports/wms?from=&to= | The console-bff WMS dashboard (ADR 0003): three sections — order-funnel (order-management /reports/funnel), inventory-flow-accuracy (inventory-storage /reports/flow-accuracy), catalog-growth (facility-layout /reports/catalog-growth) — each read from that context's separate *-reports binary together with its /freshness lag. from/to are optional RFC3339 timestamps (default: trailing 24 h); 400 if either is malformed or to is not after from. Each section degrades independently (available: false + error). |
GET /console/reports/wes?from=&to= | The console-bff WES dashboard: planning-throughput (wes-work-planning /reports/throughput), fulfillment-throughput (fulfillment-execution /reports/throughput), labor-management (workforce-management /reports/labor), labor-performance (labor-performance /reports/performance). Same window, validation and per-section degradation as the WMS dashboard. |
GET /runtime-signals | Per-service runtime health over a 10-minute window for the services in RUNTIME_SIGNALS_SERVICES; unset, it defaults to eight backend contexts (order-management, inventory-storage, wes-work-planning, fulfillment-execution, workforce-management, facility-layout, labor-performance, process-path-management; product-master, warehouse-planning and the network contexts are not in the default). Measures: Istio 5xx error rate (istio_requests_total) and p99 latency (istio_request_duration_milliseconds_bucket) from Prometheus, plus error/fatal log-line counts from Loki ({namespace="warehouse-systems"}). Classified by policy.ClassifyErrorRate (warning ≥ 1%, critical ≥ 5%) and policy.ClassifyLatencyP99 (warning ≥ 1000 ms, critical ≥ 3000 ms); any recent error log lifts a service to at least warning. A failing Prometheus or Loki query, or an unset LOKI_URL, is listed in unavailableSources (prometheus, loki) instead of failing the request; an unset PROMETHEUS_URL uses a no-op stub reader, so its metrics read as zero rather than unavailable. 503 if the use case isn't wired. |
GET /master-data-gaps?kind=&cursor= | product-master products whose master data is missing or contradictory (ADR 0020): unclassified (no handling classification) and dimension-discrepancy (product-master's own flag; declared/measured dimensions, measuredAt, deviceId echoed). Body: scanned, complete, nextCursor (when the 5,000-product per-request bound was hit), unclassifiedCount, dimensionDiscrepancyCount, gaps[] (sku, description, version, kinds, rationale). Both params optional: kind is unclassified or dimension-discrepancy, cursor resumes an incomplete scan. 400 for an unknown kind or a cursor product-master rejects; 502 if product-master fails; 503 when PRODUCT_MASTER_MCP_ENDPOINT is unset (warehouse-infra sets it in the kind cluster). |
GET /inbound-outlook | The inbound dock side's near-term picture read from inbound-receiving (ADR 0021); no parameters. Body: generatedAt, appointmentsUntil (+24 h), dayFrom/dayTo (today, agent-local), staleAfterSeconds (absent when INBOUND_STALE_RECEIPT_AGE is unset), and four sections awaitingAsns (Registered ASNs, overdue when their own expected arrival has passed), upcomingAppointments (Booked/CheckedIn in the next 24 h), staleReceipts (Open longer than the configured age, openForSeconds), discrepantReceipts (closed today with discrepancy lines). Every section is {omitted?, complete, count, items[]}: omitted is why it is missing (an upstream failure, or the stale age not configured) and means unknown, not none; complete: false means the 5,000-record scan bound was hit. 502 only when every attempted section failed; 503 when INBOUND_RECEIVING_MCP_ENDPOINT is unset. |
GET /transfer-watch/stuck?olderThanMinutes=&state=&limit=, GET /transfer-watch/transfers/{id}, GET /transfer-watch/imbalance | The network-inventory-planning transfer watch (ADR 0019): stuck transfers triaged by saga state (olderThanMinutes required and positive, no default), one transfer's status, and short sites from NIP's own capacity headroom. 400 caller input, 404 unknown transfer, 502 other upstream failure, 503 when NETWORK_INVENTORY_PLANNING_MCP_ENDPOINT is unset. |
MCP (internal/adapters/inbound/mcp)
This agent runs its own MCP server (Streamable HTTP, unauthenticated — see ADR 0006) so that an agentic host can consume its recommendations the same way it consumes any bounded context's facts.
| Tool | What it does |
|---|---|
get_daily_brief | Returns the full synthesized DailyBrief (including the optional per-path capacityOutlook, as on GET /daily-brief). |
list_open_exceptions | Lists open exceptions, optionally filtered to a minimum severity (info/warning/critical). An unrecognized severity value is rejected, never silently defaulted. |
get_flow_balance_exception | Correlates the E1 signals for one pathId (+ buildingId/shiftId, all three required, for the staffing lookup) into a ranked FlowBalanceException; a blank value is a tool error naming the missing argument. |
explain_travel_factor | Calls facility-layout's estimate_travel_distance for two REQUIRED, caller-supplied location codes (fromLocationCode/toLocationCode) and classifies the result. The caller must already know both codes — this tool never infers or guesses them (see ADR 0009). |
detect_stranded_reservation | The E2 StrandedReservationException use case: correlates fulfillment-execution's diagnose_stuck_tasks expired/expiring leases for a taskType with inventory-storage's check_availability usable-stock shortfall for one sku. Only ever recommends revoke_reservation alongside its mandatory blast radius (get_bin_occupancy, requiring both reservationId and binId) — never on partial evidence; degrades to hold otherwise. This tool never calls inventory-storage's revoke_reservation write tool itself. |
find_master_data_gaps | Same report as GET /master-data-gaps (optional kind, cursor); registered only when PRODUCT_MASTER_MCP_ENDPOINT is set. An unknown kind is a tool error, never defaulted. It only reports: it never classifies, declares or measures (ADR 0020). |
get_inbound_outlook | Same outlook as GET /inbound-outlook, no arguments; registered only when INBOUND_RECEIVING_MCP_ENDPOINT is set, ReadOnlyHint: true. A tool error only when every section failed. It only reports: it never registers, books, receives or closes anything (ADR 0021). |
triage_stuck_transfers, get_transfer_status, explain_network_imbalance | The transfer watch, same answers as GET /transfer-watch/*; registered only when NETWORK_INVENTORY_PLANNING_MCP_ENDPOINT is set (internal/adapters/inbound/mcp/transfer_watch.go, ADR 0019). |
Every tool is annotated read-only
(mcp.ToolAnnotations{ReadOnlyHint: true}). This agent has zero write
tools — see the Governance note for why that
is a design choice, not an oversight. Its single write is not a tool: the
human-confirmed release_next_work act slice
(ADR 0027) exists only
as two opt-in REST routes (POST /act/release-next-work/proposals and
/approvals, see the HTTP routes page), deliberately
unreachable from MCP and from the LLM. The propose response also carries an
advisory, read-only exceptionContext asked of exception-management over A2A
(ADR 0028);
it never changes the minting decision and is not an MCP tool either.
The agent's second human-gated write
(ADR 0029) follows the same
rules: opt-in REST routes POST /labor-reallocation/proposals and
POST /labor-reallocation/proposals/{proposalId}/approve (a ranked list of at
most three moves, each with its own token; approving delegates ONE move to
workforce-management's assign_labor A2A skill), deliberately unreachable from
MCP and from the LLM. The read side is an MCP tool,
labor_reallocation_outlook (authority L2): the same ranking with no token and
no write path.
What is not yet exposed
order-management's outbound MCP client
(ADR 0024)
is consumed through get_promise_health (the daily brief's promise-health
section); get_order stays published by order-management but is not wired
here — no use case of this agent calls it. The process-path-management
client was removed entirely (ADR 0024, gap A9): catalogue configuration is
not an ops signal. slotting-optimization's client (same ADR) is consumed
through get_slot_plan and list_slot_plans (the daily brief's
slot-plan watch); get_forward_slots and get_sku_velocity are
deliberately not wired.
warehouse-planning's outbound client
(ADR 0013)
is consumed only through get_process_path_capacity (the daily brief's
capacity outlook); its other read tools are deliberately not wired
(Phase 5.4: a client method no use case calls is removed, so the client
carries no unconsumed tool).
Its MCP server is read+write; this agent calls read tools only.
product-master's outbound client
(ADR 0020)
is consumed only through list_products (the master-data gaps report);
get_product, get_product_classification, get_physical_profile,
get_pack_levels and resolve_gtin are deliberately not wired, and its two
pack-level write tools (declare_pack_level, retire_pack_level) are never
called. The client's DTOs are still contract-tested against product-master's
published registry (all eight tools pinned).
inbound-receiving's outbound client
(ADR 0021)
is consumed only through list_asns, list_appointments and list_receipts
(the inbound outlook); get_asn, get_appointment, get_receipt and
list_docks are deliberately not wired (Phase 5.4). The client's DTOs are
still contract-tested against inbound-receiving's published registry.
inbound-receiving's MCP server is read-only.