compare_funds
Analyze and compare up to five investment funds in Turkey by entering fund codes. Gain insights into fund performance and make informed investment decisions.
Instructions
Fonları karşılaştırır (2-5 fon)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| codes | Yes | Karşılaştırılacak fon kodları |
Input Schema (JSON Schema)
{
"properties": {
"codes": {
"description": "Karşılaştırılacak fon kodları",
"items": {
"type": "string"
},
"maxItems": 5,
"minItems": 2,
"type": "array"
}
},
"required": [
"codes"
],
"type": "object"
}
Implementation Reference
- src/api-client.ts:73-80 (handler)Core handler function that validates the number of fund codes and fetches comparison data from the '/funds/compare' API endpoint.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; }
- src/tools.ts:20-22 (schema)Zod schema for input validation: requires an array of 2 to 5 fund codes.const CompareFundsSchema = z.object({ codes: z.array(z.string()).min(2).max(5) });
- src/tools.ts:164-182 (registration)Tool registration in getTools() method, defining name, description, and input schema for the MCP protocol.{ 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/tools.ts:485-487 (handler)Tool dispatch logic in handleToolCall: parses arguments using schema and delegates to apiClient handler.case 'compare_funds': const compareParams = CompareFundsSchema.parse(args); return await this.apiClient.compareFunds(compareParams.codes);