get-soon-mainnet-account-tokens
Retrieve token balances for a specific address on the SOON mainnet using the SVM-MCP server. Input the address to view holdings and account details.
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)The handler function fetches the token accounts for the given address on Soon mainnet using Solana Connection's getTokenAccountsByOwner method with the SPL Token program ID, stringifies the result as text content, or returns an error message.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 schema defining the input parameter 'address' as a string with description.{ address: z.string().describe("The SOON address to get the tokens of"), },
- src/index.ts:207-244 (registration)McpServer tool registration call including name, description, input schema, and inline 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) }`, }, ], }; } } );
- src/index.ts:18-18 (registration)Tool name included in the server's capabilities array."get-soon-mainnet-account-tokens",