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
| Name | Required | Description | Default |
|---|---|---|---|
| epoch | No | ||
| pubkeys | Yes |
Implementation Reference
- src/server.py:482-497 (handler)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()