Skip to main content
Glama

get-available-rewards

Query and retrieve all available rewards for a specific address on the MantraChain blockchain using the MCP server. Requires the network name for accurate results.

Instructions

Get all available rewards for an address

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressNoAddress to query for available rewards
networkNameYesName of the network to use - must first check what networks are available through the mantrachain-mcp server by accessing the networks resource `networks://all` before you pass this arguments

Implementation Reference

  • MCP tool registration for 'get-available-rewards', including Zod input schema (address optional, networkName required) and inline handler that initializes MantraClient and fetches rewards.
    server.tool( "get-available-rewards", "Get all available rewards for an address", { address: z.string().optional().describe("Address to query for available rewards"), networkName: z.string().refine(val => Object.keys(networks).includes(val), { message: "Must be a valid network name" }).describe("Name of the network to use - must first check what networks are available by accessing the networks resource `networks://all` before you pass this arguments. Defaults to `mantra-dukong-1` testnet."), }, async ({ address, networkName }) => { await mantraClient.initialize(networkName); const rewards = await mantraClient.getAvailableRewards(address); return { content: [{type: "text", text: JSON.stringify(convertBigIntToString(rewards))}], }; } );
  • Core handler logic in StakingService: queries delegation total rewards using the distribution extension on queryClient.
    async getAvailableRewards(address?: string) { try { const delegatorAddress = address || this.address; const response = await this.queryClient.distribution.delegationTotalRewards(delegatorAddress); return response; } catch (error) { throw new Error(`Failed to fetch available rewards: ${error instanceof Error ? error.message : String(error)}`); } }
  • MantraClient wrapper method that delegates getAvailableRewards call to the underlying StakingService.
    async getAvailableRewards(address?: string) { if (!this.stakingService) { throw new Error('Client not initialized. Call initialize() first.'); } return this.stakingService.getAvailableRewards(address); }

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/allthatjazzleo/mantrachain-mcp'

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