Skip to main content
Glama

Chainflip Broker as a Service

Start Swap

start_swap

Start a cross-chain swap. Returns the deposit address where you should send your source asset. API key is optional.

Tool call template

Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {
      "sourceAsset": "<sourceAsset>",
      "destinationAsset": "<destinationAsset>",
      "destinationAddress": "<destinationAddress>",
      "refundAddress": "<refundAddress>"
    },
    "name": "start_swap"
  }
}

Input Schema

NameRequiredDescriptionDefault
apiKeyNoOptional partner API key.
sourceAssetYesSource asset identifier (e.g., 'btc.btc', 'eth.eth', 'usdc.eth')
minimumPriceNoOptional minimum accepted price as a destination-per-source ratio (e.g., for a btc.btc to eth.eth swap, 28.5 means 1 BTC gets at least 28.5 ETH). When omitted, automatically calculated from current pool prices with 2% slippage tolerance. Set to 0 to accept any price.
refundAddressYesRefund address on the source chain, used if minimum price cannot be met
destinationAssetYesDestination asset identifier (e.g., 'eth.eth', 'btc.btc', 'sol.sol')
destinationAddressYesDestination address on the target chain
livePriceSlippageTolerancePercentNoOptional live price protection: how far, in percent (0 to 100, at most 2 decimals, e.g. 0.5), the execution price may fall below Chainflip's oracle price before the swap is retried and then refunded. Use a quote's recommendedLivePriceSlippageTolerancePercent. When either asset has no oracle price on Chainflip, live price protection is omitted and the swap proceeds without it. When omitted, Chainflip's default protection for the pair applies.

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / livePriceSlippageTolerancePercent / description
      Previous value: -"Optional live price protection: how far, in percent (0 to 100, at most 2 decimals, e.g. 0.5), the execution price may fall below Chainflip's oracle price before the swap is retried and then refunded. Use a quote's recommendedLivePriceSlippageTolerancePercent. Rejected when either asset has no oracle price on Chainflip. When omitted, Chainflip's default protection for the pair applies."New value: +"Optional live price protection: how far, in percent (0 to 100, at most 2 decimals, e.g. 0.5), the execution price may fall below Chainflip's oracle price before the swap is retried and then refunded. Use a quote's recommendedLivePriceSlippageTolerancePercent. When either asset has no oracle price on Chainflip, live price protection is omitted and the swap proceeds without it. When omitted, Chainflip's default protection for the pair applies."
  2. Changed1 schema field changed
    • addedInput schema / properties / livePriceSlippageTolerancePercent
      Added value: +{
      +  "default": null,
      +  "description": "Optional live price protection: how far, in percent (0 to 100, at most 2 decimals, e.g. 0.5), the execution price may fall below Chainflip's oracle price before the swap is retried and then refunded. Use a quote's recommendedLivePriceSlippageTolerancePercent. Rejected when either asset has no oracle price on Chainflip. When omitted, Chainflip's default protection for the pair applies.",
      +  "type": [
      +    "number",
      +    "null"
      +  ]
      +}
  3. First observed

TDQS

A3.5/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false, openWorldHint=true, idempotentHint=false, and destructiveHint=false, so the safety profile is known. The description adds a genuinely important behavioral trait not present in the annotations or any output schema: the call returns a deposit address and the user must then send the source asset, i.e. it is a two-step, non-executing operation. It still omits deposit-address expiry, minimum-amount requirements, retry/refund behavior, and authentication expectations beyond "API key is optional".

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 short sentences, front-loaded with the action and immediately followed by the return value. There is no filler, and the key non-obvious fact (deposit address) is given maximum prominence.

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 7-parameter mutation tool with no output schema, the description is adequate but thin: it correctly conveys what comes back, but leaves out what an agent needs to advise a caller, such as how long the deposit address stays valid, how to poll with check_status, and what happens on a failed/refunded swap. Annotations cover part of the gap, keeping it at minimum-viable rather than inadequate.

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% and the schema text is rich (including the minimumPrice slippage semantics and the livePriceSlippageTolerancePercent ranges). The description adds nothing beyond "API key is optional," repeating what the schema's default null already conveys. Baseline 3 applies when the schema does the heavy lifting.

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?

"Start a cross-chain swap" names a specific verb and resource, and the second sentence clarifies the concrete effect (it returns a deposit address rather than moving funds). It does not distinguish itself from the sibling start_dca_swap, so an agent must infer the split between a one-off swap and a DCA schedule.

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

Usage Guidelines2/5

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

There is no explicit when-to-use statement, no precondition such as fetching a quote from get_quotes/get_native_quotes first, and no exclusion pointing at start_dca_swap for recurring swaps. Usage is only implicitly suggested by the tool name and the deposit-address sentence.

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.