Skip to main content
Glama

write_account_swap

Idempotent

Flash-action: swaps assets within an Arcadia account in one atomic transaction. The backend finds the optimal swap route. NOTE: If you are closing a position (swap + repay + withdraw), prefer write_account_close which batches everything atomically. Only use this tool for standalone swaps within an active position. The returned calldata is time-sensitive: sign and broadcast within 30 seconds. If the transaction reverts due to price movement, rebuild and sign again immediately (retry at least once before giving up). Response includes tenderly_sim_url and tenderly_sim_status for pre-broadcast validation: if tenderly_sim_status is 'false', do NOT broadcast the transaction.

Input Schema

NameRequiredDescriptionDefault
asset_toYesToken address to swap to
chain_idNoChain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
slippageNoBasis points, 100 = 1%
amount_inYesRaw units
asset_fromYesToken address to swap from
account_addressYesArcadia account address

Output Schema

NameRequiredDescriptionDefault
afterNo
beforeNo
descriptionNo
transactionYes
price_checksNo
tenderly_sim_urlNo
tenderly_sim_statusNo
expected_value_changeNo
expected_value_change_unavailableNo

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • addedOutput schema / properties / expected_value_change_unavailable
      Added value: +{
      +  "type": "string"
      +}
    • addedOutput schema / properties / price_checks
      Added value: +{
      +  "items": {
      +    "additionalProperties": {},
      +    "properties": {
      +      "pool": {
      +        "type": "string"
      +      },
      +      "status": {
      +        "type": "string"
      +      }
      +    },
      +    "required": [
      +      "pool",
      +      "status"
      +    ],
      +    "type": "object"
      +  },
      +  "type": "array"
      +}
  2. Changed5 schema fields changed
    • changedInput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • removedInput schema / additionalProperties
      Removed value: -false
    • changedOutput schema / $schema
      Previous value: -"http://json-schema.org/draft-07/schema#"New value: +"https://json-schema.org/draft/2020-12/schema"
    • changedOutput schema / properties / after / additionalProperties
      Previous value: -trueNew value: +{}
    • changedOutput schema / properties / before / additionalProperties
      Previous value: -trueNew value: +{}
  3. Changed1 schema field changed
    • changedInput schema / properties / chain_id / description
      Previous value: -"Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)"New value: +"Chain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)"
  4. Changed1 schema field changed
    • changedOutput schema / properties / tenderly_sim_status / enum
      Previous value: -[
      -  "true",
      -  "false",
      -  "unavailable"
      -]New value: +[
      +  "success",
      +  "failure",
      +  "unavailable"
      +]
  5. Changed1 schema field changed
    • changedInput schema / properties / chain_id / description
      Previous value: -"Chain ID: 8453 (Base) or 130 (Unichain)"New value: +"Chain ID: 8453 (Base), 130 (Unichain), or 10 (Optimism)"
  6. Added

TDQS

A4.6/5.0
Behavior5/5

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

Annotations already declare non-read-only, open-world, non-destructive, idempotent. The description adds context annotations cannot carry: calldata expires in 30 seconds, reverts should trigger rebuild-and-resign with at least one retry, and broadcasting must be blocked when tenderly_sim_status is 'false'. That is substantial safety-critical disclosure.

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-loads purpose in the first sentence, then the alternative routing, then the time-sensitivity and simulation gate. Dense but nearly every clause carries operational meaning; the retry instruction runs slightly long but is still functional.

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?

An output schema exists, so return values needn't be enumerated, yet the description still calls out the two fields that matter for safety (tenderly_sim_url, tenderly_sim_status). For a 6-parameter mutation tool with open-world behavior, nothing an agent needs before calling is missing.

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 all six parameters are already documented in the schema (chain IDs, slippage in bps, raw units, token addresses). The description adds no parameter-level detail, so baseline 3 applies.

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 — swapping assets within an Arcadia account via one atomic transaction — and explicitly contrasts itself with the sibling write_account_close. An agent can distinguish it from write_account_borrow/repay/withdraw without reading schemas.

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

Usage Guidelines5/5

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

Gives an explicit exclusion ('If you are closing a position ... prefer write_account_close which batches everything atomically') and an explicit inclusion ('Only use this tool for standalone swaps within an active position'). It also adds operational guidance on retry behavior, which is rare and valuable.

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.