MCP tools
cmd/mcp is a separate binary that serves the
Model Context Protocol over Streamable
HTTP only, on MCP_ADDR (default :8090). The handler is mounted at /,
/mcp and /mcp/; GET /healthz answers {"status":"ok"} for the probes.
None of these routes are in apis/openapi.yaml. The server is
unauthenticated, like the rest of the fleet
(ADR 0005), and identifies itself as
process-path-management-mcp version 1.0.0
(internal/adapters/inbound/mcp/server.go).
Every tool is read-only. There is no write tool: paths and CPT schedules change only through the REST API. The rules for adding a tool are in the Governance charter (ADR 0006, ADR 0023).
Tool list
The schemas below are the server's own tools/list answer, captured from
cmd/mcp running in memory with REPORTS_BASE_URL set. Every input schema
has additionalProperties: false, so unknown arguments are rejected.
| Tool | Annotations | Authority | Registered when | Use case / backend |
|---|---|---|---|---|
get_process_path | readOnlyHint: true, idempotentHint: false | L1 | always | GetPath over the OLTP store |
list_process_paths | readOnlyHint: true, idempotentHint: false | L1 | always | ListPaths over the OLTP store |
get_cpt_schedule | readOnlyHint: true, idempotentHint: false | L1 | whenever the schedule read port is wired, which cmd/mcp always does | GetCPTSchedule over the OLTP store |
get_process_flow | readOnlyHint: true | L1 | whenever the flow read port (GetProcessFlow) is wired, which cmd/mcp always does | GetProcessFlow over the OLTP store (ADR 0042) |
list_process_flows | readOnlyHint: true | L1 | whenever the flow list port (ListProcessFlows) is wired, which cmd/mcp always does | ListProcessFlows over the OLTP store |
get_catalogue_growth_report | readOnlyHint: true, idempotentHint: false | L1 | only when REPORTS_BASE_URL is set | HTTP GET /reports/catalogue-growth on pathmgmt-reports (10 s client timeout) |
Every tool declares its authority level in its Meta under
com.warehouse/authority (returned in tools/list _meta); the A2A skills
carry the same level as the tag authority:L<n>. All tools here are L1
(reads; the charter is read-only — catalogue changes are REST writes by
humans) and L4 is not granted
(ADR 0041).
Since that ADR the handler is stateless: it answers the 2026-07-28
server/discover per-request handshake while a legacy initialize still
answers 200, and no Mcp-Session-Id is issued. The advertised registry
(including the conditional report tool) is pinned with its authority column
in internal/adapters/inbound/mcp/testdata/tool_registry.golden and checked
for fleet-wide name uniqueness against testdata/fleet_tool_snapshot.golden.
Each call runs inside an OTel span mcp.tool <name> with attribute
mcp.tool.name; a failing call marks the span Error.
get_process_path
| Input | Type | Required | Meaning |
|---|---|---|---|
pathId | string | yes | Canonical process path id, e.g. PICK, PACK, REBIN, SLAM. Empty → error pathId is required. |
Returns one path in any status: pathId, matchPrefix, direct,
requiredCapabilities[], destinationLocationRole (omitted when unset),
status (ACTIVE/DEACTIVATED), active (boolean), createdAt,
updatedAt (RFC 3339), cycleTimeP95 (Go duration string such as
2h0m0s), eligibility (maxUnitsPerLine, requiredProductAttributes,
excludedProductAttributes, nonSortable, each omitted when unset),
intake (the demand sources allowed to route work onto the path:
CUSTOMER_ORDER, STOCK_TRANSFER, SLOT_RELOCATION, INVENTORY_CONTROL,
REPLENISHMENT;
always an array, [] when only an explicit path id reaches it,
ADR 0034).
An unknown id is a tool error (usecases: process path not found), not
an empty success.
list_process_paths
| Input | Type | Required | Meaning |
|---|---|---|---|
activeOnly | boolean or null | no | true or omitted: only Active paths. false: include deactivated ones. |
Returns {"paths": [...]} with the same per-path shape as
get_process_path.
get_cpt_schedule
| Input | Type | Required | Meaning |
|---|---|---|---|
siteId | string | yes | Site id, e.g. sp1. Empty → error siteId is required. |
Returns siteId, timezone (IANA), createdAt, updatedAt and
cutoffs[], each with cptId, localTime (HH:MM), daysOfWeek[]
(Mon…Sun), shipMethod, eligiblePathIds[]. A site with no schedule is
a tool error.
get_process_flow
| Input | Type | Required | Meaning |
|---|---|---|---|
flowId | string | yes | Process flow id, e.g. single-unit-outbound. Empty → error flowId is required. |
Returns one flow in any status: flowId, name, stages[] in order (each
pathId and processType, one of PICK, REBIN, PACK, SLAM,
DISPATCH, ARRIVAL, RELOCATE, REPLENISH), status
(ACTIVE/RETIRED), version, createdAt, updatedAt. An unknown id is a
tool error (usecases: process flow not found). Flows are changed
through REST only (ADR 0042).
list_process_flows
| Input | Type | Required | Meaning |
|---|---|---|---|
activeOnly | boolean or null | no | true or omitted: only ACTIVE flows. false: include retired ones. |
Returns {"flows": [...]} in id order, with the same per-flow shape as
get_process_flow.
get_catalogue_growth_report
| Input | Type | Required in schema | Meaning |
|---|---|---|---|
from | string | yes | Window start, inclusive, RFC 3339. |
to | string | yes | Window end, exclusive, RFC 3339. |
granularity | string | no | Only day is supported, and it is the default. |
Returns {"rows": [...]}, each row with dayBucket, pathsDefined,
pathsRevised, pathsDeactivated: exactly the body of the reports API
(Runbook).
granularity is optional on the wire (gap fix D16): the field carries
omitempty, so the SDK-generated input schema requires only from and
to; the handler forwards granularity only when non-empty and the
reports API defaults to day. The architecture fitness test
TestMCPOptionalToolInputsCarryOmitempty fails the build when an input
field described as optional lacks omitempty. Missing from/to → error
from and to are required (RFC3339); a non-2xx from the reports service →
reports client: unexpected status <code>.
The reports client also implements a freshness call
(GET /reports/catalogue-growth/freshness), but no tool exposes it.
Resource templates
| URI template | MIME type | Backing |
|---|---|---|
warehouse://process-path-management/paths/{pathId} | application/json | GetPath — the same read model as the get_process_path tool |
Reading a concrete URI (e.g.
warehouse://process-path-management/paths/PICK) returns exactly one
bounded path definition (the tool's own output shape) as JSON text; a
deactivated path is readable too, and an unknown pathId — or a URI
outside the warehouse://process-path-management/ namespace — is a
resource error, never an empty success. This is a scoped read model, not
a catalogue dump: use list_process_paths for the list view.
Prompts
| Prompt | Arguments | Purpose |
|---|---|---|
review_path_definition | pathId (string, required), siteId (string, optional) | The operator SOP for auditing one catalogue entry |
The prompt hands the model the standard procedure: read the path
definition (resource or get_process_path), check matchPrefix /
requiredCapabilities / intake consistency, verify the site's CPT
cutoffs (get_cpt_schedule) reference existing paths, and escalate any
correction to the REST surface — the prompt names tools but never calls
them, and performs no writes.
Talking to the server by hand
go run ./cmd/mcp # or port-forward svc/<release>-mcp 8090
curl -si localhost:8090/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"curl","version":"0"}}}'
# 200, text/event-stream; the handler is stateless, so NO Mcp-Session-Id
# is issued and no session header is needed on later calls
curl -s localhost:8090/mcp \
-H 'Content-Type: application/json' \
-H 'Accept: application/json, text/event-stream' \
-H 'Mcp-Protocol-Version: 2025-06-18' \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"list_process_paths","arguments":{"activeOnly":false}}}'
A 2026-07-28 client skips initialize entirely: it sends headers
MCP-Protocol-Version: 2026-07-28 and Mcp-Method: <method> and carries
_meta: {"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientCapabilities":{}}
in the params (server/discover answers the supported versions).
The handler is stateless (ADR 0041):
no session or cross-call state lives in the process, so nothing keeps the
chart's mcp.replicaCount pinned to 1 any more (the chart itself is
unchanged by that ADR).
Who calls it
warehouse-ops-agent has a client for get_process_path and
list_process_paths, constructed but unused today. No sibling calls
get_cpt_schedule or get_catalogue_growth_report. See
Integration.