get-soon-mainnet-account-tokens
Retrieve token holdings for a SOON mainnet address to view account balances and token information on the SVM blockchain.
Instructions
Get the tokens of a address on the Soon mainnet
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The SOON address to get the tokens of |
Implementation Reference
- src/index.ts:213-243 (handler)Handler function that retrieves token accounts owned by the given address on the Soon mainnet using Solana RPC.async ({ address }) => { try { const tokens = await connectionMainnet.getTokenAccountsByOwner( new PublicKey(address), { programId: new PublicKey( "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" ), } ); return { content: [ { type: "text", text: JSON.stringify(tokens), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error getting tokens: ${ error instanceof Error ? error.message : String(error) }`, }, ], }; } }
- src/index.ts:210-212 (schema)Zod input schema defining the 'address' parameter for the tool.{ address: z.string().describe("The SOON address to get the tokens of"), },
- src/index.ts:207-244 (registration)MCP server.tool registration including name, description, input schema, and handler function.server.tool( "get-soon-mainnet-account-tokens", "Get the tokens of a address on the Soon mainnet", { address: z.string().describe("The SOON address to get the tokens of"), }, async ({ address }) => { try { const tokens = await connectionMainnet.getTokenAccountsByOwner( new PublicKey(address), { programId: new PublicKey( "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA" ), } ); return { content: [ { type: "text", text: JSON.stringify(tokens), }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error getting tokens: ${ error instanceof Error ? error.message : String(error) }`, }, ], }; } } );