Skip to main content
Glama
buildwithgrove

Grove's MCP Server for Pocket Network

get_solana_token_metadata

Retrieve SPL token metadata including decimals, supply, and authorities using a Solana mint address. Supports mainnet and testnet networks for token information access.

Instructions

Get SPL token metadata (decimals, supply, authorities)

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
mintAddressYesSPL token mint address
networkNoNetwork type (defaults to mainnet)

Implementation Reference

  • Tool registration object defining the name, description, and input schema for get_solana_token_metadata.
    { name: 'get_solana_token_metadata', description: 'Get SPL token metadata (decimals, supply, authorities)', inputSchema: { type: 'object', properties: { mintAddress: { type: 'string', description: 'SPL token mint address', }, network: { type: 'string', enum: ['mainnet', 'testnet'], description: 'Network type (defaults to mainnet)', }, }, required: ['mintAddress'], }, },
  • Handler case in handleSolanaTool function that processes tool arguments and invokes the SolanaService.getTokenMetadata method.
    case 'get_solana_token_metadata': { const mintAddress = args?.mintAddress as string; const network = (args?.network as 'mainnet' | 'testnet') || 'mainnet'; const result = await solanaService.getTokenMetadata(mintAddress, network); return { content: [ { type: 'text', text: JSON.stringify(result, null, 2), }, ], isError: !result.success, }; }
  • Core helper method in SolanaService that retrieves SPL token metadata by calling getAccountInfo RPC on the mint address and parsing the mint info.
    async getTokenMetadata( mintAddress: string, network: 'mainnet' | 'testnet' = 'mainnet' ): Promise<EndpointResponse> { const service = this.blockchainService.getServiceByBlockchain('solana', network); if (!service) { return { success: false, error: `Solana service not found for ${network}`, }; } try { // Get account info for the mint const result = await this.blockchainService.callRPCMethod( service.id, 'getAccountInfo', [ mintAddress, { encoding: 'jsonParsed', }, ] ); if (!result.success || !result.data?.value) { return { success: false, error: 'Token mint not found or invalid', }; } const mintInfo = result.data.value.data?.parsed?.info; if (!mintInfo) { return { success: false, error: 'Invalid token mint data', }; } return { success: true, data: { mint: mintAddress, decimals: mintInfo.decimals, supply: mintInfo.supply, mintAuthority: mintInfo.mintAuthority, freezeAuthority: mintInfo.freezeAuthority, isInitialized: mintInfo.isInitialized, }, metadata: result.metadata, }; } catch (error) { return { success: false, error: error instanceof Error ? error.message : 'Failed to get Solana token metadata', }; } }

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/buildwithgrove/mcp-pocket'

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