Skip to main content
Glama

fund_my_wallet

Add funds to your wallet using credit card or Solana. Specify the USD amount to deposit for payment transactions.

Instructions

Fund wallet : Obtain a link in order to fund your wallet of the desired amount using a credit card, or the Solana address of your wallet if you want to fund your account using Solana.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountNoAmount to fund in your wallet in USD

Implementation Reference

  • The core handler function for the 'fund_my_wallet' tool. It authenticates the user, fetches wallet info, creates an onramp session for funding via credit card or provides Solana address, and returns funding links.
    export async function fund_my_wallet(args: any) { const { amount } = args; const { apiKey } = resolveAuth(undefined, undefined); var data = await getAPIuser(apiKey); if (typeof data === 'object' && data && 'pubk' in data) { var callParams = { transaction_details: { source_currency: "usd", exchange_amount_in_USD: amount ? amount : 10, email: data.email }, myCookie: apiKey, pubk: data.pubk } process.stderr.write(`[caisse][info] fund_my_wallet \n` + JSON.stringify( callParams ) ); const response = await fetch( BASE + "/api/create-onramp-session", { method: "POST", headers: { "Content-Type": "application/json" }, body: JSON.stringify(callParams), }); const onrampData = await response.json(); const strData = "In order to fund your wallet, you can send Solana to this address : " + data.pubk + " or if you want to use a credit card to fund your account, open this link : " + onrampData?.onrampSession?.redirect_url; return { result: strData, solanaWalletAddress: data.pubk, fundWalletLink: onrampData?.onrampSession?.redirect_url }; } else { return { error: "User not found" }; } }
  • Zod schema definition for the input parameters of the fund_my_wallet tool, specifying an optional positive amount in USD (defaults to 10).
    export const getFundWalletShape = { amount: z.number().positive().default(10).optional().describe("Amount to fund in your wallet in USD"), };
  • src/solution.ts:36-41 (registration)
    Tool registration in the MCP server's tools list, providing name, description, derived JSON schema from Zod, and annotations for the fund_my_wallet tool.
    { name: "fund_my_wallet", description: fund_my_wallet_title, inputSchema: jsonSchema(zodToJsonSchema(z.object(getFundWalletShape))).jsonSchema, annotations: { title: fund_my_wallet_title, readOnlyHint: true } },
  • Dispatch logic in the MCP call tool handler that routes calls to the fund_my_wallet function based on tool name.
    case "fund_my_wallet": result = await fund_my_wallet(args); break;
  • Title and description string used for the tool's metadata.
    export const fund_my_wallet_title = 'Fund wallet : Obtain a link in order to fund your wallet of the desired amount using a credit card, or the Solana address of your wallet if you want to fund your account using Solana.';

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/paracetamol951/P-Link-MCP'

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