HTX Wait For Market Event
htx_wait_for_market_eventWait until market prices or indicators meet declarative conditions or the timeout expires. Set any/all match rules to pause until your target price or indicator threshold is reached, then return compact evidence.
Instructions
Block until bounded declarative market conditions match or the timeout expires.
This safe MCP wait primitive performs read-only calls, executes no caller-supplied code, has a fixed deadline, and returns compact evidence. A future WebSocket market daemon can satisfy the identical contract.
Important: while this call is pending, the agent receives no intermediate
market updates and cannot react to them. For an uninterrupted wait, set
the outer host yield_time_ms longer than timeout_seconds * 1000
(with response margin) and set the host tool deadline longer still. The
MCP result then becomes the sole wake-up source; then re-check market
snapshots after every return.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| match | No | Wake when any condition matches, or only when all match. | any |
| product | No | ||
| conditions | Yes | Declarative conditions to wait for. Each condition may override product and instrument, allowing independent markets in one wait. A condition checks last_price or a supported technical indicator (for example indicator='rsi:14' or 'macd:12,26,9' with component='histogram'). Arbitrary code and expressions are not accepted. | |
| instrument | No | ||
| candle_size | No | Maximum candles fetched for indicator conditions. It must cover every requested indicator lookback. | |
| candle_period | No | HTX candle interval used for indicator conditions: 1min, 5min, 15min, 30min, 60min, 4hour, 1day, 1week, or 1mon. | 60min |
| timeout_seconds | No | Hard maximum blocking duration (one hour). The budget includes polls and sleeps. Configure the MCP host tool deadline and outer yield_time_ms longer than this value so this tool, rather than an intermediate host yield, is the wake-up source. | |
| poll_interval_seconds | No | Target minimum interval between read-only poll starts. A larger interval reduces API use but increases wake latency. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| match | Yes | ||
| polls | Yes | ||
| status | Yes | ||
| product | Yes | ||
| warnings | Yes | ||
| elapsed_ms | Yes | ||
| instrument | Yes | ||
| failed_polls | Yes | ||
| observations | Yes | ||
| poll_attempts | Yes | ||
| started_at_ms | Yes | ||
| finished_at_ms | Yes | ||
| successful_polls | Yes | ||
| last_success_at_ms | Yes | ||
| matched_conditions | Yes | ||
| observation_age_ms | Yes | ||
| requested_timeout_ms | Yes | ||
| effective_deadline_ms | Yes |