get-soon-testnet-balance
Retrieve the testnet balance of a specified SOON address using SVM-MCP. Input the address to view current token holdings on the Soon testnet.
Instructions
Get the balance of a address on the Soon testnet
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The SOON address to get the balance of |
Implementation Reference
- src/index.ts:28-38 (handler)Handler function that fetches the Soon testnet balance for a given address using Solana Web3.js getBalance and returns a formatted text response.async ({ address }) => { const balance = await connectionTestnet.getBalance(new PublicKey(address)); return { content: [ { type: "text", text: `Balance: ${balance}`, }, ], }; }
- src/index.ts:25-27 (schema)Zod input schema defining the 'address' parameter as a string with description.{ address: z.string().describe("The SOON address to get the balance of"), },
- src/index.ts:22-39 (registration)Registration of the 'get-soon-testnet-balance' tool on the McpServer, specifying name, description, input schema, and handler function.server.tool( "get-soon-testnet-balance", "Get the balance of a address on the Soon testnet", { address: z.string().describe("The SOON address to get the balance of"), }, async ({ address }) => { const balance = await connectionTestnet.getBalance(new PublicKey(address)); return { content: [ { type: "text", text: `Balance: ${balance}`, }, ], }; } );
- src/index.ts:6-6 (helper)Testnet RPC connection instance used by the tool handler to query balances.const connectionTestnet = new Connection("https://rpc.testnet.soo.network/rpc");
- src/index.ts:12-19 (registration)Declaration of tool capabilities in McpServer constructor, including 'get-soon-testnet-balance'.capabilities: [ "get-soon-testnet-balance", "get-soon-testnet-last-transaction", "get-soon-testnet-account-tokens", "get-soon-mainnet-balance", "get-soon-mainnet-last-transaction", "get-soon-mainnet-account-tokens", ],