Skip to main content
Glama

trust_swap

Get a trust-verified swap quote with calldata. Checks token safety before returning a Uniswap quote for secure token exchanges.

Instructions

Get a trust-verified swap quote with calldata. Checks both tokens for safety before returning a Uniswap quote. Use this instead of raw DEX quotes.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
swapperYesWallet address executing the swap (0x...)
tokenInYesToken being sold (0x...)
tokenOutYesToken being bought (0x...)
amountYesAmount of tokenIn in wei
slippageNoSlippage tolerance (e.g. 0.5 for 0.5%)

Implementation Reference

  • MCP handler for trust_swap tool, which calls the Maiat SDK trustSwap method.
    async ({ swapper, tokenIn, tokenOut, amount, slippage }) => {
      try {
        const data = await sdk.trustSwap({
          swapper,
          tokenIn,
          tokenOut,
          amount,
          slippage,
        });
        return {
          content: [
            {
              type: "text" as const,
              text: JSON.stringify(data, null, 2),
            },
          ],
        };
  • Tool definition and schema registration for trust_swap in the MCP server.
    "trust_swap",
    "Get a trust-verified swap quote with calldata. Checks both tokens for safety before returning a Uniswap quote. Use this instead of raw DEX quotes.",
    {
      swapper: z.string().describe("Wallet address executing the swap (0x...)"),
      tokenIn: z.string().describe("Token being sold (0x...)"),
      tokenOut: z.string().describe("Token being bought (0x...)"),
      amount: z.string().describe("Amount of tokenIn in wei"),
      slippage: z
        .number()
        .optional()
        .describe("Slippage tolerance (e.g. 0.5 for 0.5%)"),
    },
  • SDK implementation of trustSwap, which performs the actual API request.
    /** Get a trust-verified swap quote with calldata */
    async trustSwap(params: TrustSwapParams): Promise<TrustSwapResult> {
      return this.request<TrustSwapResult>("/api/v1/swap/quote", {
        method: "POST",
        body: JSON.stringify(params),
      });
    }
Behavior4/5

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

With no annotations provided, the description carries full burden and does well by disclosing key behavioral traits: it performs safety checks on both tokens before returning a quote, and it generates calldata. However, it doesn't mention potential limitations like rate limits, error conditions, or what happens if tokens fail safety checks.

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

Conciseness5/5

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

The description is extremely concise (two sentences) with zero wasted words. The first sentence states the core purpose, and the second provides crucial usage guidance—every element earns its place.

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?

For a tool with 5 parameters, no annotations, and no output schema, the description provides good purpose and usage context but lacks details about return values, error handling, or operational constraints. It's minimally adequate but leaves gaps in behavioral understanding.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already fully documents all 5 parameters. The description adds no additional parameter semantics beyond what's in the schema, maintaining the baseline score of 3 for adequate but not enhanced parameter understanding.

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

Purpose5/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 with specific verbs ('Get a trust-verified swap quote with calldata') and resources (tokens, Uniswap). It explicitly distinguishes this from 'raw DEX quotes,' making its unique value proposition immediately apparent.

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

Usage Guidelines5/5

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

The description provides explicit guidance on when to use this tool ('Use this instead of raw DEX quotes'), clearly positioning it as the preferred alternative for trust-verified swaps. This directly addresses the agent's decision-making context.

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

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/JhiNResH/maiat-protocol'

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