Skip to main content
Glama
tywenk

Model Context Protocol Server for Solana Client

by tywenk

get_inflation_reward

Calculate inflation or staking rewards for specific Solana addresses by providing account details and an optional epoch. Retrieve precise reward information for blockchain transactions.

Instructions

Returns the inflation/staking reward for a list of addresses for an epoch.

Args: pubkeys (list[str]): List of account addresses epoch (Optional[int]): Epoch for which to calculate rewards

Returns: str: Inflation reward information

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
epochNo
pubkeysYes

Implementation Reference

  • Handler function for the 'get_inflation_reward' tool. It takes a list of public keys and an optional epoch, queries the Solana RPC client for inflation rewards, and returns a formatted string with the results.
    @mcp.tool() async def get_inflation_reward(pubkeys: list[str], epoch: Optional[int] = None) -> str: """Returns the inflation/staking reward for a list of addresses for an epoch. Args: pubkeys (list[str]): List of account addresses epoch (Optional[int]): Epoch for which to calculate rewards Returns: str: Inflation reward information """ async with AsyncClient(rpc_url) as client: pks = [Pubkey.from_string(pk) for pk in pubkeys] rewards = await client.get_inflation_reward(pks, epoch) return f"Inflation rewards: {rewards}"
  • src/server.py:482-482 (registration)
    The @mcp.tool() decorator registers the get_inflation_reward function as an MCP tool.
    @mcp.tool()

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/tywenk/mcp-sol'

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