@dwlf/mcp-server 0.54.2 → 0.55.0

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.
@@ -2,8 +2,9 @@ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  import { DWLFClient } from '../client.js';
3
3
  /**
4
4
  * The stored cycle WINDOW for one symbol — when its next cycle pivot is due.
5
- * Backed by GET /v2/cycles/windows (DWLF-272). Pass-through: the backend
6
- * projects the window store and computes nothing, and so does this tool.
5
+ * Backed by GET /v2/cycles/windows (DWLF-272). Pass-through: this tool computes
6
+ * nothing. The backend projects the window store and, with `depth` (DWLF-416),
7
+ * derives each window's price zone at read time.
7
8
  */
8
9
  export declare function registerCycleWindowTools(server: McpServer, client: DWLFClient): void;
9
10
  //# sourceMappingURL=cycle-windows.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cycle-windows.d.ts","sourceRoot":"","sources":["../../src/tools/cycle-windows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAE3D;;;;GAIG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,QA0F7E"}
1
+ {"version":3,"file":"cycle-windows.d.ts","sourceRoot":"","sources":["../../src/tools/cycle-windows.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAE3D;;;;;GAKG;AACH,wBAAgB,wBAAwB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,QAyG7E"}
@@ -2,8 +2,9 @@ import { z } from 'zod';
2
2
  import { normalizeSymbol } from '../client.js';
3
3
  /**
4
4
  * The stored cycle WINDOW for one symbol — when its next cycle pivot is due.
5
- * Backed by GET /v2/cycles/windows (DWLF-272). Pass-through: the backend
6
- * projects the window store and computes nothing, and so does this tool.
5
+ * Backed by GET /v2/cycles/windows (DWLF-272). Pass-through: this tool computes
6
+ * nothing. The backend projects the window store and, with `depth` (DWLF-416),
7
+ * derives each window's price zone at read time.
7
8
  */
8
9
  export function registerCycleWindowTools(server, client) {
9
10
  server.tool('dwlf_get_cycle_windows', 'When is this symbol\'s next cycle LOW (or HIGH) due? Returns the STORED cycle timing window per side — ' +
@@ -30,7 +31,14 @@ export function registerCycleWindowTools(server, client) {
30
31
  'gate stands failed), treat the edges as rough timing, not a forecast. ⚠️ The store covers WEEKLY and DAILY ' +
31
32
  '(daily folded from the ledger\'s daily lows/highs); `timeframe: "1h"` answers with ' +
32
33
  'null sides rather than a computed substitute. On daily, `bars` are trading candles, and an extrapolated ' +
33
- 'edge\'s date is an estimate from average bar spacing (it can fall on a non-trading day until real bars exist).', {
34
+ 'edge\'s date is an estimate from average bar spacing (it can fall on a non-trading day until real bars exist).\n\n' +
35
+ 'PRICE ZONE (`depth: true`, DWLF-416): each window also carries `depth`, DERIVED at read time: how far price ' +
36
+ 'MOVED into this side\'s past pivots (`pct` min/p25/median/p75/max, a fall into a low or a rise into a high, ' +
37
+ 'over the trailing `n` completed cycles; `thin` when few) and, once the current cycle\'s `anchor` has ' +
38
+ 'confirmed (the highest high after a low ruler, the lowest low after a high ruler), `zone` = that band as ' +
39
+ 'prices. ⚠️ `depth.verification.state` is `context-only`: a distribution of past moves, NOT a target or ' +
40
+ 'forecast. Use it for "has X fallen far enough for a typical weekly low?" (compare price with `zone`), never ' +
41
+ 'as an entry level. `zone` is null until the anchor confirms; a missing band says why in `depthUnavailable`.', {
34
42
  symbol: z
35
43
  .string()
36
44
  .min(1)
@@ -51,6 +59,11 @@ export function registerCycleWindowTools(server, client) {
51
59
  .optional()
52
60
  .describe('How many windows OLDER than `current` to return, newest first (0-20, default 0). Use ~10 to see ' +
53
61
  'past outcomes and judge how often this symbol\'s lows landed inside the window.'),
62
+ depth: z
63
+ .boolean()
64
+ .optional()
65
+ .describe('Add each window\'s derived price zone (`depth`, DWLF-416): the typical move into this side\'s pivots, ' +
66
+ 'and as prices from the current cycle\'s anchor. Historical context, not a target.'),
54
67
  generation: z
55
68
  .number()
56
69
  .int()
@@ -59,7 +72,7 @@ export function registerCycleWindowTools(server, client) {
59
72
  .optional()
60
73
  .describe('Detector generation to read. Omit — the API defaults to the one it stands behind ' +
61
74
  '(`generationSource` says which was used).'),
62
- }, async ({ symbol, timeframe, side, history, generation }) => {
75
+ }, async ({ symbol, timeframe, side, history, depth, generation }) => {
63
76
  try {
64
77
  const params = {
65
78
  symbol: normalizeSymbol(symbol),
@@ -71,6 +84,8 @@ export function registerCycleWindowTools(server, client) {
71
84
  params.history = String(history);
72
85
  if (generation !== undefined)
73
86
  params.generation = String(generation);
87
+ if (depth)
88
+ params.depth = '1';
74
89
  const data = await client.get('/cycles/windows', params);
75
90
  return {
76
91
  content: [{ type: 'text', text: JSON.stringify(data, null, 2) }],
@@ -1 +1 @@
1
- {"version":3,"file":"cycle-windows.js","sourceRoot":"","sources":["../../src/tools/cycle-windows.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D;;;;GAIG;AACH,MAAM,UAAU,wBAAwB,CAAC,MAAiB,EAAE,MAAkB;IAC5E,MAAM,CAAC,IAAI,CACT,wBAAwB,EACxB,yGAAyG;QACvG,uGAAuG;QACvG,6GAA6G;QAC7G,sIAAsI;QACtI,0GAA0G;QAC1G,yGAAyG;QACzG,kBAAkB;QAClB,sGAAsG;QACtG,0GAA0G;QAC1G,mGAAmG;QACnG,+LAA+L;QAC/L,wGAAwG;QACxG,4GAA4G;QAC5G,sGAAsG;QACtG,2GAA2G;QAC3G,sGAAsG;QACtG,0GAA0G;QAC1G,sGAAsG;QACtG,yGAAyG;QACzG,gBAAgB;QAChB,wGAA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,IAAI,IAAI;aAC7B,CAAC;YACF,IAAI,IAAI;gBAAE,MAAM,CAAC,IAAI,GAAG,IAAI,CAAC;YAC7B,IAAI,OAAO,KAAK,SAAS;gBAAE,MAAM,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;YAC5D,IAAI,UAAU,KAAK,SAAS;gBAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC,CAAC;YACrE,IAAI,KAAK;gBAAE,MAAM,CAAC,KAAK,GAAG,GAAG,CAAC;YAC9B,MAAM,IAAI,GAAG,MAAM,MAAM,CAAC,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,CAAC;YACzD,OAAO;gBACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC;aACjE,CAAC;QACJ,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAM;wBACZ,IAAI,EAAE,oCAAoC,MAAM,KAC9C,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CACvD,EAAE;qBACH;iBACF;aACF,CAAC;QACJ,CAAC;IACH,CAAC,CACF,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dwlf/mcp-server",
3
- "version": "0.54.2",
3
+ "version": "0.55.0",
4
4
  "description": "MCP server for DWLF market analysis platform — exposes market data, indicators, signals, strategies, backtests, portfolio, trade journal, and more as AI-accessible tools",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",