Skip to main content
Glama

unstake_quote

Generate an unstake quote for liquid staking derivative tokens. Input wallet details and token amounts to receive a swap quote response for unstaking transactions.

Instructions

Retrieve an unstake quote.

Expects a UnstakeQuoteRequestContainer, returns a SwapQuoteRequestContainer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
unstake_quote_requestsYes

Implementation Reference

  • MCP tool handler function for 'unstake_quote'. Registers the tool via @mcp.tool() decorator and implements the logic by calling armor_client.unstake_quote with error handling for authentication and exceptions.
    @mcp.tool() async def unstake_quote(unstake_quote_requests: UnstakeQuoteRequestContainer) -> SwapQuoteRequestContainer: """ Retrieve an unstake quote. Expects a UnstakeQuoteRequestContainer, returns a SwapQuoteRequestContainer. """ if not armor_client: return [{"error": "Not logged in"}] try: result: UnstakeQuoteRequestContainer = await armor_client.unstake_quote(unstake_quote_requests) return result except Exception as e: return [{"error": str(e)}]
  • Pydantic BaseModel defining the structure for a single unstake quote request, used within UnstakeQuoteRequestContainer.
    class UnstakeQuoteRequest(BaseModel): from_wallet: str = Field(description="The name of the wallet that input_token is in.") input_token: str = Field(description="the public mint address of the input liquid staking derivative token to unstake.") # "jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v" output_token: str = "So11111111111111111111111111111111111111112" input_amount: float = Field(description="input amount to swap")
  • Pydantic container model holding a list of UnstakeQuoteRequest instances, serving as the input type annotation for the unstake_quote tool handler.
    class UnstakeQuoteRequestContainer(BaseModel): unstake_quote_requests: List[UnstakeQuoteRequest]
  • Supporting method in ArmorWalletAPIClient that serializes the request container to payload and invokes the API POST /transactions/quote/ endpoint to fetch the unstake quote.
    async def unstake_quote(self, data: UnstakeQuoteRequestContainer) -> UnstakeQuoteRequestContainer: """Obtain an unstake quote.""" payload = data.model_dump(exclude_none=True)['unstake_quote_requests'] return await self._api_call("POST", "transactions/quote/", payload)

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/armorwallet/armor-crypto-mcp'

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