compare_funds
Compare 2-5 investment funds by their codes to analyze performance and features for informed decision-making in Turkey's market.
Instructions
Fonları karşılaştırır (2-5 fon)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| codes | Yes | Karşılaştırılacak fon kodları |
Implementation Reference
- src/tools.ts:485-487 (handler)Handler logic for compare_funds tool, which parses input using CompareFundsSchema and delegates to apiClient.compareFunds.case 'compare_funds': const compareParams = CompareFundsSchema.parse(args); return await this.apiClient.compareFunds(compareParams.codes);
- src/tools.ts:20-22 (schema)Zod schema for validating the input parameters (codes array) of the compare_funds tool.const CompareFundsSchema = z.object({ codes: z.array(z.string()).min(2).max(5) });
- src/tools.ts:164-182 (registration)Registration of the compare_funds tool in the getTools() method, defining its name, description, and JSON input schema for MCP.{ name: 'compare_funds', description: 'Fonları karşılaştırır (2-5 fon)', inputSchema: { type: 'object', properties: { codes: { type: 'array', description: 'Karşılaştırılacak fon kodları', items: { type: 'string' }, minItems: 2, maxItems: 5 } }, required: ['codes'] } },
- src/api-client.ts:73-80 (helper)Core implementation in API client that validates the codes array and makes HTTP GET request to '/funds/compare' endpoint to retrieve fund comparison data.async compareFunds(codes: string[]): Promise<Fund[]> { if (codes.length < 2 || codes.length > 5) { throw new Error('2-5 arasında fon kodu belirtmelisiniz'); } const params = { codes: codes.join(',') }; const response: AxiosResponse<Fund[]> = await this.client.get('/funds/compare', { params }); return response.data; }