qlib-sync
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| QLIB_SYNC_MIRROR | No | Download through a mirror. | |
| QLIB_SYNC_DATA_DIR | No | Use a dataset outside the default ~/.qlib/qlib_data/cn_data location. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
Local China A-share daily data (Qlib format), installed and kept current by qlib-sync. Call cn_status first to see how recent the data is. If the user needs recent prices and an update is available, call cn_update (it takes about a minute and is safe: on any failure the previous data is restored). Symbols accept 600519, SH600519 or 600519.SH. cn_get_prices returns real traded prices by default; pass price_basis="adjusted" for the split- and dividend-adjusted series used in backtests. Data covers trading days only; the latest date is the last close, never intraday.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| cn_statusA | Report the local A-share data's latest trading date, size, and stock pools, and whether the community release has newer data (set offline=True to skip the network check). |
| cn_updateA | Install or update the local A-share data from the community release. |
| cn_health_checkA | Validate the local data's structure and perform a real Qlib read; returns ok, errors, checks. |
| cn_get_pricesA | Daily bars for up to 20 A-share symbols between start and end (YYYY-MM-DD, inclusive; end defaults to the latest date). |
| cn_list_poolA | Members of a stock pool on a date (default: the latest date). Pools: all, csi100, csi300, csi500, csi800, csi1000, csiall, plus any local pools; cn_status lists what exists. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 5 tools
Each tool has a clearly distinct purpose: data update, price query, health validation, pool listing, and status reporting. There is no overlap or ambiguity between them.
All tools use a consistent 'cn_' prefix, but the second part mixes verb_noun (get_prices, list_pool) with noun phrases (health_check, status) and a bare verb (update). This is mostly consistent and still readable.
Five tools are well-scoped for an A-share data sync and access server. Each tool earns its place by covering a unique part of the data lifecycle.
The surface covers update, validation, status, price retrieval, and pool membership, which are the core operations. Minor gaps exist, such as querying a trading calendar or non-price data fields, but these are not critical for the stated purpose.