invest_in_fund
Make a one-time lumpsum investment in a mutual fund by specifying the ISIN code and investment amount in INR.
Instructions
One-time lumpsum investment in a mutual fund
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| isin | Yes | Mutual fund ISIN code | |
| amount | Yes | Investment amount in INR |
Implementation Reference
- src/tools/funds.ts:100-133 (handler)The tool 'invest_in_fund' is registered and implemented in 'src/tools/funds.ts' using the 'server.tool' method. It takes an ISIN and amount, validates the amount, and calls the 'growwClient.investInFund' method.
// ── invest_in_fund ──────────────────────────────────────── server.tool( "invest_in_fund", "One-time lumpsum investment in a mutual fund", { isin: z.string().describe("Mutual fund ISIN code"), amount: z.number().positive().describe("Investment amount in INR"), }, async ({ isin, amount }) => { try { if (amount < 100) return mcpError("Minimum investment amount is ₹100"); const result = await growwClient.investInFund({ isin, amount }); const text = [ `💰 INVESTMENT SUBMITTED`, `${"─".repeat(40)}`, `Transaction ID: ${result.transactionId}`, `Fund: ${isin}`, `Amount: ${formatCurrencyExact(amount)}`, `NAV: ${formatCurrencyExact(result.nav)}`, `Est. Units: ${result.units}`, `Status: ${result.status}`, ``, `${result.message}`, ``, `⚠️ This is ${process.env.MOCK_MODE === "true" ? "a MOCK investment (no real money)" : "a REAL investment — money will be debited from your account"}`, ].join("\n"); return mcpText(text); } catch (err) { return mcpError(normalizeError(err)); } } );