Skip to main content
Glama

get_quote

Retrieve a best-execution quote from the Ophis orderbook for swapping tokens on a given chain. Specify sell or buy amount in atoms, and get the quote including fees and validity.

Instructions

Fetch a best-execution quote from the chain's Ophis orderbook (use a chainId from list_chains' tradeable). Amounts are in atoms (smallest unit, uint256 decimal string). For kind='sell' the amount is the sell amount before fee; for kind='buy' it is the desired buy amount. Returns the orderbook quote (sellAmount/buyAmount/feeAmount/validTo). Before build_order, apply slippage to the limit side by kind: kind='sell' -> lower buyAmount (min out); kind='buy' -> raise sellAmount (max in).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
chainIdYesEVM chain id (use list_chains for supported chains).
sellTokenYesSell token address (0x...).
buyTokenYesBuy token address (0x...).
kindYes'sell' = you specify the sell amount; 'buy' = you specify the buy amount.
amountYesAmount in atoms (uint256 decimal string).
fromYesThe trading account address (quotes are account-aware).
validForSecondsNoQuote validity window in seconds (default 1200 = 20 min).
Behavior4/5

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

With no annotations, the description carries full burden. It discloses key behaviors: amounts are in atoms (uint256 decimal string), kind semantics for sell vs buy, return fields (sellAmount/buyAmount/feeAmount/validTo), and slippage instructions. It could explicitly state it is a read-only operation, but the 'Fetch' verb implies that. Overall, it provides substantial transparency.

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

Conciseness4/5

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

The description is a single paragraph of 4 sentences, each earning its place. It starts with the primary purpose, then covers units, kind, return values, and follow-up action (slippage). It is well-structured and sufficiently concise, though a minor reorganization could improve scannability.

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

Completeness5/5

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

Despite lacking an output schema, the description explains the return fields (sellAmount/buyAmount/feeAmount/validTo) and provides crucial contextual links: using chainId from list_chains and applying slippage before build_order. For a 7-parameter tool with 6 required, it covers all essential information an agent needs to use the tool correctly.

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

Parameters5/5

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

Schema description coverage is 100%, but the description adds significant meaning beyond the schema: it explains that amounts are in atoms (uint256 decimal string), clarifies kind semantics ('kind='sell' the amount is the sell amount before fee; kind='buy' it is the desired buy amount'), and states that validForSeconds defaults to 1200. This enriches the parameter understanding beyond what the schema provides.

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?

Description starts with a clear verb-resource pair: 'Fetch a best-execution quote from the chain's Ophis orderbook'. It specifies the resource (quote) and context (Ophis orderbook), and distinguishes from siblings by referencing list_chains for chainId and build_order for subsequent steps.

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

Usage Guidelines4/5

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

The description provides explicit usage context: 'use a chainId from list_chains' and 'Before build_order, apply slippage...'. While it does not list when not to use this tool, it implicitly differentiates from sibling tools like list_chains and build_order, offering sufficient guidance for an agent.

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/ophis-fi/ophis'

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