@dwlf/mcp-server 0.64.1 → 0.66.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.
@@ -0,0 +1,20 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Block-profile tool wording (DWLF-835; Andy, 12-Nov-2026 17:53). Block describes conditions, never calls, and
4
+ * its profile has no strategies, strategy signals or backtests. A shared tool whose `full` description speaks of
5
+ * strategy entries/exits, stop-losses, backtests or "triggers" gets its Block wording here; `profiledServer` sends it
6
+ * in place of the shared one when the profile is `block`. The shared description, which retail still uses, is unchanged.
7
+ * Parameters say things too, so a tool can also have its Block input schema (BLOCK_SCHEMAS: strategy-only parameters
8
+ * removed, wording changed) and, where its OUTPUT would carry strategy nodes, a Block handler (BLOCK_HANDLERS).
9
+ * A test reads what the built server actually lists under `--profile block` and keeps all of it free of that
10
+ * vocabulary and of references to tools Block hides.
11
+ */
12
+ type Shape = Record<string, z.ZodTypeAny>;
13
+ type Handler = (args: Record<string, unknown>, extra: unknown) => unknown;
14
+ /** A string replaces the shared description; a function rewrites it (for a one-phrase change). */
15
+ export declare const BLOCK_DESCRIPTIONS: Readonly<Record<string, string | ((shared: string) => string)>>;
16
+ /** Block input schemas: each takes the shared shape and returns Block's. */
17
+ export declare const BLOCK_SCHEMAS: Readonly<Record<string, (shared: Shape) => Shape>>;
18
+ export declare const BLOCK_HANDLERS: Readonly<Record<string, (shared: Handler) => Handler>>;
19
+ export {};
20
+ //# sourceMappingURL=blockDescriptions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockDescriptions.d.ts","sourceRoot":"","sources":["../src/blockDescriptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;GASG;AACH,KAAK,KAAK,GAAG,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,UAAU,CAAC,CAAC;AAC1C,KAAK,OAAO,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,EAAE,OAAO,KAAK,OAAO,CAAC;AAE1E,kGAAkG;AAClG,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,KAAK,MAAM,CAAC,CAAC,CAoE7F,CAAC;AAWH,4EAA4E;AAC5E,eAAO,MAAM,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,KAAK,KAAK,KAAK,CAAC,CAqB3E,CAAC;AAOH,eAAO,MAAM,cAAc,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,CAehF,CAAC"}
@@ -0,0 +1,123 @@
1
+ import { z } from 'zod';
2
+ /** A string replaces the shared description; a function rewrites it (for a one-phrase change). */
3
+ export const BLOCK_DESCRIPTIONS = Object.freeze({
4
+ dwlf_update_subscription: 'Update an existing alert subscription (PATCH). Only the fields you supply change; everything else is kept. ' +
5
+ 'Most used: toggle `enabled` to pause/resume without losing the subscription\'s history. Editable fields: enabled, ' +
6
+ 'symbols, timeframes, channels, quietHours, dedupeWindowMinutes, and customEventId (custom_event subscriptions ' +
7
+ 'only). `eventTypeId` is NOT patchable: switching what an alert listens for means delete + recreate.',
8
+ dwlf_get_ranges: (shared) => shared.replace(' "at the TOP of the range — think twice about entering here",', ' "at the TOP of the range",'),
9
+ dwlf_create_subscription: 'Create an alert subscription: get told when an event fires. Two shapes, distinguished by `eventTypeId`:\n' +
10
+ ' - any event id (e.g. `onchain.mvrv.cross_above_1`, `cycle.low.confirmed`, `swing_low_break`): fires when that event is recorded;\n' +
11
+ ' - `custom_event`: requires `customEventId`; fires when that custom event fires.\n\n' +
12
+ '`symbols` controls scope: an array of symbols, or `[\'*\']` for every symbol the account follows. `timeframes` accepts ' +
13
+ '`[\'1d\']`, `[\'1w\']`, or `[\'*\']` for any. `channels` is an array of delivery destinations, currently ' +
14
+ '`{ type: \'telegram\', destination: { chatId: <id> }, enabled: true }`. An alert says what happened and when; it is ' +
15
+ 'not a recommendation. A plan limits how many alerts an account may have, and which event families it may alert on.',
16
+ dwlf_describe_strategy_nodes: 'Describe the nodes a custom event is built from: condition nodes (what each one checks, its parameters and their ' +
17
+ 'engine defaults) and the logic gates that combine them (and/or/not/then). Optional `nodeType` filters to one node; ' +
18
+ '`category: "condition"` or `"logic"` lists one kind in full. Indicator/event condition nodes come from the platform\'s node catalogue (GET /v2/node-types, cached up to 15 ' +
19
+ 'minutes; an unfiltered call lists them by name, ask by nodeType or category "condition" for detail), marked ' +
20
+ '`source: "catalogue"` with `label`, `direction`, `timeframes` (the only ones the node fires on) and ' +
21
+ '`catalogueCategory`. When `honoredByExecutor: false` on a param, the listed `default` is the only value the engine ' +
22
+ 'uses; `honoredByExecutor: null` means not verified (the parameter reaches the compiled event; its effect is not ' +
23
+ 'checked here). A node with `engineIgnored` is one the engine cannot evaluate: do not use it. `engineIgnores` is the raw rule ' +
24
+ 'list ({ id } or { prefix }, with a reason). `catalogueError` means the catalogue could not be read and only the ' +
25
+ 'static nodes are listed.',
26
+ dwlf_create_custom_event: '⚠️ Create a new custom event (a condition you define, recorded each time it holds). WORKFLOW: 1) create → 2) compile ' +
27
+ '→ 3) MUST call dwlf_activate_event_symbols (or the event will never fire) → 4) dwlf_evaluate_custom_event to fill ' +
28
+ 'its history. Until symbols are activated the event exists but the evaluation engine does not see it, so it records ' +
29
+ 'nothing. Activate symbols straight after creating it.',
30
+ dwlf_evaluate_custom_event: '⚠️ Trigger an on-demand evaluation run for a custom event: the step BETWEEN activating symbols and reading its fires. ' +
31
+ 'Without it the event only evaluates on the daily run, and its history is not filled until then. Returns ' +
32
+ '{ requestId, status: "pending" }; poll dwlf_get_evaluation_status(requestId) until status is "completed", then read ' +
33
+ 'the fires via dwlf_get_events(type: "custom_event"). Consumes one EVALUATION quota. By default only the most recent ' +
34
+ '~400 candles (~14 months of daily data) are evaluated, so older history has NO fires: to fill a longer history pass ' +
35
+ '`lookbackDays` covering it (e.g. 2200 for ~5-6 years).',
36
+ dwlf_activate_event_symbols: '⚠️ REQUIRED STEP after creating a custom event: activate (enable) symbols for it. An event does NOT evaluate until ' +
37
+ 'symbols are activated: the daily run skips it and it records no fires. If an event shows no fires, check this step ' +
38
+ 'first. Call straight after compiling an event.',
39
+ dwlf_get_evaluation_status: 'Get the status and result summary of an evaluation by requestId. Poll this after dwlf_evaluate_custom_event until ' +
40
+ 'status === "completed". ⚠️ `summary.totalItems` / `summary.processedItems` count evaluation-JOB items (one per ' +
41
+ 'custom event), NOT the symbols inside the job: an evaluation across 37 symbols shows `totalItems: 1, ' +
42
+ 'processedItems: 1` when done. When the request named symbols this tool adds `symbolsRequested: <count>` beside the ' +
43
+ 'summary. When status is "completed", read the fires via dwlf_get_events(type: "custom_event").',
44
+ dwlf_register_agent: 'Programmatically register a new DWLF account: no browser or Google sign-in required. Returns an API key ' +
45
+ 'immediately. Email verification unlocks the compute features (custom event evaluations). Useful for onboarding ' +
46
+ 'flows where an agent registers itself.',
47
+ dwlf_get_cycle_setups: 'The cycle screener: across the symbols DWLF tracks, which have their WEEKLY cycle timing window open, and whether a ' +
48
+ 'DAILY cycle pivot has confirmed inside it, for lows and highs alike. Stages: `confirmed_setup` (weekly window open ' +
49
+ 'AND a daily pivot confirmed within 15 days), `awaiting_confirmation` (daily pivot provisional, confidence % ' +
50
+ 'included), `window_open` (window open, no daily pivot yet). Each row: weekly window position (early/mid/late + ' +
51
+ 'days since the last pivot), `weekly.timing`, the daily pivot\'s price/confidence/age, last close and % from the ' +
52
+ 'pivot. The counts per side describe how many symbols are in each state; they are a description, not a forecast. ' +
53
+ '`weekly.timing` is the STORED weekly window, the same edges the chart draws: `earliest`, `opens`, `closes`, ' +
54
+ '`hardMax` (dated edges), `phase` (upcoming | open | overdue | missed), `n`, `calibration`, `verification` (always ' +
55
+ '`unverified` while the detection gate stands failed), `rulerAgreesWithState`, `generation` and `projectionHash`; ' +
56
+ 'null when no window is stored for the series. ⚠️ A symbol whose weekly window is not yet open is ABSENT from every ' +
57
+ 'list: for its window dates call `dwlf_get_cycle_windows`. DEPTH (`depth: true`): each row also carries `depth`, ' +
58
+ 'its weekly window\'s price band from past cycles\' moves (the same object `dwlf_get_cycle_windows` returns), and ' +
59
+ '`depth.reading.position` places the last weekly close: `in-zone` (inside the p25–p75 of past moves), `shallow` / ' +
60
+ '`deep` / `beyond`, or `not-reached`. It is context, not a target, and it does not change the stage or the order. ' +
61
+ 'A missing band says why in `depthUnavailable`. Everything here is a dated state of the cycle engine, not a call.',
62
+ });
63
+ const BLOCK_EVENT_TYPE_ID = 'What fires the alert: an event id (e.g. `onchain.mvrv.cross_above_1`, `cycle.low.confirmed`), or ' +
64
+ '`custom_event` with `customEventId`.';
65
+ const withoutStrategyParams = (shape, eventTypeId) => {
66
+ const { strategyId: _a, mode: _b, riskPerTradeOverride: _c, accountBalanceOverride: _d, maxConcurrentTradesOverride: _e, ...rest } = shape;
67
+ void _a;
68
+ void _b;
69
+ void _c;
70
+ void _d;
71
+ void _e;
72
+ return eventTypeId && rest.eventTypeId ? { ...rest, eventTypeId } : rest;
73
+ };
74
+ /** Block input schemas: each takes the shared shape and returns Block's. */
75
+ export const BLOCK_SCHEMAS = Object.freeze({
76
+ dwlf_create_subscription: (shared) => withoutStrategyParams(shared, z.string().describe(BLOCK_EVENT_TYPE_ID)),
77
+ dwlf_update_subscription: (shared) => withoutStrategyParams(shared),
78
+ dwlf_evaluate_custom_event: (shared) => ({
79
+ ...shared,
80
+ lookbackDays: z.number().int().positive().optional().describe('How many days of history to (re)evaluate, overriding the ' +
81
+ 'default ~400-candle (~14-month) window. Set it to cover the whole history you want the event\'s fires for.'),
82
+ }),
83
+ dwlf_get_cycle_windows: (shared) => ({
84
+ ...shared,
85
+ side: z.enum(['low', 'high']).optional().describe('Omit for both sides. `low` = the next cycle-low window; `high` = the next cycle-high window.'),
86
+ }),
87
+ dwlf_get_evaluation_status: (shared) => ({
88
+ ...shared,
89
+ requestId: z.string().describe('Evaluation request ID returned by dwlf_evaluate_custom_event'),
90
+ }),
91
+ dwlf_describe_strategy_nodes: (shared) => ({
92
+ ...shared,
93
+ nodeType: z.string().optional().describe('Return only this one node (a condition or a logic gate, by its node type id).'),
94
+ category: z.enum(['condition', 'logic']).optional().describe('`condition` (indicator and event conditions) or `logic` (the and/or/not/then gates that combine them).'),
95
+ }),
96
+ });
97
+ // What a Block custom event is built from: condition nodes and the logic gates that combine them (and/or/not/then).
98
+ // Entry signals, stop-losses, take-profits, exits and cancellations are strategy nodes, which Block does not have.
99
+ const BLOCK_NODE_CATEGORIES = new Set(['condition', 'logic']);
100
+ export const BLOCK_HANDLERS = Object.freeze({
101
+ // The shared answer (brief by default, in full for a category or a nodeType), with strategy nodes taken out. A
102
+ // nodeType lookup that finds only a strategy node is refused rather than described.
103
+ dwlf_describe_strategy_nodes: (shared) => async (args, extra) => {
104
+ const res = (await shared(args, extra));
105
+ if (res.isError) {
106
+ return res;
107
+ }
108
+ let parsed;
109
+ try {
110
+ parsed = JSON.parse(res.content?.[0]?.text ?? '{}');
111
+ }
112
+ catch {
113
+ return res;
114
+ }
115
+ const nodes = (parsed.nodes ?? []).filter((n) => BLOCK_NODE_CATEGORIES.has(String(n.category)));
116
+ if (args.nodeType && nodes.length === 0) {
117
+ return { isError: true, content: [{ type: 'text', text: JSON.stringify({ error: `Not a custom-event node: ${String(args.nodeType)}`,
118
+ hint: 'Block custom events are built from condition nodes and logic gates; call with no arguments to list them.' }, null, 2) }] };
119
+ }
120
+ return { content: [{ type: 'text', text: JSON.stringify({ ...parsed, count: nodes.length, nodes }, null, 2) }] };
121
+ },
122
+ });
123
+ //# sourceMappingURL=blockDescriptions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"blockDescriptions.js","sourceRoot":"","sources":["../src/blockDescriptions.ts"],"names":[],"mappings":"AA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AAG,CAAC;QAAC,CAAC;QAClF,MAAM,KAAK,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAqB,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC;QAChG,IAAI,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACxC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,4BAA4B,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,EAAE;4BACjI,IAAI,EAAE,0GAA0G,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;QACtI,CAAC;QACD,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC;IACnH,CAAC;CACF,CAAC,CAAC"}
@@ -1,13 +1,14 @@
1
1
  import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
2
  /**
3
3
  * Tool profiles (DWLF-621). `full` (the default) registers every tool, exactly as before. `block` registers the
4
- * curated subset for Bitcoin users of block.dwlf: conditions, on-chain events, custom events, strategies,
5
- * backtests, alerts and the academy. A Block user's agent then doesn't see ~100 retail and metals tools.
4
+ * curated subset for Bitcoin users of block.dwlf: conditions, on-chain events, custom events, alerts and the
5
+ * academy (no strategy signals, strategies or backtests: DWLF-835). A Block user's agent then doesn't see ~100 retail and metals tools.
6
6
  *
7
7
  * Selected by `--profile <name>` or `DWLF_TOOL_PROFILE`; the flag wins. An unknown name is a startup error, never a
8
8
  * silent fallback to `full`: an agent configured for Block must not quietly get the whole catalogue.
9
9
  *
10
- * A profile only HIDES tools. Every request still goes through the same API key and the same backend
10
+ * A profile HIDES tools and, for `block`, rewords some (description, input schema, and the node catalogue's answer:
11
+ * src/blockDescriptions.ts, DWLF-835). Every request still goes through the same API key and the same backend
11
12
  * permissions, quotas and licensing, so a profile is never a security boundary.
12
13
  */
13
14
  export type ProfileName = 'full' | 'block';
@@ -17,7 +18,7 @@ export declare const PROFILE_INSTRUCTIONS: Record<ProfileName, string | null>;
17
18
  /** The profile named by `--profile X` / `--profile=X`, else `DWLF_TOOL_PROFILE`, else `full`. Throws on an unknown name. */
18
19
  export declare function resolveProfile(argv: readonly string[], env: Record<string, string | undefined>): ProfileName;
19
20
  /**
20
- * A view of `server` that registers only the profile's tools. Resources, prompts and everything else pass
21
+ * A view of `server` that registers only the profile's tools, and for `block` sends their Block wording (blockArgs). Resources, prompts and everything else pass
21
22
  * through unchanged. `registered` collects every tool name offered, including the hidden ones, so a test can
22
23
  * check that each profile tool exists.
23
24
  */
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../src/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE;;;;;;;;;;GAUG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAM3C,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,CAiE1C,CAAC;AAIH,sFAAsF;AACtF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAcnE,CAAC;AAEF,4HAA4H;AAC5H,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,WAAW,CAgB5G;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,GAAE,GAAG,CAAC,MAAM,CAAa,GAAG,SAAS,CAgBtH"}
1
+ {"version":3,"file":"profiles.d.ts","sourceRoot":"","sources":["../src/profiles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAGpE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,CAAC;AAM3C,eAAO,MAAM,WAAW,EAAE,WAAW,CAAC,MAAM,CAoD1C,CAAC;AAIH,sFAAsF;AACtF,eAAO,MAAM,oBAAoB,EAAE,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAcnE,CAAC;AAEF,4HAA4H;AAC5H,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GAAG,WAAW,CAgB5G;AAwBD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,GAAE,GAAG,CAAC,MAAM,CAAa,GAAG,SAAS,CAgBtH"}
package/dist/profiles.js CHANGED
@@ -1,3 +1,4 @@
1
+ import { BLOCK_DESCRIPTIONS, BLOCK_SCHEMAS, BLOCK_HANDLERS } from './blockDescriptions.js';
1
2
  // Profile names are a published contract (server.json `choices`, client configs in docs/BLOCK.md): a name is never
2
3
  // removed. A retired or split profile keeps its old name as an alias here, mapped to its successor.
3
4
  const PROFILE_ALIASES = {};
@@ -15,6 +16,8 @@ export const BLOCK_TOOLS = new Set([
15
16
  'dwlf_get_market_data',
16
17
  'dwlf_get_support_resistance',
17
18
  'dwlf_get_cycle_setups',
19
+ // The divergence scan (DWLF-791/797/798): dated events with confluence layers; the API gates it as the cycles family.
20
+ 'dwlf_get_divergences',
18
21
  // dwlf_get_intelligence is not here: it is a DWLF retail read (any symbol, families mixed), and a Block account's key
19
22
  // is refused it (SPT block/keyRoutePolicy, 403 NOT_ON_BLOCK; tier matrix decision D). dwlf_get_conditions covers BTC.
20
23
  // Technical analysis reads, for BTCOC/USD above all (DWLF-722): trend lines with their anchors, the stored daily
@@ -37,24 +40,9 @@ export const BLOCK_TOOLS = new Set([
37
40
  'dwlf_deactivate_event_symbols',
38
41
  'dwlf_get_event_symbols',
39
42
  'dwlf_get_custom_event_notifications',
40
- // Strategies and backtests
41
- 'dwlf_list_strategies',
42
- 'dwlf_get_strategy',
43
- 'dwlf_create_strategy',
44
- 'dwlf_update_strategy',
45
- 'dwlf_compile_strategy',
46
- 'dwlf_delete_strategy',
47
- 'dwlf_evaluate_strategy',
48
- 'dwlf_get_recent_signals',
49
- 'dwlf_activate_strategy_symbols',
50
- 'dwlf_deactivate_strategy_symbols',
51
- 'dwlf_get_strategy_symbols',
52
- 'dwlf_run_backtest',
53
- 'dwlf_get_backtest_results',
54
- 'dwlf_get_backtest_summary',
55
- 'dwlf_list_backtests',
56
- 'dwlf_cancel_backtest',
57
- 'dwlf_delete_backtest',
43
+ // NOT in Block (Andy, 12-Nov-2026 17:53, DWLF-835): strategy signals, strategies and backtests, with their
44
+ // signal/entry/exit vocabulary. Block describes conditions, never calls; they stay in `full` and are revisited for
45
+ // Block with the builder in v1.1.
58
46
  // Alerts
59
47
  'dwlf_list_subscriptions',
60
48
  'dwlf_create_subscription',
@@ -107,7 +95,29 @@ export function resolveProfile(argv, env) {
107
95
  throw new Error(`Unknown DWLF tool profile "${raw}". Use one of: ${Object.keys(PROFILES).join(', ')}.`);
108
96
  }
109
97
  /**
110
- * A view of `server` that registers only the profile's tools. Resources, prompts and everything else pass
98
+ * A shared tool's registration as the Block profile sends it (DWLF-835): its Block description, input schema and
99
+ * handler where it has them. Registrations are `server.tool(name, description, shape, handler)`; any other form is
100
+ * refused here rather than passed through unchanged, so an override can never be silently skipped.
101
+ */
102
+ function blockArgs(name, args) {
103
+ const text = BLOCK_DESCRIPTIONS[name];
104
+ const schema = BLOCK_SCHEMAS[name];
105
+ const handler = BLOCK_HANDLERS[name];
106
+ if (text === undefined && schema === undefined && handler === undefined)
107
+ return args;
108
+ if (args.length !== 4 || typeof args[1] !== 'string' || typeof args[2] !== 'object' || typeof args[3] !== 'function') {
109
+ throw new Error(`${name}: has Block wording, but is not registered as tool(name, description, shape, handler)`);
110
+ }
111
+ const [, description, shape, fn] = args;
112
+ return [
113
+ name,
114
+ typeof text === 'function' ? text(description) : (text ?? description),
115
+ schema ? schema(shape) : shape,
116
+ handler ? handler(fn) : fn,
117
+ ];
118
+ }
119
+ /**
120
+ * A view of `server` that registers only the profile's tools, and for `block` sends their Block wording (blockArgs). Resources, prompts and everything else pass
111
121
  * through unchanged. `registered` collects every tool name offered, including the hidden ones, so a test can
112
122
  * check that each profile tool exists.
113
123
  */
@@ -121,7 +131,7 @@ export function profiledServer(server, profile, registered = new Set()) {
121
131
  registered.add(name);
122
132
  if (allowed && !allowed.has(name))
123
133
  return undefined;
124
- return target.tool.apply(target, args);
134
+ return target.tool.apply(target, profile === 'block' ? blockArgs(name, args) : args);
125
135
  };
126
136
  }
127
137
  const value = Reflect.get(target, prop, receiver);
@@ -1 +1 @@
1
- {"version":3,"file":"profiles.js","sourceRoot":"","sources":["../src/profiles.ts"],"names":[],"mappings":"AAeA,mHAAmH;AACnH,oGAAoG;AACpG,MAAM,eAAe,GAAgC,EAAE,CAAC;AAExD,MAAM,CAAC,MAAM,WAAW,GAAwB,IAAI,GAAG,CAAC;IACtD,yBAAyB;IACzB,qBAAqB;IACrB,8BAA8B;IAC9B,oBAAoB;IACpB,iBAAiB;IACjB,iBAAiB;IACjB,gBAAgB;IAChB,wBAAwB;IACxB,gBAAgB;IAChB,wBAAwB;IACxB,sBAAsB;IACtB,6BAA6B;IAC7B,uBAAuB;IACvB,sHAAsH;IACtH,sHAAsH;I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AAC,CAAC,CAAC,CAAC;oBAC7B,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;oBACrB,IAAI,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC;wBAAE,OAAO,SAAS,CAAC;oBACpD,OAAQ,MAAM,CAAC,IAAqC,CAAC,KAAK,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;gBACzH,CAAC,CAAC;YACJ,CAAC;YACD,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,QAAQ,CAAC,CAAC;YAClD,OAAO,OAAO,KAAK,KAAK,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC;QAClE,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA8BzC,qGAAqG;AACrG,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAmDvE"}
1
+ {"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AA+BzC,qGAAqG;AACrG,wBAAgB,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAoDvE"}
package/dist/register.js CHANGED
@@ -2,6 +2,7 @@ import { registerMarketDataTools } from './tools/market-data.js';
2
2
  import { registerRangeTools } from './tools/ranges.js';
3
3
  import { registerCycleSetupTools } from './tools/cycle-setups.js';
4
4
  import { registerCycleWindowTools } from './tools/cycle-windows.js';
5
+ import { registerDivergenceTools } from './tools/divergences.js';
5
6
  import { registerStageTools } from './tools/stages.js';
6
7
  import { registerConditionsTools } from './tools/conditions.js';
7
8
  import { registerIndicatorTools } from './tools/indicators.js';
@@ -32,6 +33,7 @@ export function registerAll(server, client) {
32
33
  registerRangeTools(server, client);
33
34
  registerCycleSetupTools(server, client);
34
35
  registerCycleWindowTools(server, client);
36
+ registerDivergenceTools(server, client);
35
37
  registerStageTools(server, client);
36
38
  registerConditionsTools(server, client);
37
39
  registerIndicatorTools(server, client);
@@ -1 +1 @@
1
- {"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,EAAE,wBAAwB,EAAE,MAAM,0BAA0B,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,EAAE,sBAAsB,EAAE,MAAM,uBAAuB,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,qBAAqB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAA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AC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEvC,4EAA4E;IAC5E,6BAA6B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE9C,sDAAsD;IACtD,sBAAsB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEvC,+DAA+D;IAC/D,oBAAoB,CAAC,MAAM,CAAC,CAAC;IAE7B,qGAAqG;IACrG,qBAAqB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAEtC,uEAAuE;IACvE,oBAAoB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAErC,gGAAgG;IAChG,yBAAyB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAE1C,qBAAqB;IACrB,uBAAuB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAExC,qIAAqI;IACrI,6BAA6B,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,yBAAyB,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC5C,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
2
+ import { DWLFClient } from '../client.js';
3
+ /**
4
+ * The divergence scan (DWLF-791, with DWLF-797 confluence, DWLF-798 timeframes and DWLF-818 the fib layer): one read of
5
+ * `GET /v2/screener/divergences`, passed through as the API answers (charter invariant 2). The API composes every
6
+ * item's `summary`, `chartUrl`, `why` and the `definitions`, so the wording an agent quotes is the same the DWLF pages
7
+ * show. This tool only maps its arguments onto the query.
8
+ */
9
+ export declare const CONFLUENCE_LAYERS: readonly ["cycle", "smc", "tl", "weekly", "fib"];
10
+ export declare const DEFAULT_LIMIT = 50;
11
+ export declare function registerDivergenceTools(server: McpServer, client: DWLFClient): void;
12
+ //# sourceMappingURL=divergences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divergences.d.ts","sourceRoot":"","sources":["../../src/tools/divergences.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AAEpE,OAAO,EAAE,UAAU,EAAmB,MAAM,cAAc,CAAC;AAE3D;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,kDAAmD,CAAC;AAClF,eAAO,MAAM,aAAa,KAAK,CAAC;AAEhC,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,UAAU,GAAG,IAAI,CAwEnF"}
@@ -0,0 +1,91 @@
1
+ import { z } from 'zod';
2
+ import { normalizeSymbol } from '../client.js';
3
+ /**
4
+ * The divergence scan (DWLF-791, with DWLF-797 confluence, DWLF-798 timeframes and DWLF-818 the fib layer): one read of
5
+ * `GET /v2/screener/divergences`, passed through as the API answers (charter invariant 2). The API composes every
6
+ * item's `summary`, `chartUrl`, `why` and the `definitions`, so the wording an agent quotes is the same the DWLF pages
7
+ * show. This tool only maps its arguments onto the query.
8
+ */
9
+ export const CONFLUENCE_LAYERS = ['cycle', 'smc', 'tl', 'weekly', 'fib'];
10
+ export const DEFAULT_LIMIT = 50;
11
+ export function registerDivergenceTools(server, client) {
12
+ server.tool('dwlf_get_divergences', 'Recent price/oscillator DIVERGENCES across every symbol DWLF tracks: dated events that happened, not signals. ' +
13
+ 'A divergence compares two consecutive confirmed cycle pivots: a `regular` one is price making a lower low (or a ' +
14
+ 'higher high) while RSI(14) or DSS does not; a `hidden` one is the reverse, a pullback inside the trend. ' +
15
+ 'Bullish = measured at lows, bearish = at highs.\n\n' +
16
+ 'FILTERS: `days` (1-365, default 30) windows the later pivot\'s date; `oscillator` (rsi | dss), `kind` (regular | ' +
17
+ 'hidden), `direction` (bullish | bearish), `symbols` (restrict to these), `limit` (1-500; this tool sends ' +
18
+ `${DEFAULT_LIMIT} unless you set it), \`timeframe\` (daily, the default | weekly | all), \`includeRetired\` (also ` +
19
+ 'return divergences whose pivot the cycle ledger later superseded; by default they are left out and counted in ' +
20
+ '`retiredOmitted`).\n' +
21
+ 'CONFLUENCE: `confluence` names the layers to check around each divergence: `cycle` (a confirmed daily cycle low ' +
22
+ 'or high near the pivot, and whether it sits in the weekly window), `smc` (Smart Money Concepts events), `tl` (a ' +
23
+ 'trendline break), `weekly` (a weekly divergence agrees), `fib` (a cycle fib level). `confluenceDays` (1-30 bars, ' +
24
+ 'default 10) is the window; `minLayers` keeps only items matching at least that many layers (filtered by the API). ' +
25
+ 'Each item then carries `confluence: { matched, layers, … }`: a layer not requested is null, requested and absent ' +
26
+ 'is `{ matched: false }`, and a matched layer lists its dated events and a one-line `why`. Passing `timeframe` or ' +
27
+ '`confluence` returns `responseVersion: 2`, which always includes `definitions` (stable wording you can quote); ' +
28
+ '`explain: true` adds them to the plain read.\n\n' +
29
+ 'READING IT: each item has `summary` (one plain sentence, the DWLF page\'s own wording: use it), both pivots\' ' +
30
+ 'dates, prices and oscillator readings, `knowableAt` (when it could first be known: never imply it was visible ' +
31
+ 'earlier) and `chartUrl`. When the user wants to see one, give them its `chartUrl`. `cyclePivot.ledgerState` ' +
32
+ '`unknown` or `missing` means the pivot is unverified, not confirmed. A divergence is something that happened on ' +
33
+ 'the chart, not a recommendation: never present one, or a confluence of layers, as a reason to buy or sell. ' +
34
+ '`truncated: true` means more matched than were returned. A key whose plan lacks the cycles family gets a teaser ' +
35
+ '(`locked: true`, `newThisWeek`, `requiredPlan`, `pricingUrl`) and no items: tell your human what unlocks it.', {
36
+ days: z.number().int().min(1).max(365).optional().describe('Window on the later pivot\'s date, in days (default 30).'),
37
+ oscillator: z.enum(['rsi', 'dss']).optional().describe('RSI(14) or DSS.'),
38
+ kind: z.enum(['regular', 'hidden']).optional().describe('`regular` (against the move) or `hidden` (a pullback inside the trend).'),
39
+ direction: z.enum(['bullish', 'bearish']).optional().describe('Bullish = measured at lows; bearish = at highs.'),
40
+ symbols: z.array(z.string()).optional().describe('Restrict to these symbols (any spelling, e.g. "BTC/USD", "aapl").'),
41
+ limit: z.number().int().min(1).max(500).optional().describe(`How many items at most (default ${DEFAULT_LIMIT} here).`),
42
+ timeframe: z.enum(['daily', 'weekly', 'all']).optional().describe('Daily pivots (default), weekly, or both.'),
43
+ confluence: z.array(z.enum(CONFLUENCE_LAYERS)).optional().describe('Layers to check around each divergence.'),
44
+ confluenceDays: z.number().int().min(1).max(30).optional().describe('The confluence window in bars (weekly: weeks); default 10.'),
45
+ minLayers: z.number().int().min(0).max(CONFLUENCE_LAYERS.length).optional()
46
+ .describe('Keep only items matching at least this many of the requested layers. Needs `confluence`.'),
47
+ includeRetired: z.boolean().optional().describe('Also return divergences on pivots the cycle ledger later superseded.'),
48
+ explain: z.boolean().optional().describe('Add `definitions` to a plain (version 1) read; version 2 always has them.'),
49
+ }, async (args) => {
50
+ const layers = [...new Set(args.confluence ?? [])];
51
+ if (args.minLayers !== undefined && args.minLayers > layers.length) {
52
+ return { isError: true, content: [{ type: 'text', text: layers.length
53
+ ? `minLayers (${args.minLayers}) is more than the ${layers.length} distinct layer(s) requested in \`confluence\`.`
54
+ : 'minLayers needs `confluence`: name the layers to count.' }] };
55
+ }
56
+ const params = { limit: String(args.limit ?? DEFAULT_LIMIT) };
57
+ if (args.days !== undefined)
58
+ params.days = String(args.days);
59
+ if (args.oscillator)
60
+ params.oscillator = args.oscillator;
61
+ if (args.kind)
62
+ params.kind = args.kind;
63
+ if (args.direction)
64
+ params.direction = args.direction;
65
+ if (args.symbols && args.symbols.length)
66
+ params.symbols = args.symbols.map((s) => normalizeSymbol(s)).join(',');
67
+ if (args.timeframe)
68
+ params.timeframe = args.timeframe;
69
+ if (layers.length)
70
+ params.confluence = layers.join(',');
71
+ if (args.confluenceDays !== undefined)
72
+ params.confluenceDays = String(args.confluenceDays);
73
+ if (args.minLayers !== undefined)
74
+ params.minLayers = String(args.minLayers);
75
+ if (args.includeRetired !== undefined)
76
+ params.includeRetired = String(args.includeRetired);
77
+ if (args.explain !== undefined)
78
+ params.explain = String(args.explain);
79
+ try {
80
+ const data = await client.get('/screener/divergences', params);
81
+ return { content: [{ type: 'text', text: JSON.stringify(data, null, 2) }] };
82
+ }
83
+ catch (error) {
84
+ return {
85
+ isError: true,
86
+ content: [{ type: 'text', text: `Error fetching divergences: ${error instanceof Error ? error.message : String(error)}` }],
87
+ };
88
+ }
89
+ });
90
+ }
91
+ //# sourceMappingURL=divergences.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"divergences.js","sourceRoot":"","sources":["../../src/tools/divergences.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAc,eAAe,EAAE,MAAM,cAAc,CAAC;AAE3D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,CAAU,CAAC;AAClF,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAAC;AAEhC,MAAM,UAAU,uBAAuB,CAAC,MAAiB,EAAE,MAAkB;IAC3E,MAAM,CAAC,IAAI,CACT,sBAAsB,EACtB,gHAAgH;QAC9G,kHAAkH;QAClH,0GAA0G;QAC1G,qDAAqD;QACrD,mHAAmH;QACnH,2GAA2G;QAC3G,GAAG,aAAa,mGAAmG;QACnH,gHAAgH;QAChH,sBAAsB;QACtB,kHAAkH;QAClH,kHAAkH;QAClH,mHAAmH;QACnH,oHAAoH;QACpH,mHAAmH;QACnH,mHAAmH;QACnH,iHAAiH;QACjH,kDAAkD;QAClD,gHAAgH;QAChH,gHAAgH;QAChH,8GAA8G;QAC9G,kHAAkH;QAClH,6GAA6G;QAC7G,kHAAkH;QAClH,8GAA8G,EAChH;QACE,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,0DAA0D,CAAC;QACtH,UAAU,EAAE,CAAC,CAAC,IAAI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AE,IAAI;gBACb,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,+BAA+B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,EAAE,CAAC;aAC3H,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.64.1",
3
+ "version": "0.66.0",
4
4
  "mcpName": "uk.co.dwlf/mcp-server",
5
5
  "description": "MCP server for DWLF market analysis platform — exposes market data, indicators, signals, strategies, backtests, portfolio, trade journal, and more as AI-accessible tools",
6
6
  "type": "module",
@@ -18,7 +18,8 @@
18
18
  "start": "node dist/index.js",
19
19
  "dev": "tsx src/index.ts",
20
20
  "prepublishOnly": "npm run build",
21
- "test": "npm run build && node --test test/*.test.mjs"
21
+ "test": "npm run build && node --test test/*.test.mjs",
22
+ "eval": "npm run build && node eval/run.mjs"
22
23
  },
23
24
  "keywords": [
24
25
  "mcp",
@@ -53,6 +54,7 @@
53
54
  "zod": "^4.3.6"
54
55
  },
55
56
  "devDependencies": {
57
+ "@anthropic-ai/sdk": "^1.8.0",
56
58
  "@types/node": "^25.1.0",
57
59
  "tsx": "^4.21.0",
58
60
  "typescript": "^5.9.3"