Skip to main content
Glama

A Share MCP

MIT License
178

get_historical_k_data

Retrieve historical K-line (OHLCV) data for Chinese A-share stocks by specifying stock code, date range, frequency, and adjustment settings. Export data in a Markdown table format for analysis.

Instructions

Fetches historical K-line (OHLCV) data for a Chinese A-share stock. Args: code: The stock code in Baostock format (e.g., 'sh.600000', 'sz.000001'). start_date: Start date in 'YYYY-MM-DD' format. end_date: End date in 'YYYY-MM-DD' format. frequency: Data frequency. Valid options (from Baostock): 'd': daily 'w': weekly 'm': monthly '5': 5 minutes '15': 15 minutes '30': 30 minutes '60': 60 minutes Defaults to 'd'. adjust_flag: Adjustment flag for price/volume. Valid options (from Baostock): '1': Forward adjusted (后复权) '2': Backward adjusted (前复权) '3': Non-adjusted (不复权) Defaults to '3'. fields: Optional list of specific data fields to retrieve (must be valid Baostock fields). If None or empty, default fields will be used (e.g., date, code, open, high, low, close, volume, amount, pctChg). Returns: A Markdown formatted string containing the K-line data table, or an error message. The table might be truncated if the result set is too large.

Input Schema

NameRequiredDescriptionDefault
adjust_flagNo3
codeYes
end_dateYes
fieldsNo
frequencyNod
start_dateYes

Input Schema (JSON Schema)

{ "properties": { "adjust_flag": { "default": "3", "title": "Adjust Flag", "type": "string" }, "code": { "title": "Code", "type": "string" }, "end_date": { "title": "End Date", "type": "string" }, "fields": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Fields" }, "frequency": { "default": "d", "title": "Frequency", "type": "string" }, "start_date": { "title": "Start Date", "type": "string" } }, "required": [ "code", "start_date", "end_date" ], "title": "get_historical_k_dataArguments", "type": "object" }

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/24mlight/a_share_mcp_is_just_I_need'

If you have feedback or need assistance with the MCP directory API, please join our Discord server