Skip to main content
Glama

get_quote

Obtain swap quotes for token trading on Casper Network, showing amounts, price impact, and routing paths before executing trades.

Instructions

Get a swap quote for trading between two tokens. Returns amounts, price impact, and routing path.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
token_inYesInput token: symbol (e.g., "CSPR"), name, or contract hash
token_outYesOutput token: symbol (e.g., "USDT"), name, or contract hash
amountYesHuman-readable amount (e.g., "100" for 100 CSPR)
typeYes"exact_in" = specify input amount, "exact_out" = specify desired output amount

Implementation Reference

  • Registration of the 'get_quote' tool within the MCP server, defining its schema and handler function.
    server.tool(
      'get_quote',
      'Get a swap quote for trading between two tokens. Returns amounts, price impact, and routing path.',
      {
        token_in: z.string().describe('Input token: symbol (e.g., "CSPR"), name, or contract hash'),
        token_out: z.string().describe('Output token: symbol (e.g., "USDT"), name, or contract hash'),
        amount: z.string().describe('Human-readable amount (e.g., "100" for 100 CSPR)'),
        type: z.enum(['exact_in', 'exact_out']).describe('"exact_in" = specify input amount, "exact_out" = specify desired output amount'),
      },
      async ({ token_in, token_out, amount, type }) => {
        const quote = await client.getQuote({ tokenIn: token_in, tokenOut: token_out, amount, type });
        return { content: [{ type: 'text' as const, text: JSON.stringify(quote, null, 2) }] };
      },
    );
  • Handler implementation for 'get_quote' which calls client.getQuote.
    async ({ token_in, token_out, amount, type }) => {
      const quote = await client.getQuote({ tokenIn: token_in, tokenOut: token_out, amount, type });
      return { content: [{ type: 'text' as const, text: JSON.stringify(quote, null, 2) }] };
    },
Behavior3/5

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

With no annotations provided, the description carries the full burden. It discloses output contents ('amounts, price impact, and routing path') which compensates for the missing output schema. However, it lacks explicit confirmation that this is read-only, doesn't mention cache duration, liquidity failure modes, or rate limiting.

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?

Two efficient sentences with zero waste. First sentence establishes purpose; second sentence discloses return value structure. Front-loaded and appropriately sized for the tool's complexity.

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

Completeness4/5

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

Given the absence of an output schema, the description usefully specifies what the tool returns (amounts, price impact, routing). With 100% input schema coverage and clear purpose, it is complete enough for invocation, though it could note error conditions (e.g., insufficient liquidity) or auth requirements.

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 fully documents all four parameters (token_in, token_out, amount, type). The description adds minimal semantic context beyond the schema ('trading between two tokens'), meeting the baseline expectation for well-documented schemas.

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 uses specific verb 'Get' with resource 'swap quote' and clearly indicates this retrieves pricing/routing information for trading. While it implies distinction from execution tools like 'build_swap' through the term 'quote', it does not explicitly name siblings or explicitly state this is a read-only simulation.

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 implies usage context by mentioning 'price impact' and 'routing path', suggesting it should be used to evaluate trade feasibility before execution. However, it lacks explicit guidance such as 'Use before build_swap' or conditions like 'Use when you need to know slippage tolerance'.

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/make-software/cspr-trade-mcp'

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