fund_historical_data
Retrieve historical fund performance data for analysis by specifying fund code, date range, and interval to track investment trends.
Instructions
Fonun geçmiş değerlerini getirir
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Fon kodu | |
| start_date | No | Başlangıç tarihi (YYYY-MM-DD) | |
| end_date | No | Bitiş tarihi (YYYY-MM-DD) | |
| interval | No | Veri aralığı | |
| sort | No | Sıralama alanı | |
| order | No | Sıralama yönü |
Implementation Reference
- src/api-client.ts:104-107 (handler)Executes the core tool logic by making an HTTP GET request to the API endpoint `/funds/{code}/historical` to retrieve the fund's historical data values.async getFundHistoricalData(code: string, params: HistoricalDataParams = {}): Promise<FundHistoricalValue[]> { const response: AxiosResponse<FundHistoricalValue[]> = await this.client.get(`/funds/${code}/historical`, { params }); return response.data; }
- src/tools.ts:226-261 (registration)Registers the 'fund_historical_data' tool in the MCP tools list with description and input schema definition.{ name: 'fund_historical_data', description: 'Fonun geçmiş değerlerini getirir', inputSchema: { type: 'object', properties: { code: { type: 'string', description: 'Fon kodu' }, start_date: { type: 'string', description: 'Başlangıç tarihi (YYYY-MM-DD)' }, end_date: { type: 'string', description: 'Bitiş tarihi (YYYY-MM-DD)' }, interval: { type: 'string', description: 'Veri aralığı', enum: ['daily', 'weekly', 'monthly'] }, sort: { type: 'string', description: 'Sıralama alanı' }, order: { type: 'string', description: 'Sıralama yönü', enum: ['ASC', 'DESC'] } }, required: ['code'] } },
- src/tools.ts:34-41 (schema)Zod schema used for input validation and parsing of the 'fund_historical_data' tool arguments.const HistoricalDataSchema = z.object({ code: z.string(), start_date: z.string().optional(), end_date: z.string().optional(), interval: z.enum(['daily', 'weekly', 'monthly']).optional(), sort: z.string().optional(), order: z.enum(['ASC', 'DESC']).optional() });
- src/types.ts:229-235 (schema)TypeScript interface defining the parameters for historical data requests, used in the API client.export interface HistoricalDataParams { start_date?: string; end_date?: string; interval?: 'daily' | 'weekly' | 'monthly'; sort?: string; order?: 'ASC' | 'DESC'; }
- src/tools.ts:504-507 (helper)Dispatches the tool call in handleToolCall by parsing inputs and invoking the API client's getFundHistoricalData method.case 'fund_historical_data': const historicalParams = HistoricalDataSchema.parse(args); const { code, ...histParams } = historicalParams; return await this.apiClient.getFundHistoricalData(code, histParams);