fund_historical_data
Retrieve historical fund performance data for specific codes within a defined date range and interval using the FonParam MCP server. Supports sorting and filtering for detailed investment analysis.
Instructions
Fonun geçmiş değerlerini getirir
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| code | Yes | Fon kodu | |
| end_date | No | Bitiş tarihi (YYYY-MM-DD) | |
| interval | No | Veri aralığı | |
| order | No | Sıralama yönü | |
| sort | No | Sıralama alanı | |
| start_date | No | Başlangıç tarihi (YYYY-MM-DD) |
Implementation Reference
- src/tools.ts:226-261 (registration)Tool registration in getTools() method, defining name, description, and input schema for fund_historical_data{ 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 for input validation of fund_historical_data parametersconst 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/tools.ts:504-507 (handler)Handler logic in handleToolCall switch statement: parses args with schema, extracts code and params, calls apiClient methodcase 'fund_historical_data': const historicalParams = HistoricalDataSchema.parse(args); const { code, ...histParams } = historicalParams; return await this.apiClient.getFundHistoricalData(code, histParams);
- src/api-client.ts:104-107 (helper)API client helper method that performs HTTP GET to fetch historical fund data from /funds/{code}/historical endpointasync getFundHistoricalData(code: string, params: HistoricalDataParams = {}): Promise<FundHistoricalValue[]> { const response: AxiosResponse<FundHistoricalValue[]> = await this.client.get(`/funds/${code}/historical`, { params }); return response.data; }