Skip to main content
Glama

get_wallet_info

Retrieve wallet information for Solana accounts, including address, balance, and token details, from the connected P-Link payment system.

Instructions

Retrieve the wallet infos about the connected P-Link account (Solana wallet address, wallet balance, tokens detail)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pubkNoThe Solana address of the wallet you want to see, if not provided, uses the currently connected user wallet address.

Implementation Reference

  • The main handler function that retrieves wallet information by making API calls to get user details and wallet balance.
    export async function get_my_wallet_info(reqBody: any) { var pubk = ''; var result = {error:'Not found'} as any if (reqBody.pubk) { pubk = reqBody.pubk; result = { pubk } } else { const { apiKey } = resolveAuth(undefined, undefined); var jsP = { myKey: apiKey } const fet = await fetch(BASE + '/api/getAPIUser', { method: 'POST', headers: { Accept: 'application.json', 'Content-Type': 'application/json' }, body: JSON.stringify(jsP) }); var dat = await fet.text(); result = JSON.parse(dat); pubk = result.pubk; } if (pubk) { const walletInfos = await fetch(BASE + '/api/walletInfos/' + pubk + '/1/'+(new Date().getTime()), { method: 'POST', body: JSON.stringify(reqBody) }); const walletBalance = await walletInfos.json(); result = { ...result, ...walletBalance }; return result; } throw Error("Invalid API_KEY"); }
  • Zod schema defining the optional 'pubk' input parameter for the get_wallet_info tool.
    export const getGetWalletInfosShape = { pubk: z.string().optional().describe("The Solana address of the wallet you want to see, if not provided, uses the currently connected user wallet address.") };
  • src/solution.ts:62-67 (registration)
    Tool registration in the tools list returned by ListToolsRequestHandler, including name, description, inputSchema, and annotations.
    { name: "get_wallet_info", description: get_my_wallet_info_title, inputSchema: jsonSchema(zodToJsonSchema(z.object(getGetWalletInfosShape))).jsonSchema, annotations: { title: get_my_wallet_info_title, readOnlyHint: true } },
  • Dispatch case in the CallToolRequestHandler switch statement that invokes the get_my_wallet_info handler.
    case "get_wallet_info": result = await get_my_wallet_info(args); break;

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