@fluentcommerce/fluent-mcp-extn 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +176 -174
- package/dist/batch-tools.js +21 -21
- package/dist/cache-tools.js +5 -5
- package/dist/config.js +1 -1
- package/dist/entity-tools.js +16 -16
- package/dist/environment-tools.js +10 -10
- package/dist/event-tools.js +26 -26
- package/dist/fluent-client.js +20 -0
- package/dist/graphql-query-tools.js +15 -15
- package/dist/graphql-schema-tools.js +14 -14
- package/dist/metrics-tools.js +40 -40
- package/dist/profile-registry.js +2 -2
- package/dist/response-shaper.js +1 -1
- package/dist/settings-tools.js +9 -9
- package/dist/test-tools.js +4 -4
- package/dist/tools.js +153 -148
- package/dist/workflow-tools.js +34 -44
- package/docs/E2E_TESTING.md +59 -59
- package/docs/HANDOVER_GITHUB_COPILOT.md +9 -9
- package/docs/HANDOVER_GITHUB_REPO_MCP_CONFIG.example.json +12 -12
- package/docs/RUNBOOK.md +38 -38
- package/docs/TOOL_REFERENCE.md +296 -296
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -13,13 +13,15 @@
|
|
|
13
13
|
|
|
14
14
|
MCP ([Model Context Protocol](https://modelcontextprotocol.io)) extension server for [Fluent Commerce](https://fluentcommerce.com).
|
|
15
15
|
|
|
16
|
-
Exposes 59 Fluent Commerce MCP tools for event forensics, workflow transitions, GraphQL execution and planning, batch ingestion plus payload planning, entity CRUD plus mutation planning, metrics, time-window resolution, settings,
|
|
16
|
+
Exposes 59 Fluent Commerce MCP tools for event forensics, workflow transitions, GraphQL execution and planning, batch ingestion plus payload planning, entity CRUD plus mutation planning, metrics, time-window resolution, settings, workflow management, environment discovery, and test automation — powered by [`@fluentcommerce/fc-connect-sdk`](https://www.npmjs.com/package/@fluentcommerce/fc-connect-sdk).
|
|
17
17
|
|
|
18
18
|
**What this does:** This server runs as a background process inside your AI coding assistant (Claude Code, Cursor, VS Code Copilot, Windsurf, etc.). It gives the AI direct, authenticated access to Fluent Commerce APIs plus read-only planning and scaffolding helpers, so it can inspect schemas, plan GraphQL/entity/batch requests, execute the right call, and keep large responses summarized before they hit model context.
|
|
19
19
|
|
|
20
|
+
**Tool naming note:** canonical tool names use underscore form such as `health_ping` and `graphql_query`. This is a compatibility choice for stricter MCP clients, not a requirement of the MCP spec. The server still accepts legacy dotted calls such as `health.ping` for backward compatibility.
|
|
21
|
+
|
|
20
22
|
---
|
|
21
23
|
|
|
22
|
-
> **Already using [`@fluentcommerce/ai-skills`](https://www.npmjs.com/package/@fluentcommerce/ai-skills)?** You're already set up — `ai-skills install --profile` auto-configures this server in your `.mcp.json`. Skip to [Verify connection](#3-verify-connection) or [Tools (59)](#tools-59) to see what's available.
|
|
24
|
+
> **Already using [`@fluentcommerce/ai-skills`](https://www.npmjs.com/package/@fluentcommerce/ai-skills)?** You're already set up — `ai-skills install --profile` auto-configures this server in your `.mcp.json`. Skip to [Verify connection](#3-verify-connection) or [Tools (59)](#tools-59) to see what's available.
|
|
23
25
|
|
|
24
26
|
---
|
|
25
27
|
|
|
@@ -27,7 +29,7 @@ Exposes 59 Fluent Commerce MCP tools for event forensics, workflow transitions,
|
|
|
27
29
|
|
|
28
30
|
- [Quick Start](#quick-start)
|
|
29
31
|
- [Why This Extension](#why-this-extension)
|
|
30
|
-
- [Tools (59)](#tools-59)
|
|
32
|
+
- [Tools (59)](#tools-59)
|
|
31
33
|
- [Configuration](#configuration)
|
|
32
34
|
- [Error Handling](#error-handling)
|
|
33
35
|
- [Support Scripts](#support-scripts-debugging-and-validation)
|
|
@@ -42,32 +44,32 @@ The official `fluent mcp server` (bundled with Fluent CLI) covers core GraphQL a
|
|
|
42
44
|
|
|
43
45
|
| Capability | Official MCP | This Extension |
|
|
44
46
|
|---|:---:|:---:|
|
|
45
|
-
| Event dispatch (`
|
|
46
|
-
| Event runtime forensics (`
|
|
47
|
-
| Workflow transitions (`
|
|
48
|
-
| Auto-paginated GraphQL (`
|
|
49
|
-
| GraphQL planning helpers (`
|
|
50
|
-
| Batch mutations (`
|
|
47
|
+
| Event dispatch (`event_build` / `event_send` / `event_list` / `event_get`) | | Yes |
|
|
48
|
+
| Event runtime forensics (`event_flowInspect`) | | Yes |
|
|
49
|
+
| Workflow transitions (`workflow_transitions`) | | Yes |
|
|
50
|
+
| Auto-paginated GraphQL (`graphql_queryAll`) | | Yes |
|
|
51
|
+
| GraphQL planning helpers (`graphql_planOperation` / `graphql_buildQuery` / `graphql_generateFull`) | | Yes |
|
|
52
|
+
| Batch mutations (`graphql_batchMutate`) | | Yes |
|
|
51
53
|
| Batch ingestion (`batch.*`) | | Yes |
|
|
52
|
-
| Batch payload planning (`
|
|
53
|
-
| Prometheus metrics (`
|
|
54
|
-
| Metrics health assessment (`
|
|
55
|
-
| Managed SLO snapshot (`
|
|
56
|
-
| Metric label discovery (`
|
|
57
|
-
| Mutation traffic audit by domain/subdomain (`
|
|
58
|
-
| Natural-language time window resolution (`
|
|
59
|
-
| Event analytics rankings (`
|
|
54
|
+
| Batch payload planning (`batch_describePayload`) | | Yes |
|
|
55
|
+
| Prometheus metrics (`metrics_query`) | | Yes |
|
|
56
|
+
| Metrics health assessment (`metrics_healthCheck`) | | Yes |
|
|
57
|
+
| Managed SLO snapshot (`metrics_sloReport`) | | Yes |
|
|
58
|
+
| Metric label discovery (`metrics_labelCatalog`) | | Yes |
|
|
59
|
+
| Mutation traffic audit by domain/subdomain (`metrics_mutationAudit`) | | Yes |
|
|
60
|
+
| Natural-language time window resolution (`time_resolveWindow`) | | Yes |
|
|
61
|
+
| Event analytics rankings (`metrics_topEvents`) | | Yes |
|
|
60
62
|
| Webhook signature validation | | Yes |
|
|
61
|
-
| Schema introspection (`
|
|
63
|
+
| Schema introspection (`graphql_introspect`) | | Yes |
|
|
62
64
|
| Multi-strategy auth (profile, OAuth, token command, static token) | | Yes |
|
|
63
65
|
| Multi-profile connections (dev/staging/prod simultaneously) | | Yes |
|
|
64
|
-
| Runtime connection management (`
|
|
65
|
-
| Entity CRUD (`
|
|
66
|
-
| Entity mutation planning (`
|
|
67
|
-
| Workflow management (`
|
|
68
|
-
| Settings management (`
|
|
69
|
-
| Environment snapshot (`
|
|
70
|
-
| Test assertions with polling (`
|
|
66
|
+
| Runtime connection management (`connection_add` / `connection_switch` / `connection_remove`) | | Yes |
|
|
67
|
+
| Entity CRUD (`entity_create` / `entity_update` / `entity_get`) | | Yes |
|
|
68
|
+
| Entity mutation planning (`entity_planCreate` / `entity_planUpdate`) | | Yes |
|
|
69
|
+
| Workflow management (`workflow_get` / `workflow_list` / `workflow_upload` / `workflow_diff` / `workflow_simulate`) | | Yes |
|
|
70
|
+
| Settings management (`setting_get` / `setting_upsert` / `setting_bulkUpsert`) | | Yes |
|
|
71
|
+
| Environment snapshot (`environment_discover` / `environment_validate`) | | Yes |
|
|
72
|
+
| Test assertions with polling (`test_assert`) | | Yes |
|
|
71
73
|
|
|
72
74
|
Best practice: run both the official MCP server and this extension together.
|
|
73
75
|
|
|
@@ -243,7 +245,7 @@ This priority is evaluated per connection slot, not once for the whole server. I
|
|
|
243
245
|
|
|
244
246
|
When a tool call includes `profile: "PROD_READONLY"`, it uses that slot's OAuth config. When it includes `profile: "QUICK_TEST"`, it uses that slot's static token config.
|
|
245
247
|
|
|
246
|
-
Runtime-added slots currently support CLI profile auth, explicit OAuth, and explicit static bearer tokens. `TOKEN_COMMAND` remains a startup environment configuration, not a per-slot `
|
|
248
|
+
Runtime-added slots currently support CLI profile auth, explicit OAuth, and explicit static bearer tokens. `TOKEN_COMMAND` remains a startup environment configuration, not a per-slot `connection_add` option.
|
|
247
249
|
|
|
248
250
|
### 2. Restart your IDE
|
|
249
251
|
|
|
@@ -253,26 +255,26 @@ Restart so the MCP client picks up the new server.
|
|
|
253
255
|
|
|
254
256
|
Run these tools in order to confirm everything works:
|
|
255
257
|
|
|
256
|
-
1. `
|
|
257
|
-
2. `
|
|
258
|
-
3. `
|
|
258
|
+
1. `config_validate` — should return `ok: true`
|
|
259
|
+
2. `health_ping` — should return `status: "ok"`
|
|
260
|
+
3. `connection_test` — should return `ok: true` with your user/account details
|
|
259
261
|
|
|
260
262
|
If any returns `ok: false`, see [Troubleshooting](#troubleshooting).
|
|
261
263
|
|
|
262
264
|
### 4. Start with read-only planners
|
|
263
265
|
|
|
264
266
|
```
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
267
|
+
graphql_planOperation → inspect args, variables, and execution strategy
|
|
268
|
+
entity_planCreate → scaffold a create mutation locally
|
|
269
|
+
batch_describePayload → inspect batch row shape before creating a job
|
|
270
|
+
event_build → build a payload (no API call)
|
|
269
271
|
```
|
|
270
272
|
|
|
271
273
|
### 5. Try a live call
|
|
272
274
|
|
|
273
275
|
```
|
|
274
|
-
|
|
275
|
-
|
|
276
|
+
event_send with dryRun: true → validate without sending
|
|
277
|
+
event_send with dryRun: false → send for real
|
|
276
278
|
```
|
|
277
279
|
|
|
278
280
|
## Requirements
|
|
@@ -515,7 +517,7 @@ Then reference it in `.mcp.json`:
|
|
|
515
517
|
- Profiles can also be added/removed/switched at runtime via `connection.*` tools (see [Connection Management](#connection-management))
|
|
516
518
|
- **Mixed auth strategies:** each profile slot resolves its own auth strategy independently — you can mix CLI profiles, OAuth credentials, and static tokens in the same server session. For example, `DEV/RETAILER_A` can use profile auth while `PROD_READONLY` uses OAuth and `QUICK_TEST` uses a static bearer token. The auth priority (profile → OAuth → token command → static token) applies per slot, not globally.
|
|
517
519
|
|
|
518
|
-
> **Note:** `
|
|
520
|
+
> **Note:** `connection_add` supports CLI profile, explicit OAuth, and static token. Per-connection `TOKEN_COMMAND` is not supported at runtime — use env vars for token-command auth on the primary connection.
|
|
519
521
|
|
|
520
522
|
#### Examples
|
|
521
523
|
|
|
@@ -523,7 +525,7 @@ Query orders from a specific environment:
|
|
|
523
525
|
|
|
524
526
|
```json
|
|
525
527
|
{
|
|
526
|
-
"tool": "
|
|
528
|
+
"tool": "graphql_query",
|
|
527
529
|
"arguments": {
|
|
528
530
|
"query": "{ orders(first: 5) { edges { node { id ref status } } } }",
|
|
529
531
|
"profile": "STAGING/UK"
|
|
@@ -534,9 +536,9 @@ Query orders from a specific environment:
|
|
|
534
536
|
Compare workflow versions across retailers:
|
|
535
537
|
|
|
536
538
|
```
|
|
537
|
-
1.
|
|
538
|
-
2.
|
|
539
|
-
3.
|
|
539
|
+
1. workflow_get { entityType: "ORDER", entitySubtype: "HD", profile: "STAGING/UK" }
|
|
540
|
+
2. workflow_get { entityType: "ORDER", entitySubtype: "HD", profile: "STAGING/US" }
|
|
541
|
+
3. workflow_diff { left: <uk-workflow>, right: <us-workflow> }
|
|
540
542
|
```
|
|
541
543
|
|
|
542
544
|
### Cache
|
|
@@ -554,82 +556,82 @@ Filesystem-based cache for near-static read responses (schema introspection, wor
|
|
|
554
556
|
|
|
555
557
|
**Behavior:**
|
|
556
558
|
- **Per-profile isolation** — each profile gets its own cache directory under `accounts/<PROFILE>/.cache`
|
|
557
|
-
- **Cached tools:** `
|
|
558
|
-
- **Write-through invalidation** — write operations auto-invalidate related cache entries: `
|
|
559
|
+
- **Cached tools:** `graphql_introspect`, `plugin_list`, `workflow_get`, `workflow_list`, `setting_get`
|
|
560
|
+
- **Write-through invalidation** — write operations auto-invalidate related cache entries: `workflow_upload` clears `workflow:get:*` and `workflow:list:*`, `setting_upsert`/`setting_bulkUpsert` clears matching `setting:get:*` entries, `graphql_introspect` with `force: true` clears `introspect:*`
|
|
559
561
|
- **`_cache` metadata** — all cached tool responses include a `_cache` field (`{ hit, ageMs }` on cache hit, `{ hit: false, stored: true }` on cache miss) so the AI can reason about data freshness
|
|
560
562
|
- **baseUrl fingerprint** — cache auto-clears if the profile is re-pointed to a different environment, preventing cross-environment contamination
|
|
561
563
|
- **Fail-open** — cache errors (corrupt files, permission issues) become cache misses; the tool continues with a live API call
|
|
562
564
|
- **Requires `FLUENT_PROFILE`** — no profile means no safe namespace, so caching is disabled
|
|
563
565
|
|
|
564
|
-
## Tools (59)
|
|
565
|
-
|
|
566
|
-
### Diagnostics
|
|
567
|
-
|
|
568
|
-
| Tool | Description |
|
|
569
|
-
|---|---|
|
|
570
|
-
| `
|
|
571
|
-
| `
|
|
572
|
-
| `
|
|
573
|
-
|
|
574
|
-
### Time
|
|
575
|
-
|
|
576
|
-
| Tool | Description |
|
|
577
|
-
|---|---|
|
|
578
|
-
| `
|
|
579
|
-
|
|
580
|
-
Use `
|
|
581
|
-
|
|
582
|
-
**Example** — detect ambiguity:
|
|
583
|
-
|
|
584
|
-
```json
|
|
585
|
-
{
|
|
586
|
-
"tool": "
|
|
587
|
-
"arguments": {
|
|
588
|
-
"phrase": "last month",
|
|
589
|
-
"timezone": "Asia/Calcutta"
|
|
590
|
-
}
|
|
591
|
-
}
|
|
592
|
-
```
|
|
593
|
-
|
|
594
|
-
**Example** — force calendar interpretation:
|
|
595
|
-
|
|
596
|
-
```json
|
|
597
|
-
{
|
|
598
|
-
"tool": "
|
|
599
|
-
"arguments": {
|
|
600
|
-
"phrase": "last month",
|
|
601
|
-
"timezone": "Asia/Calcutta",
|
|
602
|
-
"mode": "calendar"
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
```
|
|
606
|
-
|
|
607
|
-
**Example** — resolve datemath for a metrics or GraphQL range:
|
|
608
|
-
|
|
609
|
-
```json
|
|
610
|
-
{
|
|
611
|
-
"tool": "
|
|
612
|
-
"arguments": {
|
|
613
|
-
"phrase": "now-7d/d",
|
|
614
|
-
"timezone": "Asia/Calcutta"
|
|
615
|
-
}
|
|
616
|
-
}
|
|
617
|
-
```
|
|
566
|
+
## Tools (59)
|
|
567
|
+
|
|
568
|
+
### Diagnostics
|
|
569
|
+
|
|
570
|
+
| Tool | Description |
|
|
571
|
+
|---|---|
|
|
572
|
+
| `config_validate` | Validate auth and base URL configuration |
|
|
573
|
+
| `health_ping` | Quick connectivity check |
|
|
574
|
+
| `connection_test` | Full auth + GraphQL end-to-end test (returns user/account context) |
|
|
575
|
+
|
|
576
|
+
### Time
|
|
577
|
+
|
|
578
|
+
| Tool | Description |
|
|
579
|
+
|---|---|
|
|
580
|
+
| `time_resolveWindow` | Resolve phrases like `last month`, `1h30m`, `now-7d/d`, or `now-7d to now` into exact ISO `from` / `to` timestamps |
|
|
581
|
+
|
|
582
|
+
Use `time_resolveWindow` before `graphql_query`, `graphql_queryAll`, `event_list`, `event_flowInspect`, or any other tool that expects explicit dates. For ambiguous phrases such as `last month`, the tool returns candidates and a clarification question instead of silently guessing. For metrics-style asks it also understands shorthand and datemath expressions so the same shared resolver can be reused across tools.
|
|
583
|
+
|
|
584
|
+
**Example** — detect ambiguity:
|
|
585
|
+
|
|
586
|
+
```json
|
|
587
|
+
{
|
|
588
|
+
"tool": "time_resolveWindow",
|
|
589
|
+
"arguments": {
|
|
590
|
+
"phrase": "last month",
|
|
591
|
+
"timezone": "Asia/Calcutta"
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
```
|
|
595
|
+
|
|
596
|
+
**Example** — force calendar interpretation:
|
|
597
|
+
|
|
598
|
+
```json
|
|
599
|
+
{
|
|
600
|
+
"tool": "time_resolveWindow",
|
|
601
|
+
"arguments": {
|
|
602
|
+
"phrase": "last month",
|
|
603
|
+
"timezone": "Asia/Calcutta",
|
|
604
|
+
"mode": "calendar"
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
```
|
|
608
|
+
|
|
609
|
+
**Example** — resolve datemath for a metrics or GraphQL range:
|
|
610
|
+
|
|
611
|
+
```json
|
|
612
|
+
{
|
|
613
|
+
"tool": "time_resolveWindow",
|
|
614
|
+
"arguments": {
|
|
615
|
+
"phrase": "now-7d/d",
|
|
616
|
+
"timezone": "Asia/Calcutta"
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
```
|
|
618
620
|
|
|
619
621
|
### Connection Management
|
|
620
622
|
|
|
621
623
|
| Tool | Description |
|
|
622
624
|
|---|---|
|
|
623
|
-
| `
|
|
624
|
-
| `
|
|
625
|
-
| `
|
|
626
|
-
| `
|
|
625
|
+
| `connection_list` | List all registered profiles with auth strategy, init status, and default marker |
|
|
626
|
+
| `connection_add` | Add a new profile at runtime — by CLI profile name or explicit credentials (baseUrl + OAuth/static token) |
|
|
627
|
+
| `connection_remove` | Remove a non-default profile |
|
|
628
|
+
| `connection_switch` | Switch the default profile (affects all subsequent tool calls that omit `profile`) |
|
|
627
629
|
|
|
628
630
|
**Example** — add a profile by CLI profile name:
|
|
629
631
|
|
|
630
632
|
```json
|
|
631
633
|
{
|
|
632
|
-
"tool": "
|
|
634
|
+
"tool": "connection_add",
|
|
633
635
|
"arguments": {
|
|
634
636
|
"name": "staging",
|
|
635
637
|
"fluentProfile": "STAGING",
|
|
@@ -642,7 +644,7 @@ Use `time.resolveWindow` before `graphql.query`, `graphql.queryAll`, `event.list
|
|
|
642
644
|
|
|
643
645
|
```json
|
|
644
646
|
{
|
|
645
|
-
"tool": "
|
|
647
|
+
"tool": "connection_add",
|
|
646
648
|
"arguments": {
|
|
647
649
|
"name": "partner-sandbox",
|
|
648
650
|
"baseUrl": "https://partner.sandbox.api.fluentretail.com",
|
|
@@ -657,7 +659,7 @@ Use `time.resolveWindow` before `graphql.query`, `graphql.queryAll`, `event.list
|
|
|
657
659
|
|
|
658
660
|
```json
|
|
659
661
|
{
|
|
660
|
-
"tool": "
|
|
662
|
+
"tool": "connection_add",
|
|
661
663
|
"arguments": {
|
|
662
664
|
"name": "quick-test",
|
|
663
665
|
"baseUrl": "https://partner.sandbox.api.fluentretail.com",
|
|
@@ -667,13 +669,13 @@ Use `time.resolveWindow` before `graphql.query`, `graphql.queryAll`, `event.list
|
|
|
667
669
|
}
|
|
668
670
|
```
|
|
669
671
|
|
|
670
|
-
`
|
|
672
|
+
`connection_add` does not currently accept `TOKEN_COMMAND`; token-command auth is configured at server startup via environment variables.
|
|
671
673
|
|
|
672
674
|
**Example** — switch the default:
|
|
673
675
|
|
|
674
676
|
```json
|
|
675
677
|
{
|
|
676
|
-
"tool": "
|
|
678
|
+
"tool": "connection_switch",
|
|
677
679
|
"arguments": { "name": "staging" }
|
|
678
680
|
}
|
|
679
681
|
```
|
|
@@ -682,13 +684,13 @@ Use `time.resolveWindow` before `graphql.query`, `graphql.queryAll`, `event.list
|
|
|
682
684
|
|
|
683
685
|
| Tool | Description |
|
|
684
686
|
|---|---|
|
|
685
|
-
| `
|
|
686
|
-
| `
|
|
687
|
-
| `
|
|
688
|
-
| `
|
|
689
|
-
| `
|
|
687
|
+
| `event_build` | Build event payload without sending (validation only) |
|
|
688
|
+
| `event_send` | Build and send event (supports `dryRun: true` with `_workflowPreview` showing predicted target status, matching rulesets, webhook/custom-rule detection) |
|
|
689
|
+
| `event_get` | Fetch a single event by ID |
|
|
690
|
+
| `event_list` | List/filter events with pagination |
|
|
691
|
+
| `event_flowInspect` | One-call root-entity flow forensics — works for ORDER/FULFILMENT/LOCATION/WAVE/PRODUCT and more |
|
|
690
692
|
|
|
691
|
-
`
|
|
693
|
+
`event_flowInspect` supports any entity type. Pass `rootEntityType` when you want strict filtering; omit it to inspect by root ref only. Use `rootEntityId` when refs are reused and you need exact disambiguation.
|
|
692
694
|
|
|
693
695
|
**Compact mode (default `compact: true`):** Returns a pre-analyzed summary (~2-3k tokens) with an `analysis` section containing anomaly findings, status flow, failed webhook endpoints, and slowest rulesets. Set `compact: false` for full raw data (~24k tokens).
|
|
694
696
|
|
|
@@ -739,7 +741,7 @@ Use `time.resolveWindow` before `graphql.query`, `graphql.queryAll`, `event.list
|
|
|
739
741
|
|
|
740
742
|
### Local-First LLM Reduction (flowInspect)
|
|
741
743
|
|
|
742
|
-
If `
|
|
744
|
+
If `event_flowInspect` returns large JSON, run local analysis first and only send compact artifacts to an LLM:
|
|
743
745
|
|
|
744
746
|
```bash
|
|
745
747
|
npx tsx scripts/run-flow-inspect.ts <ROOT_ENTITY_REF> --profile <PROFILE>
|
|
@@ -749,14 +751,14 @@ This writes:
|
|
|
749
751
|
|
|
750
752
|
- `EVENT_FLOW_INSPECT_<ref>.json` (raw)
|
|
751
753
|
- `EVENT_FLOW_INSPECT_<ref>.summary.json` (local anomaly + metrics summary)
|
|
752
|
-
- `EVENT_FLOW_INSPECT_<ref>.drilldown.json` (focused `
|
|
754
|
+
- `EVENT_FLOW_INSPECT_<ref>.drilldown.json` (focused `event_get` extraction for top evidence IDs)
|
|
753
755
|
- `EVENT_FLOW_INSPECT_<ref>.llm-packet.md` (small LLM handoff packet)
|
|
754
756
|
|
|
755
757
|
Useful flags:
|
|
756
758
|
|
|
757
759
|
- `--light` uses compact fetch mode for faster runs
|
|
758
760
|
- `--root-type ...` and `--root-id ...` tighten entity matching
|
|
759
|
-
- `--drilldown` / `--no-drilldown` toggle focused `
|
|
761
|
+
- `--drilldown` / `--no-drilldown` toggle focused `event_get` enrichment
|
|
760
762
|
- `--drilldown-limit` controls how many top evidence IDs get enriched
|
|
761
763
|
- `--drilldown-classes webhook,mutation,sendEvent,mismatch,exception,scheduled,slow,status` limits enrichment to selected evidence classes
|
|
762
764
|
- `--top-n`, `--evidence-limit`, `--truncate` control summary/packet compactness
|
|
@@ -766,27 +768,27 @@ Useful flags:
|
|
|
766
768
|
|
|
767
769
|
| Tool | Description |
|
|
768
770
|
|---|---|
|
|
769
|
-
| `
|
|
770
|
-
| `
|
|
771
|
-
| `
|
|
772
|
-
| `
|
|
773
|
-
| `
|
|
774
|
-
| `
|
|
775
|
-
| `
|
|
776
|
-
| `
|
|
777
|
-
| `
|
|
778
|
-
| `
|
|
779
|
-
|
|
780
|
-
`
|
|
781
|
-
|
|
782
|
-
`
|
|
771
|
+
| `metrics_query` | Query Prometheus metrics using instant or range mode |
|
|
772
|
+
| `metrics_healthCheck` | One-call anomaly check with Prometheus-first + Event API fallback |
|
|
773
|
+
| `metrics_sloReport` | Managed-services SLO snapshot (rates + p95 latency + findings) |
|
|
774
|
+
| `metrics_labelCatalog` | Discover supported metric labels from live series + known Fluent hints |
|
|
775
|
+
| `metrics_metricCatalog` | Show documented Fluent metric families, labels, safe groupings, and live-discovered metric names |
|
|
776
|
+
| `metrics_planQuery` | Build safe PromQL for rate, increase, delta, breakdown, topk, p95, avg, and recency use cases |
|
|
777
|
+
| `metrics_snapshot` | Return a compact dashboard snapshot with volume, failures, latency, and breakdowns in one call |
|
|
778
|
+
| `metrics_compare` | Compare a metric across two adjacent windows and highlight what changed |
|
|
779
|
+
| `metrics_mutationAudit` | Audit GraphQL create/update mutation traffic by domain/subdomain and split counts by operation name |
|
|
780
|
+
| `metrics_topEvents` | Aggregate and rank top events by name/entity/status in a time window |
|
|
781
|
+
|
|
782
|
+
`metrics_mutationAudit` is intentionally opinionated: it discovers mutation names locally, then queries each operation explicitly instead of relying on `sum by (operation)`. Treat the output as GraphQL mutation traffic, not guaranteed business-truth entity counts.
|
|
783
|
+
|
|
784
|
+
`metrics_planQuery` now reuses the shared window parser, so compound windows like `1h30m` work consistently and the tool returns an auto-calculated `recommendedStep` / `estimatedPoints` hint for `metrics_query type=range`, snapped upward to stay within the LLM-safe point budget.
|
|
783
785
|
|
|
784
786
|
### Orchestration
|
|
785
787
|
|
|
786
788
|
| Tool | Description |
|
|
787
789
|
|---|---|
|
|
788
|
-
| `
|
|
789
|
-
| `
|
|
790
|
+
| `workflow_transitions` | Query available user actions/transitions with workflow-aware enrichment: action predictions (`_predictions`), attribute templates, recommended next action (`_recommended`), and multi-step lookahead (`nextSteps`). Auto-fetches workflow when not cached. |
|
|
791
|
+
| `plugin_list` | List all registered rules with metadata (`GET /orchestration/rest/v1/plugin`). Supports optional name filter. |
|
|
790
792
|
|
|
791
793
|
**`flexType` auto-derive:** When `type` and `subtype` are provided but `flexType` is omitted, it is auto-derived as `TYPE::SUBTYPE`. All three params (`module`, `flexType`, `flexVersion`) are required by the Transition API — omitting any one silently returns empty results.
|
|
792
794
|
|
|
@@ -836,15 +838,15 @@ Useful flags:
|
|
|
836
838
|
|
|
837
839
|
| Tool | Description |
|
|
838
840
|
|---|---|
|
|
839
|
-
| `
|
|
840
|
-
| `
|
|
841
|
-
| `
|
|
842
|
-
| `
|
|
843
|
-
| `
|
|
844
|
-
| `
|
|
845
|
-
| `
|
|
846
|
-
| `
|
|
847
|
-
| `
|
|
841
|
+
| `graphql_query` | Execute any query or mutation |
|
|
842
|
+
| `graphql_queryAll` | Auto-paginated query — follows cursors across all pages |
|
|
843
|
+
| `graphql_batchMutate` | Execute up to 50 mutations in one request |
|
|
844
|
+
| `graphql_introspect` | Inspect schema types, queries, mutations, nested input fields, and field-level args |
|
|
845
|
+
| `graphql_listRoots` | List all query and mutation root fields from the live schema |
|
|
846
|
+
| `graphql_planOperation` | Plan a query or mutation before execution — returns arg requirements, variables skeleton, selection template, and execution guidance |
|
|
847
|
+
| `graphql_buildQuery` | Generate a query or mutation from structured inputs |
|
|
848
|
+
| `graphql_validate` | Validate a GraphQL document against the live schema |
|
|
849
|
+
| `graphql_generateFull` | Generate a maximal-selection query for a root field with configurable depth |
|
|
848
850
|
|
|
849
851
|
**Example** — query orders:
|
|
850
852
|
|
|
@@ -900,36 +902,36 @@ With `dryRun: true`, returns the generated aliased mutation query and variables
|
|
|
900
902
|
}
|
|
901
903
|
```
|
|
902
904
|
|
|
903
|
-
Use `
|
|
905
|
+
Use `graphql_planOperation` when you want the server to tell the AI which args are required, what the variables shape should look like, and which execution tool (`graphql_query` vs `graphql_queryAll`) makes sense.
|
|
904
906
|
|
|
905
907
|
### Batch Ingestion
|
|
906
908
|
|
|
907
909
|
| Tool | Description |
|
|
908
910
|
|---|---|
|
|
909
|
-
| `
|
|
910
|
-
| `
|
|
911
|
-
| `
|
|
912
|
-
| `
|
|
913
|
-
| `
|
|
914
|
-
| `
|
|
911
|
+
| `batch_create` | Create an ingestion job |
|
|
912
|
+
| `batch_describePayload` | Return entity-type-specific field requirements, example rows, and hints for `batch_send` without making an API call |
|
|
913
|
+
| `batch_send` | Send records to a job |
|
|
914
|
+
| `batch_status` | Check job status |
|
|
915
|
+
| `batch_batchStatus` | Check a specific batch within a job |
|
|
916
|
+
| `batch_results` | Get per-record outcomes |
|
|
915
917
|
|
|
916
|
-
Typical flow: `
|
|
918
|
+
Typical flow: `batch_describePayload` → `batch_create` → `batch_send` → `batch_status` (poll) → `batch_results`
|
|
917
919
|
|
|
918
920
|
### Webhook
|
|
919
921
|
|
|
920
922
|
| Tool | Description |
|
|
921
923
|
|---|---|
|
|
922
|
-
| `
|
|
924
|
+
| `webhook_validate` | Validate payload fields and optionally verify cryptographic signature |
|
|
923
925
|
|
|
924
926
|
### Entity Lifecycle
|
|
925
927
|
|
|
926
928
|
| Tool | Description |
|
|
927
929
|
|---|---|
|
|
928
|
-
| `
|
|
929
|
-
| `
|
|
930
|
-
| `
|
|
931
|
-
| `
|
|
932
|
-
| `
|
|
930
|
+
| `entity_create` | Type-safe entity creation with field validation, compound key encoding, and retailer auto-injection. Supports 12 entity types. |
|
|
931
|
+
| `entity_update` | Status-aware entity updates with optional transition validation via `workflow_transitions` |
|
|
932
|
+
| `entity_get` | Unified entity lookup by ID or ref with optional edge inclusion |
|
|
933
|
+
| `entity_planCreate` | Plan an entity_create call locally — returns required fields, variables skeleton, mutation shape, gotchas, and auto-injected retailer context |
|
|
934
|
+
| `entity_planUpdate` | Plan an entity_update call locally — returns updatable fields, variables skeleton, mutation shape, and status-change guidance |
|
|
933
935
|
|
|
934
936
|
**Supported types:** ORDER, FULFILMENT, LOCATION, NETWORK, CUSTOMER, PRODUCT, INVENTORY_POSITION, VIRTUAL_CATALOGUE, VIRTUAL_POSITION, CATEGORY, CARRIER, SETTING
|
|
935
937
|
|
|
@@ -952,11 +954,11 @@ Typical flow: `batch.describePayload` → `batch.create` → `batch.send` → `b
|
|
|
952
954
|
|
|
953
955
|
| Tool | Description |
|
|
954
956
|
|---|---|
|
|
955
|
-
| `
|
|
956
|
-
| `
|
|
957
|
-
| `
|
|
958
|
-
| `
|
|
959
|
-
| `
|
|
957
|
+
| `workflow_get` | Fetch a specific workflow by entity type and subtype via REST API. Works even when the list endpoint returns 401. |
|
|
958
|
+
| `workflow_list` | List all workflows for a retailer. Deduplicates to latest version per workflow name. |
|
|
959
|
+
| `workflow_upload` | Deploy workflow JSON via REST API (`PUT /api/v4.1/workflow/{retailerId}`). Idempotent upsert — same JSON twice does not create duplicate versions. Includes structure validation, preflight safety analysis (no-match zones, webhook setting dependencies, live diff). Does NOT update CLI workflowlog. |
|
|
960
|
+
| `workflow_diff` | Compare two workflow definitions — returns added/removed/modified rulesets with risk assessment. Supports `summary`, `detailed`, and `mermaid` formats. |
|
|
961
|
+
| `workflow_simulate` | Static analysis prediction of which rulesets would fire for a given status + event name. Does NOT execute Java rules or check runtime state — use `workflow_transitions` for authoritative live validation. |
|
|
960
962
|
|
|
961
963
|
**Example** — fetch a workflow and save to file:
|
|
962
964
|
|
|
@@ -986,9 +988,9 @@ With `outputDir`, each workflow is saved as `{TYPE}-{SUBTYPE}.json` (e.g., `ORDE
|
|
|
986
988
|
|
|
987
989
|
| Tool | Description |
|
|
988
990
|
|---|---|
|
|
989
|
-
| `
|
|
990
|
-
| `
|
|
991
|
-
| `
|
|
991
|
+
| `setting_get` | Fetch settings by name (`%` wildcards supported), optionally save to local file to keep large JSON out of LLM context |
|
|
992
|
+
| `setting_upsert` | Create or update a setting with upsert semantics — queries existing by name + context + contextId first |
|
|
993
|
+
| `setting_bulkUpsert` | Batch create/update up to 50 settings with per-setting error handling |
|
|
992
994
|
|
|
993
995
|
**Contexts:** RETAILER, ACCOUNT, LOCATION, NETWORK, AGENT, CUSTOMER
|
|
994
996
|
|
|
@@ -1023,14 +1025,14 @@ Provide either `value` (for small strings ≤255 chars) or `lobValue` (for large
|
|
|
1023
1025
|
|
|
1024
1026
|
| Tool | Description |
|
|
1025
1027
|
|---|---|
|
|
1026
|
-
| `
|
|
1027
|
-
| `
|
|
1028
|
+
| `environment_discover` | Full environment snapshot — retailer, locations, networks, catalogues, workflows, settings, modules, users. Each section is opt-in via `include` array. |
|
|
1029
|
+
| `environment_validate` | Pre-flight validation checks: auth, retailer, locations, inventory, workflows, settings, modules |
|
|
1028
1030
|
|
|
1029
1031
|
### Test Automation
|
|
1030
1032
|
|
|
1031
1033
|
| Tool | Description |
|
|
1032
1034
|
|---|---|
|
|
1033
|
-
| `
|
|
1035
|
+
| `test_assert` | Assert entity state matches expectations. Supports status, type, attribute, and edge assertions. Optional polling mode retries until pass or timeout. |
|
|
1034
1036
|
|
|
1035
1037
|
**Example** — assert an order reached BOOKED with at least 1 fulfilment:
|
|
1036
1038
|
|
|
@@ -1051,17 +1053,17 @@ Provide either `value` (for small strings ≤255 chars) or `lobValue` (for large
|
|
|
1051
1053
|
|
|
1052
1054
|
| Tool | Description |
|
|
1053
1055
|
|---|---|
|
|
1054
|
-
| `
|
|
1055
|
-
| `
|
|
1056
|
+
| `cache_status` | Show local cache statistics — entry count, size, hit/miss rate, per-category breakdown. No API call. |
|
|
1057
|
+
| `cache_clear` | Clear cached entries by pattern (e.g. `workflow:*`) or all. No API call, operates on local filesystem only. |
|
|
1056
1058
|
|
|
1057
1059
|
See [Cache configuration](#cache) for env vars, TTLs, and behavior details. Write operations auto-invalidate related cache entries, so manual clearing is only needed after out-of-band changes (CLI deployments, REST API calls, admin console edits).
|
|
1058
1060
|
|
|
1059
1061
|
| Pattern | Clears |
|
|
1060
1062
|
|---|---|
|
|
1061
|
-
| `workflow:*` | All cached workflow list
|
|
1063
|
+
| `workflow:get:*` / `workflow:list:*` | All cached workflow get/list responses |
|
|
1062
1064
|
| `setting:get:fc.mystique.*` | Cached manifest and setting lookups |
|
|
1063
1065
|
| `introspect:*` | GraphQL schema introspection cache |
|
|
1064
|
-
| `plugin:list
|
|
1066
|
+
| `plugin:list:*` | Cached plugin metadata |
|
|
1065
1067
|
| *(omit pattern)* | Everything |
|
|
1066
1068
|
|
|
1067
1069
|
**Example** — check cache health:
|
|
@@ -1140,7 +1142,7 @@ npx tsx scripts/measure-tool-tokens.ts
|
|
|
1140
1142
|
# Negative-path validation (bad payloads, schema failures, error envelopes)
|
|
1141
1143
|
npx tsx scripts/e2e-negative.ts --profile YOUR_PROFILE --retailer YOUR_RETAILER_REF_OR_ID
|
|
1142
1144
|
|
|
1143
|
-
# Check status of specific events and filtered
|
|
1145
|
+
# Check status of specific events and filtered event_lists
|
|
1144
1146
|
npx tsx scripts/check-event-status.ts --profile YOUR_PROFILE --retailer YOUR_RETAILER_REF_OR_ID --event-id <EVENT_ID>
|
|
1145
1147
|
```
|
|
1146
1148
|
|
|
@@ -1154,11 +1156,11 @@ Recommended operator flow:
|
|
|
1154
1156
|
|
|
1155
1157
|
| Symptom | Likely Cause | Fix |
|
|
1156
1158
|
|---|---|---|
|
|
1157
|
-
| `
|
|
1159
|
+
| `config_validate` fails | Missing or invalid env vars | Check `FLUENT_BASE_URL` and at least one complete auth method |
|
|
1158
1160
|
| `FLUENT_PROFILE` auth fails | Profile/retailer ref mismatch or missing files | Verify `fluent profile list`, profile name, and `FLUENT_PROFILE_RETAILER` ref |
|
|
1159
1161
|
| `AUTH_ERROR` on any tool | Bad credentials or expired token | Verify OAuth values or regenerate token |
|
|
1160
|
-
| `
|
|
1161
|
-
| `
|
|
1162
|
+
| `connection_test` fails | Network or URL mismatch | Verify API URL, check VPN/proxy, confirm tenant is reachable |
|
|
1163
|
+
| `event_send` succeeds but workflow doesn't trigger | Event name not mapped in workflow | Check workflow event handlers and ruleset conditions |
|
|
1162
1164
|
| Server doesn't appear in MCP client | Config not reloaded | Restart IDE/client after editing `.mcp.json` |
|
|
1163
1165
|
| Events sent to wrong tenant | Wrong `FLUENT_BASE_URL` | Confirm the API URL and retailer ID |
|
|
1164
1166
|
| `RATE_LIMIT` errors | Too many requests | Reduce request frequency; retryable errors auto-retry up to `FLUENT_RETRY_ATTEMPTS` |
|
|
@@ -1183,7 +1185,7 @@ accounts/
|
|
|
1183
1185
|
analysis/ # generated analysis artifacts
|
|
1184
1186
|
```
|
|
1185
1187
|
|
|
1186
|
-
Skills use this server's tools (`
|
|
1188
|
+
Skills use this server's tools (`plugin_list`, `graphql_query`, `connection_test`, etc.) to:
|
|
1187
1189
|
- Build a deployed rule inventory by cross-referencing live registered rules with local source
|
|
1188
1190
|
- Validate connectivity during guided onboarding (`/fluent-connect`)
|
|
1189
1191
|
- Run entity count discovery queries during workspace setup
|
|
@@ -1207,7 +1209,7 @@ npm run dev # hot-reload via tsx
|
|
|
1207
1209
|
3. `npm run e2e:smoke -- --profile <PROFILE> --retailer <RETAILER>` (requires live API)
|
|
1208
1210
|
4. `npm pack` — inspect contents
|
|
1209
1211
|
5. `npm publish --access public`
|
|
1210
|
-
6. Post-publish: start via MCP client, run `
|
|
1212
|
+
6. Post-publish: start via MCP client, run `config_validate`, `health_ping`, `connection_test`
|
|
1211
1213
|
|
|
1212
1214
|
> `prepublishOnly` enforces `build && test` automatically. Keep credentials out of `.mcp.json` and docs.
|
|
1213
1215
|
|