Skip to main content
Glama
armorwallet
by armorwallet

stake_quote

Generate a stake quote for token swaps by submitting a StakeQuoteRequestContainer, returning a SwapQuoteRequestContainer for blockchain staking operations.

Instructions

Retrieve a stake quote.

Expects a StakeQuoteRequestContainer, returns a SwapQuoteRequestContainer.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
stake_quote_requestsYes

Implementation Reference

  • The MCP tool handler for the 'stake_quote' tool. It validates input, calls the armor_client.stake_quote method, and handles errors.
    @mcp.tool()
    async def stake_quote(stake_quote_requests: StakeQuoteRequestContainer) -> SwapQuoteRequestContainer:
        """
        Retrieve a stake quote.
        
        Expects a StakeQuoteRequestContainer, returns a SwapQuoteRequestContainer.
        """
        if not armor_client:
            return [{"error": "Not logged in"}]
        try:
            result: StakeQuoteRequestContainer = await armor_client.stake_quote(stake_quote_requests)
            return result
        except Exception as e:
            return [{"error": str(e)}]
  • Pydantic model defining the input schema for a single stake quote request.
    class StakeQuoteRequest(BaseModel):
        from_wallet: str = Field(description="The name of the wallet that input_token is in.")
        input_token: str = "So11111111111111111111111111111111111111112"  # Hardcoded SOL token address
        output_token: str = Field(description="the public mint address of the output liquid staking derivative token to stake.") # "jupSoLaHXQiZZTSfEWMTRRgpnyFm8f6sZdosWBjx93v"
        input_amount: float = Field(description="input amount to swap")
  • Pydantic container model for the list of StakeQuoteRequest used as input to the stake_quote tool.
    class StakeQuoteRequestContainer(BaseModel):
        stake_quote_requests: List[StakeQuoteRequest]
  • Helper method in ArmorWalletAPIClient that makes the API call to get stake quote from the backend service.
    async def stake_quote(self, data: StakeQuoteRequestContainer) -> StakeQuoteRequestContainer:
        """Obtain a stake quote."""
        payload = data.model_dump(exclude_none=True)['stake_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