Skip to main content
Glama

analyze_fund

Evaluate investment fund performance in Turkey by inputting fund code, start date, initial investment, and optional monthly contributions with yearly growth adjustments.

Instructions

Fon için yatırım analizi yapar

Input Schema

NameRequiredDescriptionDefault
codeYesFon kodu
includeMonthlyDetailsNoAylık detayları getir (varsayılan: true)
initialInvestmentYesBaşlangıç yatırımı (TL)
monthlyInvestmentNoAylık yatırım tutarı (TL, opsiyonel)
startDateYesBaşlangıç tarihi
yearlyIncreaseTypeNoYıllık artış tipi (opsiyonel)
yearlyIncreaseValueNoYıllık artış değeri (opsiyonel)

Input Schema (JSON Schema)

{ "properties": { "code": { "description": "Fon kodu", "type": "string" }, "includeMonthlyDetails": { "description": "Aylık detayları getir (varsayılan: true)", "type": "boolean" }, "initialInvestment": { "description": "Başlangıç yatırımı (TL)", "minimum": 0, "type": "number" }, "monthlyInvestment": { "description": "Aylık yatırım tutarı (TL, opsiyonel)", "minimum": 0, "type": "number" }, "startDate": { "description": "Başlangıç tarihi", "enum": [ "last_1_day", "last_1_week", "last_1_month", "last_3_months", "last_6_months", "year_start", "last_1_year", "last_3_years", "last_5_years" ], "type": "string" }, "yearlyIncreaseType": { "description": "Yıllık artış tipi (opsiyonel)", "enum": [ "percentage", "amount" ], "type": "string" }, "yearlyIncreaseValue": { "description": "Yıllık artış değeri (opsiyonel)", "minimum": 0, "type": "number" } }, "required": [ "code", "startDate", "initialInvestment" ], "type": "object" }

Implementation Reference

  • The handler logic in handleToolCall method that validates input parameters using AnalyzeFundSchema and calls the apiClient.analyzeFund method to execute the tool.
    case 'analyze_fund': const analyzeParams = AnalyzeFundSchema.parse(args); const yearlyIncrease = analyzeParams.yearlyIncreaseType && analyzeParams.yearlyIncreaseValue ? { type: analyzeParams.yearlyIncreaseType, value: analyzeParams.yearlyIncreaseValue } : undefined; return await this.apiClient.analyzeFund({ code: analyzeParams.code, startDate: analyzeParams.startDate, initialInvestment: analyzeParams.initialInvestment, monthlyInvestment: analyzeParams.monthlyInvestment, yearlyIncrease, includeMonthlyDetails: analyzeParams.includeMonthlyDetails });
  • Zod schema used for input validation in the analyze_fund tool handler.
    const AnalyzeFundSchema = z.object({ code: z.string(), startDate: z.enum(['last_1_day', 'last_1_week', 'last_1_month', 'last_3_months', 'last_6_months', 'year_start', 'last_1_year', 'last_3_years', 'last_5_years']), initialInvestment: z.number().min(0), monthlyInvestment: z.number().min(0).optional(), yearlyIncreaseType: z.enum(['percentage', 'amount']).optional(), yearlyIncreaseValue: z.number().min(0).optional(), includeMonthlyDetails: z.boolean().optional()
  • src/tools.ts:183-225 (registration)
    MCP tool registration definition including name, description, and JSON input schema.
    { name: 'analyze_fund', description: 'Fon için yatırım analizi yapar', inputSchema: { type: 'object', properties: { code: { type: 'string', description: 'Fon kodu' }, startDate: { type: 'string', description: 'Başlangıç tarihi', enum: ['last_1_day', 'last_1_week', 'last_1_month', 'last_3_months', 'last_6_months', 'year_start', 'last_1_year', 'last_3_years', 'last_5_years'] }, initialInvestment: { type: 'number', description: 'Başlangıç yatırımı (TL)', minimum: 0 }, monthlyInvestment: { type: 'number', description: 'Aylık yatırım tutarı (TL, opsiyonel)', minimum: 0 }, yearlyIncreaseType: { type: 'string', description: 'Yıllık artış tipi (opsiyonel)', enum: ['percentage', 'amount'] }, yearlyIncreaseValue: { type: 'number', description: 'Yıllık artış değeri (opsiyonel)', minimum: 0 }, includeMonthlyDetails: { type: 'boolean', description: 'Aylık detayları getir (varsayılan: true)' } }, required: ['code', 'startDate', 'initialInvestment'] } },
  • Supporting API client method that makes the HTTP GET request to the external API endpoint for fund analysis.
    async analyzeFund(params: FundAnalysisParams): Promise<FundAnalysisResult> { const { code, ...queryParams } = params; // Nested object'i düzleştir const flatParams: Record<string, any> = { ...queryParams, 'yearlyIncrease.type': params.yearlyIncrease?.type, 'yearlyIncrease.value': params.yearlyIncrease?.value }; const response: AxiosResponse<FundAnalysisResult> = await this.client.get(`/funds/${code}/analyze`, { params: flatParams }); return response.data; }
  • TypeScript interface defining the input parameters for fund analysis, matching the Zod schema.
    export interface FundAnalysisParams { code: string; startDate: 'last_1_day' | 'last_1_week' | 'last_1_month' | 'last_3_months' | 'last_6_months' | 'year_start' | 'last_1_year' | 'last_3_years' | 'last_5_years'; initialInvestment: number; monthlyInvestment?: number; yearlyIncrease?: { type: 'percentage' | 'amount'; value: number; }; includeMonthlyDetails?: boolean;

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kemalersin/fonparam-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server