Skip to main content
Glama

delegate

Stake tokens with a chosen validator on MantraChain by specifying the amount, network, and validator address. Use the MCP server to manage blockchain assets efficiently.

Instructions

Delegate/Stake tokens to a validator

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesAmount of tokens to delegate
denomNoOptional denomination of the tokens, default is network's default denom
memoNoOptional memo for the transaction
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
operatorAddressYesAddress of the validator to delegate to

Implementation Reference

  • Handler function that implements the logic for the 'delegate' tool by initializing the MantraClient and calling stakeTokens to delegate tokens to a validator.
    async ({ operatorAddress, amount, denom, networkName, memo }) => { await mantraClient.initialize(networkName); // Delegate the tokens const result = await mantraClient.stakeTokens({ operatorAddress, amount, denom, memo }); return { content: [{type: "text", text: JSON.stringify(result)}], }; }
  • Input schema definition for the 'delegate' tool using Zod validation.
    { operatorAddress: z.string().describe("Address of the validator to delegate to"), amount: z.string().describe("Amount of tokens to delegate"), denom: z.string().optional().describe("Optional denomination of the tokens, default is network's default denom"), 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."), memo: z.string().optional().describe("Optional memo for the transaction") },
  • Registration of the 'delegate' tool on the MCP server using server.tool, including description, schema, and handler function.
    server.tool( "delegate", "Delegate/Stake tokens to a validator", { operatorAddress: z.string().describe("Address of the validator to delegate to"), amount: z.string().describe("Amount of tokens to delegate"), denom: z.string().optional().describe("Optional denomination of the tokens, default is network's default denom"), 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."), memo: z.string().optional().describe("Optional memo for the transaction") }, async ({ operatorAddress, amount, denom, networkName, memo }) => { await mantraClient.initialize(networkName); // Delegate the tokens const result = await mantraClient.stakeTokens({ operatorAddress, amount, denom, memo }); return { content: [{type: "text", text: JSON.stringify(result)}], }; } );
  • High-level registration call to registerStakingTools which defines and registers the 'delegate' tool among others.
    registerStakingTools(server, mantraClient);

Other Tools

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

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