Skip to main content
Glama
XCP
by XCP

compose_order

Compose a DEX order to trade Counterparty assets on Bitcoin. Specify total amounts for assets to automatically calculate the per-unit price.

Instructions

Compose a DEX order to trade Counterparty assets. IMPORTANT: give_quantity and get_quantity are TOTAL amounts, not per-unit prices. The price per unit is the ratio between them. Example: to buy 1000 TOKENA at 0.5 XCP each, set give_asset=XCP, give_quantity=50010^8 (500 XCP total), get_asset=TOKENA, get_quantity=1000. Example: to sell 50 XCP for BTC at 0.001 BTC per XCP, set give_asset=XCP, give_quantity=5010^8, get_asset=BTC, get_quantity=50*100000 (0.05 BTC total).

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
addressYesSource Bitcoin address
get_assetYesAsset to receive/buy
expirationYesNumber of blocks until order expires (max 8064, ~2 months)
give_assetYesAsset to give/sell
inputs_setNoComma-separated UTXOs to use as inputs (txid:vout)
fee_requiredNoBTC fee required from counterparty for BTC trades (in satoshis). Use 0 (recommended) unless you specifically need to require a fee.
get_quantityYesTOTAL raw integer amount to receive (not per-unit). For divisible assets: human amount * 10^8. For BTC: satoshis. Price = give_quantity / get_quantity.
give_quantityYesTOTAL raw integer amount to give (not per-unit). For divisible assets: human amount * 10^8. For BTC: satoshis.
sat_per_vbyteNoFee rate in satoshis per virtual byte (e.g. 1, 5.5, 0.15). Check get_fee_estimate for current market rates.
Behavior5/5

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

Annotations already indicate this is not read-only (readOnlyHint=false) and not destructive, but the description adds a crucial behavioral nuance: give_quantity and get_quantity are TOTAL amounts, not per-unit prices, with the price being their ratio. This is a common misuse trap and the examples clearly illustrate the correct interpretation, going far beyond the annotations.

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 somewhat long but every sentence is purposeful, front-loading the critical warning about total amounts before providing examples. The two examples are redundant in some ways but helpfully cover both buy and sell directions, making the length justified.

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?

For a 9-parameter compose tool, the description thoroughly covers the most error-prone aspect (total vs. per-unit amounts) and the schema documents all other parameters. It doesn't mention the return format, but the 'compose' naming convention and the sibling broadcast_transaction tool imply the output, so this is a minor gap given the tool's complexity.

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 descriptions cover all 9 parameters, but the description adds significant value by clarifying the semantics of give_quantity and get_quantity, including the 10^8 multiplier for divisible assets, satoshis for BTC, and how to interpret the price ratio. The two concrete examples (buying TOKENA and selling XCP) make the parameter usage unambiguous.

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 'Compose a DEX order to trade Counterparty assets,' using a specific verb (compose) and resource (DEX order). It distinguishes from sibling compose tools like compose_send and compose_issuance by focusing specifically on orders, with examples for both buying and selling.

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 implicitly indicates usage by providing buy and sell examples, making it clear this tool is for creating DEX orders. However, it does not explicitly mention when not to use it or name alternatives (e.g., compose_cancel for cancelling), leaving room for slightly more explicit guidance.

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/XCP/mcp-server'

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