Skip to main content
Glama
qlib-sync

qlib-sync

Server Configuration

Describes the environment variables required to run the server.

NameRequiredDescriptionDefault
QLIB_SYNC_MIRRORNoDownload through a mirror.
QLIB_SYNC_DATA_DIRNoUse 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

CapabilityDetails
tools
{
  "listChanged": false
}
prompts
{
  "listChanged": false
}
resources
{
  "subscribe": false,
  "listChanged": false
}

Tools

Functions exposed to the LLM to take actions

NameDescription
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.

    Returns quickly when already current. Otherwise downloads about 550 MB, checks it with
    the dataset maintainers' own validator, and swaps it in; this takes roughly a minute.
    A release that cannot be verified is refused, and on any failure the previous data is
    restored. The result lists new trading days, listed/delisted symbols, and `verified`.
    
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).

    fields: any of open, high, low, close, vwap, volume, amount, change, factor
    (default open, high, low, close, volume, change). change is the daily return as a
    fraction (0.01 = +1%). price_basis="raw" gives real traded prices and share volume;
    "adjusted" gives Qlib's split- and dividend-adjusted series. Rows are capped by max_rows.
    
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

NameDescription

No prompts

Resources

Contextual data attached and managed by the client

NameDescription

No resources

TDQS

A4/5.0

Scored across 5 tools

Disambiguation5/5

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.

Naming Consistency4/5

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.

Tool Count5/5

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.

Completeness4/5

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.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues