0. How to invoke
This skill uses the two tools registered by the datasource MCP server. Do not manually execute scripts via Bash:
mcp__plugin-kimi-datasource_data__get_data_source_descmcp__plugin-kimi-datasource_data__call_data_source_tool
These two tools are hosted and executed by Kimi Code. Pass parameters directly as JSON according to the tool schema.
The tools read the local OAuth login credentials corresponding to the current Kimi Code environment; when KIMI_CODE_OAUTH_HOST / KIMI_CODE_BASE_URL is set, the isolated credentials of the corresponding environment are used. If there are no login credentials, have the user first run /login。
1. What capabilities this skill provides
This plugin has 12 external data sources attached. The "data source name" in each row is what is passed to get_data_source_desc as the name。
| Capability domain | Data source name | Typical questions |
|---|---|---|
| A-shares / Hong Kong stocks / US stocks quotes and financials | stock_finance_data |
"How much is Moutai now", "CATL 2024 financial report", "Tencent shareholders", "AI stocks in Hangzhou" |
| Yahoo Finance global finance | yahoo_finance |
"Apple analyst ratings", "AAPL options chain", "Apple top ten institutional shareholders" |
| World Bank historical macro | world_bank_open_data |
"China GDP over the years", "India inflation rate", "comparison of population growth across countries" |
| Chinese enterprise business registration information | tianyancha |
"ByteDance shareholders", "BYD judicial risk", "CATL patents" |
| arXiv paper preprints | arxiv |
"Find a RAG survey", "download 2406.xxxxx" |
| Google Scholar academic search | scholar |
"Hinton's latest papers", "highly cited transformer survey literature" |
| Chinese laws and regulations / judicial cases | yuandian_law |
"provisions of the Civil Code on residency rights", "help me look up legal provisions related to termination of labor contracts", "find a few precedents on unjust enrichment" |
| Wind (A-shares/funds/bonds/macro) | wind |
"Moutai's minute chart today", "10-year government bond yield trend", "fund net value query" |
| IMF international macro (exchange rates / CPI / forecasts) | imf |
"USD to RMB exchange rate", "GDP growth forecasts by country", "global inflation rate comparison" |
| Hang Seng Juyuan intelligent screening | gildata |
"Screen stocks with net profit growth over 30% and ROE greater than 15%", "fund manager screening" |
| US SEC disclosure filings | sec_edgar |
"Tesla 10-K annual report", "Apple 10-Q quarterly report", "Form 4 insider transactions", "13F institutional holdings" |
| S&P Capital IQ US stock fundamentals | sp_data |
"Apple analyst consensus estimates", "US stock valuation ratio comparison", "competitor relationships" |
Source selection principles
- The user named a data source → use the specified source directly.
- Not named → select the best match from the table above by capability domain; judge for yourself based on the "capability boundary reference" below and the depth and scope of the user's question.
- For a simple query, select only one data source, and do not read the desc of other sources in parallel. Once the selected source returns successfully and has already covered the user's question, answer immediately; do not continue calling other APIs to supplement fields, reformat, or cross-validate. Only when the user explicitly requests cross-source comparison may you query a second data source.
Capability boundary reference (objective facts, consider when selecting sources)
yahoo_financehas at most 2 years of forex history;imfprovides long-term exchange rate, CPI, GDP forecasts and balance of payments seriesstock_finance_dataquotes are real-time/closing snapshots; minute-level intraday series are inwind(also includes funds, bonds, and treasury yields)- Shareholder / institutional holdings:
yahoo_finance、sec_edgar(13F)、sp_data(S&P standardized holders) are both covered, with different scopes and depth world_bank_open_datais a historical macro series of over 50 years; for IMF forecast values useimfgildataquery input is natural language conditions (stock screening / fund screening / fund manager screening),tianyanchais corporate business registration recordswindtheindexes/indicatorsparameter requires Wind native field names; for common fields like PE/PB/ROE/total market cap, first callwind_search_fieldsmapping (supports aliases and Chinese, one lookup at a time), do not guess field names
Unsupported capabilities: general web search / real-time news. When asked about these, tell the user the current data source does not cover them.
2. Standard workflow:get_data_source_desc → call_data_source_tool
The APIs available on the backend are often adjusted,this skill deliberately does not copy specific API names and parameter tables. Before each call you should ask the data source on the spot: "What interfaces do you have?"
1. 根据用户问题,从上表只挑一个 data_source_name
2. 执行 get_data_source_desc,读取该数据源的 Markdown 文档
3. 仔细读返回的 Markdown,里面列了:
- 该数据源整体说明(含 ticker 格式、全局约束)
- 每个 API 的描述 / 必填参数 / 可选参数 / 默认值 / 取值范围
4. 选最匹配的 API,按文档拼 params
5. 执行一次 call_data_source_tool;结果成功且已经覆盖问题时停止调用
6. 读返回结果,用用户提问时使用的语言回答
Example 1: User asks "Moutai's trend over the past year"
-
Stock trend →
stock_finance_data -
Call
mcp__plugin-kimi-datasource_data__get_data_source_desc, parameter{"name":"stock_finance_data"} -
Find the "get historical prices" API from the documentation, see what it requires, such as
ticker / start_date / end_date / file_pathetc. -
Verify with web_search → Moutai =
600519.SH -
Call
mcp__plugin-kimi-datasource_data__call_data_source_tool, parameters like{"data_source_name":"stock_finance_data","api_name":"<文档里写的 api>","params":{"ticker":"600519.SH","start_date":"...","end_date":"...","file_path":"/tmp/mao_1y.csv"}}
Example 2: User asks "find a few surveys on retrieval augmented generation"
-
Paper search →
arxiv(orscholar, arxiv is better for preprints, scholar has more complete citations) -
Call
mcp__plugin-kimi-datasource_data__get_data_source_desc, parameter{"name":"arxiv"} -
Find the search-type API from the documentation, see what it requires, such as
query / file_path / max_resultsetc. -
Execute
call_data_source_tool
Example 3: User asks "who are ByteDance's shareholders"
-
Corporate business registration →
tianyancha -
Call
mcp__plugin-kimi-datasource_data__get_data_source_desc, parameter{"name":"tianyancha"} -
Note: tianyancha's APIs are dynamically registered, the documentation will guide youfirst use a search-type interface to find the appropriate API name, then call it
-
Must use the company's full name("Beijing ByteDance Technology Co., Ltd."), do not use the abbreviation. If you don't know the full name, first use the "company search" interface in the tianyancha documentation to look it up
3. Several iron rules before calling
3.1 Stock codes must be verified, never guess from memory
A-shares .SH/.SZ/.BJ, Hong Kong stocks .HK, US stocks .US etc. Users usually only say the Chinese name ("Moutai", "CATL", "Tencent") and won't give the code.
Before calling any stock-related API, first use web_search / WebSearch and similar online tools to confirm the correct code + suffix.
If the current environment has no online tools at all,have the user confirm the code themselves, do not guess. If wrong, the interface will silently return wrong data or empty data.
3.2 Company-related queries must use the full name
tianyancha rejects abbreviations like "Tesla", "NetEase", "Tencent", and must be given a full name like "Beijing Tesla Sales Co., Ltd.". If you don't know the full name, first call its company search API.
3.3 Most APIs require file_path
The vast majority of data source APIs write the complete result as CSV to file_path. Omitting it will report Missing required parameters: file_path. When you don't know what to pass, just give a /tmp/<场景>_<时间戳>.csv .
3.4 Don't pile too many tickers into one call
stock_finance_data real-time interfaces support at most 3 tickers, and historical interfaces at most 10. Exceeding this will be truncated or report an error. If there are more, call in batches.
4. How to read the returned results
call_data_source_tool 's stdout generally contains two sections:
data_preview: CSV header + first few rows (usually 1~3 rows), convenient for you to directly answer simple questionsCSV 数据已写入:/tmp/xxx.csv: full data output path
Strategy:
- User only asks "how much is XX now", "what is China's 2023 GDP" and other single values →
data_previewis generally enough, answer directly - User wants to plot, compare, calculate profit/loss, list items → use the
Readtool to read the CSV and then process it - When querying mixed A-shares + Hong Kong stocks, the server will automatically split the CSV into
_a.csv/_hk.csvtwo files, and the originalfile_pathfile does not exist
If the interface returns a failure, the prompt text generally states the reason (wrong parameters / unsupported / empty data, etc.). Feed the plain-language reason back to the user, don't force a second attempt.
5. watchlist.json — user's watchlist
${KIMI_SKILL_DIR}/watchlist.json is the user's watchlist. When the user asks "take a look at my watchlist", read this file, then follow the standard get_data_source_desc("stock_finance_data") → call_data_source_tool process to query real-time quotes; the real-time interfaces in the docs support at most 3 tickers per batch, call in batches if there are more.
Format:
[
{"code": "600519.SH", "name": "贵州茅台"},
{"code": "0700.HK", "name": "腾讯控股", "hold_cost": 350.5, "hold_quantity": 100}
]
codeandnameare required;hold_costandhold_quantityare optional- When both are present, also calculate profit/loss:
(当前价 - hold_cost) * hold_quantity - When the user says "help me add XX to my watchlist": first web_search to verify the code, then append to the JSON array
6. Notes
- When answering the user, use the language the user used when asking. If the user asks in Chinese, answer in Chinese; if the user asks in English, answer in English; if they ask in another language, answer in that other language.
- Don't guess stock codes / full company names from memory. A wrong code will make the interface silently return wrong data, and the user won't notice
- Don't force-pass
api_namewithout reading the desc. The backend will reportAPI_NOT_FOUND. Unless in this session you have already read that data source's desc and remember the parameters - Don't give investment advice. After giving the data, just add a line "AI-generated, not investment advice"
- If the error returned by a data source interface is clearly a backend bug (parameter schema self-contradictory, internal Python error, etc.),report the error to the user, don't force attempts— we can't fix this kind of bug on our side; it needs to be changed on the backend service side