Skip to content

Commit 3cfde8c

Browse files
ZvonimirZvonimir
authored andcommitted
updates
1 parent 89d0ec2 commit 3cfde8c

3 files changed

Lines changed: 592 additions & 177 deletions

File tree

packages/plugin-epcis/docs/EPCIS-Integration-Guide.md

Lines changed: 87 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@ This integration bridges **GS1 EPCIS 2.0** (Electronic Product Code Information
5050
└──────────────┬──────────────────────────────┬───────────────────────┘
5151
│ HTTP API │ MCP Tools
5252
│ POST /epcis/capture │ epcis-query
53-
│ GET /epcis/events │ epcis-track-item
53+
│ GET /epcis/capture/:captureID │ epcis-track-item
54+
│ GET /epcis/events │ epcis-capture
55+
│ GET /epcis/events/track │ epcis-capture-status
5456
▼ ▼
5557
┌─────────────────────────────────────────────────────────────────────┐
5658
│ EPCIS Plugin │
@@ -741,9 +743,40 @@ Query EPCIS events from the DKG using SPARQL.
741743

742744
---
743745

746+
### GET `/epcis/events/track`
747+
748+
Track a single EPC through its full supply chain journey. This endpoint always performs a full-trace query across all EPC-relevant fields.
749+
750+
**Query Parameters:**
751+
752+
| Parameter | Type | Required | Description |
753+
| --------- | ------ | -------- | ----------------------------------------- |
754+
| `epc` | string | **Yes** | EPC identifier to track across all events |
755+
756+
**Response:**
757+
758+
```json
759+
{
760+
"success": true,
761+
"results": [
762+
/* array of matching events for the EPC */
763+
],
764+
"count": 3
765+
}
766+
```
767+
768+
**Error Responses:**
769+
770+
| Status | When | Description |
771+
| ----------------------------- | --------------------- | ---------------------------------- |
772+
| **400 Bad Request** | Missing/invalid `epc` | Query validation failed |
773+
| **500 Internal Server Error** | DKG query failed | Failed to execute full-trace query |
774+
775+
---
776+
744777
## 11. MCP Tools Reference
745778

746-
The EPCIS plugin exposes two MCP (Model Context Protocol) tools that AI agents can use to query supply chain data from the DKG.
779+
The EPCIS plugin exposes four MCP (Model Context Protocol) tools that AI agents can use to capture, query, and track EPCIS supply chain data.
747780

748781
### `epcis-query` — Query EPCIS Events
749782

@@ -806,6 +839,55 @@ Journey Timeline:
806839

807840
---
808841

842+
### `epcis-capture` — Capture EPCIS Document
843+
844+
Validates an EPCIS document and queues it for publishing via the DKG publisher service.
845+
846+
**Input Schema:**
847+
848+
| Parameter | Type | Required | Description |
849+
| ---------------- | ------ | -------- | -------------------------------------------------- |
850+
| `epcisDocument` | object | **Yes** | EPCIS 2.0 JSON-LD document |
851+
| `publishOptions` | object | No | Optional publishing settings (`privacy`, `epochs`) |
852+
853+
**Success Response includes:**
854+
855+
- `captureID` (publisher tracking ID)
856+
- `requestId` (plugin-generated request ID)
857+
- `receivedAt` timestamp
858+
- `eventCount`
859+
860+
**Error cases:**
861+
862+
- Validation error (`Invalid EPCISDocument`, empty events)
863+
- Publisher unavailable error
864+
865+
---
866+
867+
### `epcis-capture-status` — Get Capture Status
868+
869+
Checks the publisher-tracked status for a capture request by numeric `captureID`.
870+
871+
**Input Schema:**
872+
873+
| Parameter | Type | Required | Description |
874+
| ----------- | ------ | -------- | ----------------------------------------------------------------- |
875+
| `captureID` | string | **Yes** | Numeric capture ID (`^[0-9]{1,20}$`) returned by capture handlers |
876+
877+
**Success Response includes:**
878+
879+
- `status`
880+
- `captureID`
881+
- Optional `UAL`, `publishedAt`, and `error`
882+
883+
**Error cases:**
884+
885+
- Capture not found
886+
- Publisher timeout
887+
- Upstream status lookup failure
888+
889+
---
890+
809891
## 12. Query Examples
810892

811893
### Track All Events for a Product
@@ -1150,7 +1232,7 @@ Event 9: Ship (shipping, in_transit) @ Shipping Dock
11501232
| `Invalid captureID format` | captureID not numeric (must match `^[0-9]{1,20}$`) | Use the numeric ID from capture response |
11511233
| `Capture not found` (404) | Unknown captureID | Verify the ID exists in the publisher |
11521234
| `Publisher timeout` (504) | Publisher service did not respond | Publisher service may be overloaded; retry later |
1153-
| `Something went wrong with publishing` (500) | Publisher unreachable after 3 retries | Check that `EXPO_PUBLIC_MCP_URL` is set and the publisher is running |
1235+
| `Something went wrong with publishing` (500) | Publisher unreachable after 3 retries | Check that `EXPO_PUBLIC_MCP_URL` is set and the publisher is running |
11541236
| `At least one filter parameter is required` | Query with no filters | Provide at least one of: `epc`, `from`, `to`, `bizStep`, `bizLocation`, `parentID`, `childEPC`, `inputEPC`, `outputEPC` |
11551237
| `Parameter 'to' must be >= 'from'` | Invalid date range | Ensure `to` date is not before `from` date |
11561238
| `Parameter 'x' cannot be empty` | Empty string query parameter | Provide a value or omit the parameter entirely |
@@ -1166,8 +1248,8 @@ The system validates against the official GS1 EPCIS 2.0 JSON Schema. Common issu
11661248

11671249
### Environment Variables
11681250

1169-
| Variable | Required | Description |
1170-
| -------------------- | -------- | --------------------------------------------------------------------- |
1251+
| Variable | Required | Description |
1252+
| --------------------- | -------- | --------------------------------------------------------------------- |
11711253
| `EXPO_PUBLIC_MCP_URL` | Yes | Base URL of the DKG publisher service (e.g., `http://localhost:9200`) |
11721254

11731255
### Checking System Health

0 commit comments

Comments
 (0)