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 from Solana blockchain networks using Grove's Pocket Network server.

Instructions

Get SPL token metadata (decimals, supply, authorities)

Input Schema

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

Implementation Reference

  • Core implementation of the get_solana_token_metadata tool. Fetches the SPL token mint account info via RPC, parses metadata including decimals, supply, mint/freeze authorities.
    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',
        };
      }
    }
  • Wrapper handler in handleSolanaTool function that extracts input arguments and delegates to SolanaService.getTokenMetadata, formats the response for MCP.
    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,
      };
    }
  • Input schema definition for the tool, specifying required mintAddress and optional network parameters.
    {
      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'],
      },
    },
  • src/index.ts:88-101 (registration)
    Registration of all tools including Solana tools via registerSolanaHandlers, collected into tools list used for listTools response.
    const tools: Tool[] = [
      ...registerBlockchainHandlers(server, blockchainService),
      ...registerDomainHandlers(server, domainResolver),
      ...registerTransactionHandlers(server, advancedBlockchain),
      ...registerTokenHandlers(server, advancedBlockchain),
      ...registerMultichainHandlers(server, advancedBlockchain),
      ...registerContractHandlers(server, advancedBlockchain),
      ...registerUtilityHandlers(server, advancedBlockchain),
      ...registerEndpointHandlers(server, endpointManager),
      ...registerSolanaHandlers(server, solanaService),
      ...registerCosmosHandlers(server, cosmosService),
      ...registerSuiHandlers(server, suiService),
      ...registerDocsHandlers(server, docsManager),
    ];
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states what metadata is retrieved but lacks details on permissions, rate limits, error handling, or response format. For a read operation with no annotation coverage, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose and lists key metadata fields without unnecessary words. Every part of the sentence contributes directly to understanding the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of blockchain data retrieval, no annotations, and no output schema, the description is incomplete. It doesn't cover behavioral aspects like authentication, rate limits, or error cases, and lacks details on the return structure (e.g., JSON format, nested fields). For a tool in this domain, more context is needed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema fully documents both parameters (mintAddress and network). The description doesn't add any parameter-specific details beyond what's in the schema, such as format examples for mintAddress or network implications. Baseline 3 is appropriate when the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose with a specific verb ('Get') and resource ('SPL token metadata'), and lists key metadata fields (decimals, supply, authorities). However, it doesn't explicitly differentiate from sibling tools like 'get_token_metadata' or 'get_solana_account_info', which might provide overlapping or related functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. With many sibling tools (e.g., 'get_token_metadata', 'get_solana_account_info', 'get_solana_token_balance'), there's no indication of how this tool differs or when it's the appropriate choice, leaving usage context implied at best.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

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