@battlegrid/mcp-server 31.2.14 → 31.2.16

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 CHANGED
@@ -24,7 +24,7 @@ Seeing package `31.x` alongside handshake `battlegrid@33.x` — the package **be
24
24
 
25
25
  **What this changes for you:** nothing about how you call anything. Upgrading the package no longer waits on a server deploy, and a server deploy no longer strands you on a package that names the wrong contract — reconnect and the announcement follows. **Contract breaking-change notes are no longer keyed to package versions**, since a contract move is no longer a release here; the v11-and-earlier notes below are kept as history, and the live vocabulary is always discovery.
26
26
 
27
- ## Contract history — v37 → v53
27
+ ## Contract history — v37 → v54
28
28
 
29
29
  Eleven majors reached authors while this section stopped at v36. That gap is the mechanism, not an
30
30
  oversight: since v31 a contract move needs no release here, so nothing forced a note to be written —
@@ -291,6 +291,45 @@ refuse is now stored. Listed because a client that special-cased the refusal can
291
291
 
292
292
  ### Reshaped output — the same call returns a different shape
293
293
 
294
+ - **`scan_agent_coins` returns the ranking, not an explanation of every coin** (54.0.0,
295
+ `fix-mcp-scan-row-altitude`). The scan used to wrap the app's full per-coin qualification verdict
296
+ in every row — two directions with candidate-level construction and a stop-loss policy band, four
297
+ gates each with its own measurement, condition reach reasons, the ATR corridor. For a 78-coin
298
+ catalog that was **82,147 characters, ~1,053 per row**, which is past the tool-result cap of every
299
+ client we know of: the calling model received a file path instead of an answer, so the tool did not
300
+ deliver its result even when the scan succeeded.
301
+
302
+ `rows` is gone. Three ranked arrays replace it, and `rank` is **global across all three**, so
303
+ reading them in this order reproduces the server's own sequence:
304
+
305
+ ```
306
+ qualified[] { rank, coinTicker, scorePercent, coinDataStopped }
307
+ rejected[] { rank, coinTicker, scorePercent, firstFailReason, scoreShortfallPercent }
308
+ unscorable[] { rank, coinTicker, coinDataStopped }
309
+ ```
310
+
311
+ Array membership now carries what the row `kind` discriminator and the `qualifies` flag used to,
312
+ and both are gone with them; `firstFailReason` is non-nullable on a rejected row, because a
313
+ non-qualifying verdict always names the gate that blocked it. Rows also lose `long`, `short`,
314
+ `gates`, `tradeableAtrRange`, `evaluatedAt`, `coinName`, `assetClass` and `category`.
315
+
316
+ Two things are new. The agent's `agentId`, `agentName`, `strategyTimeframe` and `minScorePercent`
317
+ move to an `agent` object carried **once** instead of on all 78 rows — `null` when the scan scored
318
+ nothing at all. And `scoreShortfallPercent` is server-computed: how far below the minimum the score
319
+ fell, non-null exactly when the aggregate score is what blocked, so you never subtract a published
320
+ threshold from a published reading yourself.
321
+
322
+ `scanStartedAt`, `coinsScanned` and `qualifiedCount` are unchanged, and so is every coin: same
323
+ rows, same order, same ranks, same verdicts, same rate buckets, same evaluator. Only the fields
324
+ moved — about 8.8 KB for the same 78-coin scan.
325
+
326
+ **Migration.** Read `qualified` / `rejected` / `unscorable` instead of `rows`, and take the agent's
327
+ thresholds from `agent` rather than from the first row. For a shortlisted coin's full per-direction
328
+ and per-gate detail, call `get_agent_coin_qualification` on up to 12 tickers — it carries every
329
+ dropped field and costs no second scan (the scan is rate-limited to 3 per agent and 10 per user a
330
+ minute; the probe is not).
331
+
332
+
294
333
  - **Report headers, glosses and signal indicator keys are renamed for the Donchian channel**
295
334
  (53.0.0, `rename-donchian-channel`). Every report surface — `preview_strategy_report`,
296
335
  `get_strategy_section_template`, the agent prompt previews — renders `donchianHi` / `donchianLo`
@@ -413,6 +452,58 @@ refuse is now stored. Listed because a client that special-cased the refusal can
413
452
  a stored result" and "the signal did not fire" are different states, and leaving the key off that
414
453
  arm makes conflating them a type error rather than a convention.
415
454
 
455
+ ### Additive in the same span
456
+
457
+ - **Two tools join the catalog for the agent trade flow** (52.1.0, `add-mcp-agent-trade-flow`).
458
+ `scan_agent_coins` evaluates every active coin against one of your agents in a single call and
459
+ returns them server-ranked, on the same use case, buckets and ranking the app's own TRADE-tab scan
460
+ serves. `propose_entry_decision` runs the conversational trade turn headlessly for one (agent,
461
+ coin) and returns its terminal in the stream's own vocabulary: `type: recommendation` carrying the
462
+ PROPOSED `TradingEntryDecisionDTO` row that `get_entry_decision` and `list_pending_approvals`
463
+ already publish, `type: no_trade`, or `type: error` carrying the turn's `TradeConvError` verbatim.
464
+ Nothing narrows and no existing schema hash moves; the 12-ticker `get_agent_coin_qualification`
465
+ stays as the spot-check probe.
466
+
467
+ **`idempotencyKey` is REQUIRED on `propose_entry_decision`** — it is the turn's own key, and a
468
+ same-key retry replays the recorded terminal rather than paying for a second inference. That
469
+ includes a post-billing `LLM_FAILURE`, which is returned as a value for precisely that reason.
470
+ Pre-engine faults are typed errors instead: `RATE_LIMITED`, `NOT_FOUND`, `CONFLICT` for a same-key
471
+ call still in flight, and `SERVICE_UNAVAILABLE` when the surface is switched off. Both tools
472
+ refuse with `RATE_LIMITED` carrying `retryAfterSeconds` under the same per-(user, agent) limit the
473
+ app itself enforces, so a scan is never served stale or partial.
474
+
475
+ - **`get_regime_snapshot` publishes the evidence behind the verdict** (47.1.0,
476
+ `publish-regime-classification-evidence`). The snapshot gains `evidence`: the quantities the
477
+ classifier read, the gates it tested them against, the signed margin to the gate deciding whether
478
+ the current label survives, and the two decision facts only the classifier holds — `gateState`
479
+ (`cleared` / `held` / `dropped`) and `directionSource` (`di` / `ema`). Nothing narrows; a client
480
+ that ignores the field is unaffected.
481
+
482
+ Read `gateState` before you trust a trend label: **`held` means the ADX hysteresis buffer is
483
+ carrying the PREVIOUS bar's label rather than this bar re-confirming it** — a materially weaker
484
+ claim wearing the same word, and one no client could previously detect. `directionSource: 'ema'`
485
+ is the same shape of warning: the direction came from the fallback that fires precisely when the
486
+ DI spread is indecisive. The margin is signed so **positive always means "the current label
487
+ survives by this much"**, in every gate state, so it is safe to branch on its sign.
488
+
489
+ `conviction` is a BRANCH DISCRIMINATOR, not a confidence: it encodes *which* rule in the priority
490
+ ladder matched, not how comfortably it matched. The margins carry comfort. A client reading
491
+ conviction as a strength score is reading it wrong, and always was — this release just makes the
492
+ alternative available.
493
+
494
+ - **Thirteen metric keys join the catalog** (47.1.0) — the `regime` family gains `REGIME_STATE`,
495
+ `REGIME_CONVICTION`, `REGIME_RUN_BARS`, `REGIME_TREND_GATE`, `REGIME_TREND_MARGIN`,
496
+ `REGIME_TREND_SOURCE`, `REGIME_DI_SPREAD`, `REGIME_VOL_ATR_RATIO`, `REGIME_VOL_BBW_RATIO`,
497
+ `REGIME_MOM_BULL_VOTES`, `REGIME_MOM_BEAR_VOTES`, `REGIME_CRASH_MARGIN` and `REGIME_CRASH_LATCH`,
498
+ making the composite regime and its evidence addressable in a report column or condition for the
499
+ first time. Only a client that switches exhaustively on `MetricKey` needs new branches.
500
+
501
+ Not a contract change, but worth knowing if you author conditions: the report grammar's regime
502
+ metrics now resolve from the **confirmed close** on every path. They previously resolved from the
503
+ forming bar when a report was rendered and the confirmed close when the scan swept, so the same
504
+ condition could read differently in preview than in production. Same wire shape; same bar
505
+ everywhere now.
506
+
416
507
  ## Contract history — v12 → v36
417
508
 
418
509
  > **The number in this heading is a CONTRACT version, not this package's version.** The npm badge at the top
@@ -565,38 +656,6 @@ Nothing in the proxy changes. No configuration, no environment variable, no call
565
656
 
566
657
  ### Additive in the same span
567
658
 
568
- - **`get_regime_snapshot` publishes the evidence behind the verdict** (47.1.0,
569
- `publish-regime-classification-evidence`). The snapshot gains `evidence`: the quantities the
570
- classifier read, the gates it tested them against, the signed margin to the gate deciding whether
571
- the current label survives, and the two decision facts only the classifier holds — `gateState`
572
- (`cleared` / `held` / `dropped`) and `directionSource` (`di` / `ema`). Nothing narrows; a client
573
- that ignores the field is unaffected.
574
-
575
- Read `gateState` before you trust a trend label: **`held` means the ADX hysteresis buffer is
576
- carrying the PREVIOUS bar's label rather than this bar re-confirming it** — a materially weaker
577
- claim wearing the same word, and one no client could previously detect. `directionSource: 'ema'`
578
- is the same shape of warning: the direction came from the fallback that fires precisely when the
579
- DI spread is indecisive. The margin is signed so **positive always means "the current label
580
- survives by this much"**, in every gate state, so it is safe to branch on its sign.
581
-
582
- `conviction` is a BRANCH DISCRIMINATOR, not a confidence: it encodes *which* rule in the priority
583
- ladder matched, not how comfortably it matched. The margins carry comfort. A client reading
584
- conviction as a strength score is reading it wrong, and always was — this release just makes the
585
- alternative available.
586
-
587
- - **Thirteen metric keys join the catalog** (47.1.0) — the `regime` family gains `REGIME_STATE`,
588
- `REGIME_CONVICTION`, `REGIME_RUN_BARS`, `REGIME_TREND_GATE`, `REGIME_TREND_MARGIN`,
589
- `REGIME_TREND_SOURCE`, `REGIME_DI_SPREAD`, `REGIME_VOL_ATR_RATIO`, `REGIME_VOL_BBW_RATIO`,
590
- `REGIME_MOM_BULL_VOTES`, `REGIME_MOM_BEAR_VOTES`, `REGIME_CRASH_MARGIN` and `REGIME_CRASH_LATCH`,
591
- making the composite regime and its evidence addressable in a report column or condition for the
592
- first time. Only a client that switches exhaustively on `MetricKey` needs new branches.
593
-
594
- Not a contract change, but worth knowing if you author conditions: the report grammar's regime
595
- metrics now resolve from the **confirmed close** on every path. They previously resolved from the
596
- forming bar when a report was rendered and the confirmed close when the scan swept, so the same
597
- condition could read differently in preview than in production. Same wire shape; same bar
598
- everywhere now.
599
-
600
659
  `27.1.0` exit-policy authoring input on `compile_strategy_plan` · `19.2.0` `get_account_state` account identity · `19.1.0` Standing Orders marker authoring · `18.4.0` `list_gate_blocks` summary groups · `18.3.0` radar maintenance pause · `18.1.0` protection geometry · `17.2.0` break-even/trailing status · `17.1.0` `get_signal_log` condition evaluation · `13.1.0` four owner-scoped read tools · `12.1.0` cross-venue spot price metrics · `11.1.0` discoverable rate limit.
601
660
 
602
661
  ## v11 and earlier — contract history (v6 → v11)
package/dist/index.d.ts CHANGED
@@ -49,7 +49,7 @@ import { type Implementation, type Prompt, type Resource } from '@modelcontextpr
49
49
  * being asked. Move it for a change to THIS package — a proxy fix, a dependency bump, a docs
50
50
  * correction. Never move it to track the server.
51
51
  */
52
- export declare const PACKAGE_VERSION = "31.2.14";
52
+ export declare const PACKAGE_VERSION = "31.2.16";
53
53
  export declare const DEFAULT_URL = "https://mcp.battlegrid.trade/mcp";
54
54
  export interface EnvConfig {
55
55
  apiKeys: string[];
package/dist/index.js CHANGED
@@ -52,7 +52,7 @@ import { ListToolsRequestSchema, CallToolRequestSchema, ListPromptsRequestSchema
52
52
  * being asked. Move it for a change to THIS package — a proxy fix, a dependency bump, a docs
53
53
  * correction. Never move it to track the server.
54
54
  */
55
- export const PACKAGE_VERSION = '31.2.14';
55
+ export const PACKAGE_VERSION = '31.2.16';
56
56
  export const DEFAULT_URL = 'https://mcp.battlegrid.trade/mcp';
57
57
  const MAX_RETRIES = 3;
58
58
  const RETRY_DELAYS_MS = [2000, 4000, 8000];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@battlegrid/mcp-server",
3
- "version": "31.2.14",
4
- "description": "BattleGrid MCP server — play crypto prediction games from AI agents",
3
+ "version": "31.2.16",
4
+ "description": "BattleGrid MCP server \u2014 play crypto prediction games from AI agents",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
7
  "bin": {