historical_data
Retrieve historical stock price data for Indian companies listed on NSE and BSE to analyze market trends and performance over time.
Instructions
Endpoint:
/historical_data- Method:GET- Query Parameters: -stock_name(required): string -period(optional): string, default is \
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| stock_name | Yes | Example value: tcs | |
| period | No | Example value: | |
| filter | No | Example value: |
Implementation Reference
- server.py:54-61 (registration)The FastMCP server is initialized using the `from_openapi` method, which automatically registers tools based on the OpenAPI specification. The `historical_data` tool is defined within the `OPENAPI_SPEC` string starting at line 46.
# 从 OpenAPI 规范创建 FastMCP 服务器 openapi_dict = json.loads(OPENAPI_SPEC) mcp = FastMCP.from_openapi( openapi_spec=openapi_dict, client=client, name="indian_stock_exchange_api2", version=__version__ )