Skip to main content
Glama

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
NameRequiredDescriptionDefault
addressYesThe SOON address to get the tokens of

Implementation Reference

  • 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) }`, }, ], }; } }
  • 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",

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/rkmonarch/svm-mcp'

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