Skip to main content
Glama
darved2305

groww-mcp

by darved2305

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
NameRequiredDescriptionDefault
isinYesMutual fund ISIN code
amountYesInvestment amount in INR

Implementation Reference

  • 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));
        }
      }
    );

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/darved2305/groww-mcp'

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