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
| Name | Required | Description | Default |
|---|---|---|---|
| unstake_quote_requests | Yes |
Implementation Reference
- armor_crypto_mcp/armor_mcp.py:514-527 (handler)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)