Skip to main content
Glama
armorwallet
by armorwallet

swap_quote

Retrieve accurate swap quotes for crypto trades by specifying input/output tokens, amounts, and slippage. Designed for seamless integration with Armor Crypto MCP's blockchain operations and trading strategies.

Instructions

Retrieve a swap quote. Be sure to add slippage!

Expects a SwapQuoteRequestContainer, returns a list of SwapQuoteResponse.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
swap_quote_requestsYes

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
resultYes

Implementation Reference

  • MCP tool handler for 'swap_quote'. Decorated with @mcp.tool() for registration. Handles authentication check and delegates to armor_client.swap_quote, returning List[SwapQuoteResponse] or error.
    @mcp.tool()
    async def swap_quote(swap_quote_requests: SwapQuoteRequestContainer) -> List[SwapQuoteResponse]:
        """
        Retrieve a swap quote. Be sure to add slippage!
        
        Expects a SwapQuoteRequestContainer, returns a list of SwapQuoteResponse.
        """
        if not armor_client:
            return [{"error": "Not logged in"}]
        try:
            result: List[SwapQuoteResponse] = await armor_client.swap_quote(swap_quote_requests)
            return result
        except Exception as e:
            return [{"error": str(e)}]
  • Input schema model SwapQuoteRequest used within SwapQuoteRequestContainer for the swap_quote tool.
    class SwapQuoteRequest(BaseModel):
        from_wallet: str = Field(description="The name of the wallet that input_token is in.")
        input_token: str = Field(description="public mint address of input token. To get the address from a token symbol use `get_token_details`")
        output_token: str = Field(description="public mint address of output token. To get the address from a token symbol use `get_token_details`")
        input_amount: float = Field(description="input amount to swap")
        slippage: float = Field("slippage percentage. To estimate slippage based on liquidity see `get_token_details` for the input_token_symbol. 1.0 for high liquidity and near 20.0 for lower liquidity.")
  • Output schema model SwapQuoteResponse returned as List by the swap_quote tool.
    class SwapQuoteResponse(BaseModel):
        id: str = Field(description="unique id of the generated swap quote")
        wallet_address: str = Field(description="public address of the wallet")
        input_token_symbol: str = Field(description="symbol of the input token")
        input_token_address: str = Field(description="public address of the input token")
        output_token_symbol: str = Field(description="symbol of the output token")
        output_token_address: str = Field(description="public address of the output token")
        input_amount: float = Field(description="input amount in input token")
        output_amount: float = Field(description="output amount in output token")
        slippage: float = Field(description="slippage percentage.")
  • Container schema for input: holds List[SwapQuoteRequest], direct parameter type of swap_quote handler.
    class SwapQuoteRequestContainer(BaseModel):
        swap_quote_requests: List[SwapQuoteRequest]
  • Helper method in ArmorWalletAPIClient that performs the actual API call to get swap quotes, called by the MCP handler.
    async def swap_quote(self, data: SwapQuoteRequestContainer) -> List[SwapQuoteResponse]:
        """Obtain a swap quote."""
        # payload = [v.model_dump() for v in data.swap_quote_requests]
        payload = data.model_dump(exclude_none=True)['swap_quote_requests']
        return await self._api_call("POST", "transactions/quote/", payload)
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden but provides minimal behavioral information. It mentions 'returns a list of SwapQuoteResponse' but doesn't describe what a swap quote contains, whether this is a read-only operation, potential rate limits, authentication requirements, or error conditions. For a financial tool with no annotations, this is inadequate disclosure.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness3/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is brief (3 sentences) but not optimally structured. The first sentence states purpose, the second gives a vague requirement, and the third describes input/output types. However, the middle sentence about slippage interrupts the logical flow, and the description could be more front-loaded with essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of a swap quote tool (financial operation with multiple parameters), the description is incomplete. While an output schema exists (which helps), the description doesn't explain the tool's role in a workflow, doesn't clarify it's a quote/estimation tool versus execution, and provides minimal parameter guidance. For a tool with 0% schema coverage and no annotations, this leaves significant gaps.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate but fails to do so. It mentions 'Expects a SwapQuoteRequestContainer' but doesn't explain what this contains or how to structure it. The only parameter guidance is the vague 'Be sure to add slippage!' without explaining what slippage is or how to determine appropriate values. This leaves critical parameters undocumented.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Retrieve a swap quote' which is a specific verb+resource combination. It distinguishes from sibling tools like 'swap_transaction' (which executes) and 'stake_quote' (different operation). However, it doesn't explicitly differentiate from 'calculate_token_conversion' which might have overlapping functionality.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides some guidance with 'Be sure to add slippage!' which implies this is a required consideration. However, it doesn't explicitly state when to use this tool versus alternatives like 'swap_transaction' (for execution) or 'calculate_token_conversion' (for simpler calculations). The guidance is helpful but incomplete.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

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

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