Skip to main content
Glama

undelegate

Remove staked tokens from a validator on the MantraChain network using the MantraChain MCP Server. Specify the validator address, token amount, and network name to execute the undelegation process.

Instructions

Undelegate/Unstake tokens from a validator

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesAmount of tokens to undelegate
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 undelegate from

Implementation Reference

  • The handler function for the MCP 'undelegate' tool. It initializes the MantraClient for the given network and invokes undelegateTokens with the input parameters, returning the transaction result as JSON.
    async ({ operatorAddress, amount, denom, networkName, memo }) => { await mantraClient.initialize(networkName); const result = await mantraClient.undelegateTokens({ operatorAddress, amount, denom, memo }); return { content: [{type: "text", text: JSON.stringify(result)}], }; }
  • Input schema for the 'undelegate' tool using Zod validation for parameters: operatorAddress, amount, denom (optional), networkName, and memo (optional).
    { operatorAddress: z.string().describe("Address of the validator to undelegate from"), amount: z.string().describe("Amount of tokens to undelegate"), 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 'undelegate' MCP tool on the McpServer, including name, description, input schema, and handler function.
    // Define undelegate tool server.tool( "undelegate", "Undelegate/Unstake tokens from a validator", { operatorAddress: z.string().describe("Address of the validator to undelegate from"), amount: z.string().describe("Amount of tokens to undelegate"), 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); const result = await mantraClient.undelegateTokens({ operatorAddress, amount, denom, memo }); return { content: [{type: "text", text: JSON.stringify(result)}], }; } );

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