Skip to content

MCP Tool Table

stock-sdk's MCP server exposes the SDK's read-only namespace methods as tools. Each tool is an explicitly declared ToolDefname, description, a hand-written JSON Schema inputSchema, and an invoke that maps args explicitly onto the SDK call — all collected into one manifest as the single source of truth (SSOT), shared with the CLI.

Exact tools follow the implementation. The table below is an overview of tools derived from read-only namespace methods; tool names and input fields follow the final manifest. Write operations and debug-only *Raw methods are not exposed as tools.

Tool overview

Tool (derived from)Namespace methodsDescription
Quotessdk.quotes.cn / cnSimple / hk / us / fundA-share full/simple, HK, US, fund quotes
Intraday & order booksdk.quotes.timeline / largeOrder / fundFlowIntraday timeline, large orders, simple fund flow
Batch quotessdk.batch.cn / hk / us / byCodesWhole-market or by-code batch quotes
K-linesdk.kline.cn / hk / us / cnMinute / hkMinute / usMinuteHistorical and minute K-lines
K-line with indicatorssdk.kline.withIndicatorsK-line plus built-in technical indicators
Code listssdk.codes.cn / us / hk / fundPer-market symbol lists
Boardssdk.board.industry.* / sdk.board.concept.*Industry / concept board list, spot, constituents, K-line
Fund flowsdk.fundFlow.individual / market / rank / sectorRankStock / market / rank / sector fund flow
Northboundsdk.northbound.minute / summary / holdingRank / individualStock Connect / northbound capital
Market eventssdk.marketEvent.ztPool / stockChanges / boardChangesLimit-up pool / stock changes / board changes
Dragon-Tigersdk.dragonTiger.detail / stockStats / institution / branchRankDragon-Tiger list details and stats
Block tradesdk.blockTrade.marketStat / detail / dailyStatBlock-trade stats and details
Marginsdk.margin.accountInfo / targetListMargin account info and target list
Optionssdk.options.index.* / etf.* / commodity.* / cffex.* / lhbIndex / ETF / commodity / CFFEX options
Futuressdk.futures.kline / globalSpot / globalKline / inventoryDomestic/global futures quotes and inventory
Fund extrassdk.fund.dividendList / navHistory / estimate / rankHistoryFund dividends / NAV / estimate / ranking
Trading calendarsdk.calendar.isTradingDay / nextTradingDay / marketStatusTrading-day checks and market status
Referencesdk.reference.dividendDetail / tradingCalendarDividend detail / A-share trading calendar
Searchsdk.search(keyword)Search stocks / funds by keyword

Tool call semantics

  • Input: symbol-like params take string as a first-class citizen; the server runs normalizeSymbol for tolerant parsing (e.g. sh600519 / 600519 / 00700 / hk00700 / AAPL / 105.AAPL). The inputSchema is a hand-written JSON Schema literal declaring field names, types and required.
  • Argument mapping: tools/call looks up the manifest by name, and invoke(sdk, args) maps named parameters explicitly onto the SDK method's positional arguments — no runtime reflection.
  • Result: a successful result is wrapped as { content: [{ type: 'text', text: JSON.stringify(result) }] }; the text is the result serialized per the v2 data contract (unified Quote discriminated union, timestamp: number | null, percentages as percentage numbers, no raw field — exact fields follow the implementation).
  • Error semantics: a tool execution failure returns { content, isError: true }, handing the error to the model; only unknown-tool / protocol-level errors use a JSON-RPC error.

Shared manifest with the CLI

The same tool manifest drives both MCP's tools/list / tools/call and the CLI's subcommands, preventing two definitions from drifting apart. Adding a tool for a new read-only namespace method is just one more ToolDef in the manifest — MCP and CLI pick it up together.

Next steps