Skip to main content

MCP tools

cmd/mcp (ADR 0007) is the read-only MCP server of the context: Streamable HTTP only (no stdio, no SSE), on MCP_ADDR (default :8090) at /mcp and /, plus GET /healthz. In the cluster it is the Service delivery-promise-mcp:8090, exposed through Kong at /api/mcp/delivery-promise (rewritten to /mcp); warehouse-ops-agent is configured with http://delivery-promise-mcp.warehouse-systems.svc.cluster.local:8090/mcp. It drives the same use cases as the REST GET routes and the safe POST /delivery-estimates (ADR 0019), writes nothing (no outbox, no consumer, no sweeper, never dials Kafka) and carries no authentication; the in-cluster ClusterIP boundary is the access control.

The list below is the output of a live tools/list against the binary built from this branch (server delivery-promise-mcp 1.0.0, protocol 2025-03-26, capabilities tools with listChanged). Every tool carries the annotations readOnlyHint: true, idempotentHint: true, openWorldHint: false, the _meta authority com.warehouse/authority: "L1" (Agentic Standard v2, ADR 0013: every tool of this context is a pure read, so every level is L1), and additionalProperties: false on its input. TestToolSurface, TestWriteVerbSensorFailsOnWriteNames, TestEveryAgentToolDeclaresAuthority and TestToolRegistryGolden (internal/adapters/inbound/mcp) pin the surface and refuse any write verb or missing authority.

ToolAccessAuthorityInput fieldsReads (REST equivalent)
estimate_deliveryread-onlyL1destinationPostalPrefix (string, required), items (1-50 of catalogItemId, quantity 1-999, required), tiers (optional)POST /delivery-estimates (stores nothing)
get_current_policyread-onlyL1noneGET /promise-policies/current
get_delivery_offerread-onlyL1offerId (string, required)GET /delivery-offers/{offerId}
get_promiseread-onlyL1promiseId (string, required)GET /promises/{promiseId}
list_promise_booksread-onlyL1nodeId (string, required), date (string YYYY-MM-DD, required)GET /promise-books?nodeId=&date=
list_promises_by_orderread-onlyL1orderId (string, required)GET /promises?orderId=

Tools in detail​

estimate_delivery​

The listing-page estimate of ADR 0019: for up to 50 items and one destination postal prefix, per item and in request order, the best option of every requested tier (tier, window start/end with the station's IANA timeZone, basis, the optional calibrated confidence, orderByAt, and the optional capacityBand AMPLE, TIGHT or SCARCE, the pressure on the capacity book behind that window (ADR 0023: omitted when unknown, a signal only, the network never computes a fee) and the constraints of the tiers without one (DESTINATION_NOT_SERVED and ITEM_QUANTITY_NOT_AVAILABLE once per item without a tier, the others per tier). Each item is searched like a one-line quote, but nothing is stored: no offer, no event, no hold. An estimate is advisory and never reserves capacity. An unknown item is a constraint, not an error; a bad prefix, tier or quantity, a duplicate item or more than 50 items fails with validation-failed. tiers is the only optional argument of this server (the four classic tiers when omitted); CONSOLIDATED is quoted on REST and an estimate refuses it (ADR 0024). Output keys: computedAt, destinationPostalPrefix, estimates.

get_current_policy​

Reads the current promise policy: policyVersion (v0 is the built-in default when nothing was published), offerTtlMinutes, holdTtlMinutes, packagesPerOrder, capacitySharePercent, the measured-transit parameters transitWindowDays, transitServiceLevelPercent and minTransitObservations (ADR 0014), the calibration parameters targetOnTimeProbabilityPercent, minCalibrationObservations, calibrationWindowDays and maxCalibrationBufferMinutes (ADR 0020) and the per-tier orderDeadlines (tier, optional regionId, localTime in the destination region's time zone). Output keys: policyVersion, version, offerTtlMinutes, holdTtlMinutes, packagesPerOrder, capacitySharePercent, transitWindowDays, transitServiceLevelPercent, minTransitObservations, targetOnTimeProbabilityPercent, minCalibrationObservations, calibrationWindowDays, maxCalibrationBufferMinutes, orderDeadlines, publishedAt. Publishing a policy is a REST operation.

get_delivery_offer​

Reads one offer in any state (QUOTED, EXPIRED, CONSUMED): tier, groupNo, destination postal prefix, lines, the delivery window (earliest, latest and the station's IANA timeZone), the witnessPath (node, pickup departure, legs, delivery wave), basis (SCHEDULED, MEASURED when a lane's measured transit pushed the arrival later, or NOMINAL), the optional confidence (0 to 1, the calibrated probability that the quote is kept on time; absent means unknown, not zero), for a CONSOLIDATED offer the optional consolidationEligible (ADR 0024), policyVersion, quotedAt and expiresAt. Offers are kept for a retention period after they expire. An unknown offer fails with not-found. Input: offerId, the id returned by the quote, for example off-1.

get_promise​

Reads one promise in any state (PROVISIONAL, CONFIRMED, AT_RISK, KEPT, BROKEN, RELEASED, CANCELLED): terms (tier, shipBy, deliverByEarliest, deliverByLatest, timeZone, basis, the optional confidence, policyVersion, and for a CONSOLIDATED promise the optional consolidationEligible), witnessPath, holdExpiresAt, the revisions that moved it and the final judgement (outcome, cause, lateByMinutes). A promise is never deleted. Output keys: promiseId, offerId, orderId, groupNo, state, destinationPostalPrefix, lines, terms, witnessPath, holdExpiresAt, revisions, judgement, atRiskReason, cancelReason, releaseReason, version. Unknown promise: not-found. Input: promiseId, for example prm-1.

list_promise_books​

Lists the capacity books of one node whose pickup cutoff falls on one date (YYYY-MM-DD in the node's own time zone), ordered by cutoffAt: one book per cutoff (bookId is nodeId:pickupDepartureId), its OPEN or CLOSED state and its capacity (share, provisional, confirmed). A malformed node id or date fails with validation-failed. Output: items.

list_promises_by_order​

Lists the promises of one customer order, one per shipment group, ordered by groupNo, in the same shape as get_promise. Only CONFIRMED promises belong to an order, so this is the checkout view of what was promised. A malformed order id fails with validation-failed. Output: items.

Calling them​

The handler is stateless (Agentic Standard v2, AS-4, ADR 0013): it issues no Mcp-Session-Id and answers the 2026-07-28 revision's per-request handshake — a raw POST with MCP-Protocol-Version: 2026-07-28 and Mcp-Method: server/discover returns supportedVersions without any initialize. A legacy initialize (2025-06-18 and older) still answers 200, so session-based clients keep working; requests must accept both application/json and text/event-stream. A captured get_current_policy call and its structured result are on the Quickstart. The optional inputs of the registry carry omitempty so they stay optional in the schema (TestMCPOptionalToolInputsCarryOmitempty); every input listed above is required except estimate_delivery's tiers.

Resource​

promise://books/{nodeId}/{date} (MIME application/json, ADR 0013): the capacity ledger of one node's pickup cutoffs on one date — the same bounded read model as list_promise_books and GET /promise-books, as JSON text ({nodeId, date, items}). Listed via resources/templates/list; the URI segments are model-supplied and a malformed URI is rejected.

Prompt​

check_order_promises (ADR 0013) is the operator SOP: how to judge whether an order's promises are intact — list them, read states and judgements, consult the node's books, escalate what is AT_RISK or BROKEN. It names tools but calls none, and takes no arguments.

The server's instructions string tells a client that nothing here changes data: quoting and the promise lifecycle are REST operations driven by checkout, and the policy is published over REST too. The A2A agent offers the same reads as goal-shaped skills, see the API overview.