ipo
Retrieve comprehensive IPO data from Indian stock exchanges, including upcoming, listed, active, and closed offerings for market analysis.
Instructions
Get latest upcoming, listed, active, closed IPO data.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- server.py:56-101 (handler)The "ipo" tool is dynamically registered by FastMCP.from_openapi based on the OPENAPI_SPEC definition, which automatically creates the tool handler.
mcp = FastMCP.from_openapi( openapi_spec=openapi_dict, client=client, name="indian_stock_exchange_api2", version=__version__ ) # 注册请求拦截器,为所有请求添加 RapidAPI headers _original_request = client.request async def _add_rapidapi_headers(method, url, **kwargs): """拦截所有请求,添加必需的 RapidAPI headers""" # 确保 headers 存在 if 'headers' not in kwargs: kwargs['headers'] = {} # 添加 RapidAPI 必需的 headers if API_KEY: kwargs['headers']['X-RapidAPI-Key'] = API_KEY kwargs['headers']['X-RapidAPI-Host'] = "indian-stock-exchange-api2.p.rapidapi.com" else: print("⚠️ 警告: API_KEY 未设置,请求可能失败") # 对于 POST/PUT/PATCH,添加 Content-Type if method.upper() in ['POST', 'PUT', 'PATCH']: if 'Content-Type' not in kwargs['headers']: kwargs['headers']['Content-Type'] = 'application/json' return await _original_request(method, url, **kwargs) # 替换 request 方法 client.request = _add_rapidapi_headers def main(): """主入口点""" print(f"🚀 启动 Indian Stock Exchange Api2 MCP 服务器") print(f"📦 版本: {__tag__}") print(f"🔧 传输协议: {TRANSPORT}") print() # 运行服务器 mcp.run(transport="stdio")