margin
Retrieve margin trading data for specific stocks to analyze financing and securities lending activities. Query stock codes to access detailed margin information through the Xueqiu MCP server.
Instructions
获取融资融券数据
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stock_code | No | SZ000002 |
Implementation Reference
- main.py:134-138 (handler)The handler function for the 'margin' tool. It is decorated with @mcp.tool() which registers it in the MCP server. The function fetches financing and securities lending data for the given stock code using the pysnowball library (ball.margin), processes the timestamps, and returns the result.@mcp.tool() def margin(stock_code: str="SZ000002") -> dict: """获取融资融券数据""" result = ball.margin(stock_code) return process_data(result)