Skip to main content
Glama

Inverse quote — size a buy or sell to reach a target outcome price

problee_quote_to_price
Read-onlyIdempotent

Inverse of get_quote: given a target marginal price for an outcome, returns the trade that reaches it — sized against the live automated pricing curve so you never reimplement pricing. Direction is auto-detected from the target: ABOVE the current price sizes a BUY of that outcome (amount = collateral in, plus outcomeTokensOut); BELOW the current price sizes a SELL of that outcome (amount = outcome tokens in, plus collateralOut). Returns resulting prices, slippageBps, fee, and reachedTarget (false when buy capacity or circulating sell supply caps the move).

Examples: Size a buy of outcome 1 to reach price 0.60 (above current → buy); Size a sell of outcome 1 to reach price 0.40 (below current → sell)

Input Schema

NameRequiredDescriptionDefault
sideYes`side` = which OUTCOME (0-indexed: 0=outcome1,1=outcome2,2=outcome3), NOT buy/sell. Buy/sell is the direction field (`type`/`tradeType`/`action`/`direction`). Encoded here as the outcome label string ('outcome1'|'outcome2'|'outcome3'), not the 0-indexed TradeSide int used on REST /trade/* bodies.
chainIdNo
targetPriceYes
marketAddressYes

Output Schema

NameRequiredDescriptionDefault
resultYes

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4.3/5.0
Behavior4/5

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

Adds real behavior beyond the annotations (which already declare it read-only, idempotent, non-destructive): it discloses the returned fields (resulting prices, slippageBps, fee, reachedTarget) and, importantly, the failure mode where reachedTarget is false because buy capacity or circulating sell supply caps the move. It does not say whether fees/curve state mutate between call and execution, but that is minor for a computed quote.

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?

Front-loaded with the core contract in the first clause, then direction rules, then return fields. The trailing "Examples:" line largely restates the direction rule already given in prose, so it is slightly redundant rather than strictly earning its place.

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?

An output schema exists so return shape need not be restated, and the description still covers the one return field whose semantics matter (reachedTarget false). Remaining gaps — chainId defaulting, marketAddress format, and whether the quote is an upper bound under movement — are modest for a read-only pricing helper.

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

Parameters4/5

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

With only 25% schema coverage the description must compensate, and it does for the highest-risk parameter: it explains that targetPrice is a marginal outcome price and that direction is inferred from its relation to the current price, which resolves the buy/sell confusion the `side` enum warns about. It adds nothing about chainId (optional, default chain?) or marketAddress format, leaving part of the coverage gap open.

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?

States a specific verb and resource ("Inverse of get_quote: given a target marginal price for an outcome, returns the trade that reaches it"), explicitly positions itself relative to the sibling get_quote, and the title reinforces it as a sizing tool rather than an execution tool. An agent can distinguish it from get_quote/prepare_trade without opening a schema.

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?

Gives concrete when-to-use framing ("sized against the live automated pricing curve so you never reimplement pricing") and two worked examples (target 0.60 above current → buy; 0.40 below → sell). It does not address when to prefer simulate_trade, estimate_market_order, or prepare_trade instead, so there is no explicit exclusion set.

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

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.