Use this skill when the user asks for financial data lookup, especially around securities, funds, indices,行情,财务指标、估值、持仓、分红、公告期数据、时间序列查询。
Turn a natural-language finance question into a safe MCP workflow:
resolve_instrumentsearch_tablequery_dataBefore the first real MCP request, check whether the local token file exists.
Resolve paths relative to the current skill root, not a hard-coded install location:
.token.local.envIf the file does not exist, the agent must proactively ask the user to provide a token, then write it locally in this format:
INDEXERA_FINANCE_MCP_BASE_URL=https://mcp.indexera.cnINDEXERA_FINANCE_MCP_ENDPOINT=https://mcp.indexera.cn/mcpINDEXERA_FINANCE_TOKENEvery MCP request must send Authorization: Bearer from that file.
Treat that file as a local secret. Do not print the full token or commit the env file.
Even if the user provides something that looks like an exact code, still call resolve_instrument first.
Reason: user-entered code formats vary; the skill must normalize to the system canonical_code before table search and data query.
limitsearch_table is now a pure metadata search over rebuilt metadata_table.search_text.
That search text is generated inside MCP from table fields + column names + column comments + name_alias.
Do not assume any runtime synonym expansion happens at query time.
search_table returns table description, column matrix, and sample rows. Use those to decide:
selectIf the skill auto-picks one candidate instrument or one table among several possibilities, say so briefly in the final answer.
When integrating this skill into OpenClaw or another agent runtime, prefer the fixed stdin/stdout runner under the current skill root:
scripts/indexera_finance_stdio.pyDo not generate one-off Python code for each MCP request if the fixed runner is available.
Primary contract:
{\"ok\": true, \"data\": ...}{\"ok\": false, \"error_code\": ..., \"message\": ...}resolve_instrumentInput:
query — name, alias, code fragment, ticker-like text, etc.Output:
instruments[]instrument_typedisplay_namecanonical_codeexchangemarketUse it to normalize every security/fund/index/entity reference before any downstream step.
search_tableInput:
question or querylimitOutput:
tables[]schema_nametable_nametable_titletable_desccolumnssample_rowsUse it to find the best table for the requested metric, frequency, and time range.
query_dataInput:
schema_nametable_nameselect (required)filters (optional)order_by (optional)limit (optional)Use it only after the table has been selected from metadata evidence.
Extract five things from the request:
Always call resolve_instrument.
Selection preference when multiple candidates exist:
If ambiguity remains material, ask the user; otherwise continue with the best candidate and say which one was chosen.
Build a compact search phrase combining:
Good examples:
A股 日线 收盘价 成交额股票 财务 营收 净利润 季度基金 持仓 季报指数 成分 权重Run search_table with a modest limit first.
Prefer tables whose metadata best matches all of the following:
tushare for current phase)When building query_data:
select columnslimit unless the user explicitly asks for a long seriesCommon select shape:
Common order_by shape:
Return:
For short answers, keep the explanation tight.
For analytical questions, summarize the data before listing rows.
Example: “茅台最新收盘价”
trade_date, code, closelimit=1Example: “宁德时代近20个交易日收盘价和成交额”
limit=20Example: “比亚迪2024年净利润和营收”
Example: “某基金最新前十大持仓”
resolve_instrument returns no candidatessearch_table returns multiple plausible tablesPick the one whose metadata best matches the requested metric and grain.
If still ambiguous, briefly mention the chosen table and why.
query_data fails validationRetry once with a more conservative request:
selectDo not loop repeatedly.
Say whether the failure came from:
canonical_code, table name, and date scope.For CLI usage and OpenClaw integration examples, also see:
references/cli.mdFor a larger scenario library, also see:
references/examples.mdUser: 贵州茅台最近5个交易日收盘价
High-level tool plan:
resolve_instrument(query="贵州茅台")search_table(query="A股 日线 收盘价")query_data(...) using canonical code, trade_date, close, limit=5User: 600519 近四个季度营收和净利润
High-level tool plan:
resolve_instrument(query="600519")search_table(query="股票 财务 营收 净利润 季度")query_data(...) using canonical code and quarterly/report columnsUser: 沪深300有哪些可查询表
High-level tool plan:
resolve_instrument(query="沪深300")search_table(query="指数 成分 权重 行情")共 4 个版本