Skip to main content
Glama
@dwlf/mcp-server

@dwlf/mcp-server

by andywilliams

dwlf_get_cycle_windows

Retrieve the stored next cycle-low or cycle-high timing window for one symbol, with dated edges, gap statistics, and past outcomes on weekly or daily timeframes.

Instructions

When is the window for this symbol's next cycle pivot low (or high)? Gives the STORED cycle timing window per side — the same edges the chart draws and the screener reads — for ONE symbol, whether or not the window is open yet. Use it for "when does X's next weekly-low window open?", "when is X's next DAILY low due?" and "how many weeks since X's last weekly low, against its usual gap?". Unlike dwlf_get_cycle_setups, which only lists symbols whose weekly window is already open (and adds phase / early-mid-late for them), this answers for any symbol but carries NO phase: to say whether a window is open, overdue or missed, compare today with the dated edges below.

SHAPE: { symbol, timeframe, generation, generationSource, verification, low, high }. Each side is null when the store holds nothing for it, otherwise { symbolUsed, current, retiredAbove, history }. current is the live window: ruler (the confirmed pivot the window counts from — pivotDate, price); dated edges in order earliest (the shortest gap on record; weekly and daily — a daily one is always an estimate, extrapolated: true; null when there is none) → opens (early bound) → centre (typical) → closes (late bound) → hardMax (the last bar by which the pivot can arrive before the window is a miss), each with bars counted from the ruler and extrapolated: true when it lies beyond the last candle; gaps (the gap statistics the band was drawn from, incl. used = the inter-pivot gaps in bars, n, spreadPct); status (the store row lifecycle: projected | closed — NOT the screener's phase); calibration (calibrated = the gap chain is long enough to mean anything); provenance.projectionHash — the versioned definition of how the edges are drawn; when it changes, the edges mean something new. Closed windows in history carry an outcome — where the pivot actually landed (landedInside, daysFromOpen, …) — which is how to judge how reliable THIS symbol's windows have been.

⚠️ Read verification: while it says unverified (it does for every window as long as the detection gate stands failed), treat the edges as rough timing, not a forecast. ⚠️ The store covers WEEKLY and DAILY (daily folded from the ledger's daily lows/highs); timeframe: "1h" answers with null sides rather than a computed substitute. On daily, bars are trading candles, and an extrapolated edge's date is an estimate from average bar spacing (it can fall on a non-trading day until real bars exist).

PRICE ZONE (depth: true, DWLF-416): each window also carries depth, DERIVED at read time: how far price MOVED into this side's past pivots (pct min/p25/median/p75/max, a fall into a low or a rise into a high, over the trailing n completed cycles; thin when few) and zone = that band as prices from the current cycle's anchor: the confirmed opposite pivot (anchor.source: confirmed-pivot, pivotDate; the highest high after a low ruler, the lowest low after a high ruler) or, when none has confirmed or price has gone beyond it, the cycle's extreme SO FAR (running-extreme, barDate, not yet a confirmed pivot). zone is null when there is no anchor (a pivots-only band — anchorBasis: pivots, e.g. candles not licensed or unavailable — before the opposite pivot confirms) or no completed cycles to measure (pct null). The CURRENT window also carries reading: position of the last weekly close in the band — not-reached (short of the smallest move on record: the band does not apply yet) | shallow | in-zone (inside p25–p75: the one to call out) | deep | beyond — plus movePct, price and closeDate. An API key without raw-candle rights gets price/movePct null (priceWithheld: true), the position kept, and a pivots-only band (candlesUnavailable: not-licensed). ⚠️ depth.verification.state is context-only: a distribution of past moves: not a forecast, and no targets. Use it for "has X fallen far enough for a typical weekly low?" and nothing more. A missing band says why in depthUnavailable. For many symbols at once, dwlf_get_cycle_setups with depth: true carries the same band on each open-window row.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "symbol": "<symbol>"
    },
    "name": "dwlf_get_cycle_windows"
  }
}

Input Schema

NameRequiredDescriptionDefault
sideNoOmit for both sides. `low` = next cycle-low window (the entry timing); `high` = next top.
depthNoAdd each window's derived price zone (`depth`, DWLF-416): the typical move into this side's pivots, and as prices from the current cycle's anchor. Historical context, no targets.
symbolYesTrading symbol — accepts BTC, BTC/USD, BTC-USD, BTCUSD, or tickers like PHAU, SPY
historyNoHow many windows OLDER than `current` to include, newest first (0-20, default 0). Use ~10 to see past outcomes and judge how often this symbol's lows landed inside the window.
timeframeNoCycle timeframe (default 1w). Weekly and daily windows are stored; hourly is not.
generationNoDetector generation to read. Omit — the API defaults to the one it stands behind (`generationSource` says which was used).

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv0.77.0

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations exist, so the description carries the full burden and does: it flags `verification: unverified` as rough timing not a forecast, states the store covers only weekly/daily (1h returns null sides rather than a substitute), marks extrapolated edges as estimates that can land on non-trading days, discloses that non-licensed keys get null `price`/`movePct` with `priceWithheld`, and explains `provenance.projectionHash` versioning. This is behavior an agent could not infer from any structured field.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Front-loaded with the core question and the sibling contrast, then block-structured into SHAPE and PRICE ZONE sections, which helps. But the wall of text is very long for a 6-parameter tool, and the PRICE ZONE paragraph packs many nested caveats (anchor fallbacks, pivots-only bands, withheld prices) that could be compressed into a shorter list without losing meaning.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

There is no output schema, so the description is the only source of return-value semantics, and it delivers: the response shape, the null-side rule, every dated edge in order, `status` vs. the screener's `phase`, `calibration`, and the full `depth`/`zone`/`reading` structure. Nothing an agent needs to interpret the response is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, and the description goes beyond it: it explains the `1h` enum value's null-side outcome, what `history` older-window entries contain (`outcome`, `landedInside`, `daysFromOpen`) and why to set it to ~10, and what `depth: true` derives. Only `side` and `generation` are covered mostly by the schema itself.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

States a specific question it answers ('when is the window for this symbol's next cycle pivot low or high?') plus a concrete resource ('STORED cycle timing window per side'), and explicitly contrasts with `dwlf_get_cycle_setups` (which only lists open weekly windows and adds `phase`). An agent can pick between them without opening either schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Gives three literal example phrasings ('when does X's next weekly-low window open?', 'when is X's next DAILY low due?', 'how many weeks since X's last weekly low'), names the alternative and the exact condition that selects it, and adds a batching rule pointing to `dwlf_get_cycle_setups` for many symbols. Explicit when-to-use and when-to-use-something-else.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Deploy Server

Other Tools