Skip to main content
Glama

analyze_fund

Analyzes investment fund performance in Turkey by calculating returns based on initial investment, time periods, and optional monthly contributions with growth adjustments.

Instructions

Fon için yatırım analizi yapar

Input Schema

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

Implementation Reference

  • Core handler function that executes the analysis by making an API call to the /funds/{code}/analyze endpoint with prepared query parameters.
    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; }
  • Tool dispatch handler in handleToolCall that validates input with AnalyzeFundSchema and invokes apiClient.analyzeFund.
    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 definition for input validation of analyze_fund tool parameters.
    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 entry in getTools() array, defining name, description, and input schema for analyze_fund.
    { 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'] } },

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