Skip to main content
Glama

write_account_automations

Idempotent

Configure an account's automations from a list of intents and return the unsigned setAssetManagers transaction. The backend resolves which asset managers each intent needs, validates that the combination is compatible, encodes the metadata and builds the calldata, so you describe the desired outcome rather than the contracts.

With mode 'save' (the default) the intents array is the complete desired state: the backend diffs it against what is currently enabled, so any automation you leave out is DISABLED by the returned transaction. Pass a single intent with enabled: false to turn everything off.

Mode 'preview' validates and resolves the intents WITHOUT reading chain state and returns no transaction, because its calldata carries no disable entries and would only partially apply the state. Use it to check a combination is legal or to show a plan; use 'save' to get something signable. To toggle one automation without restating the rest, use write_account_automations_delta.

Intents:

  • compound_fees: reinvest earned fees/rewards back into the LP. Optional 'tokens' scopes it per yielding token. A staked reward that is not a pool token is swapped in via CowSwap automatically.

  • claim_rewards: claim yield out. config.mode as_earned pays the tokens as-is, convert_to swaps them to config.buy_token via CowSwap. config.convert_tokens converts only a subset and claims the rest as-earned. config.destination account or wallet.

  • add_to_lp: fold idle pool-token balances (deposits, rebalance leftovers) back into the LP. Opt-in per token.

  • claim_merkl: auto-claim Merkl incentive rewards. Independent of the compounder/claimer/cowswapper triad and needs no position context.

  • rebalance: reposition the LP. strategy out_of_range (default), take_profit (runs on the dedicated profit-taker contract), or protocol_owned_liquidity.

Pass position_id (from assets[] in read_account_info) and the backend fills in protocol, is_staked, token0, token1 and reward_tokens for you; anything you pass explicitly wins. claim_merkl needs no position context.

Rules the backend enforces (a violation is returned as an error, never written on-chain):

  • Every yielding token must be assigned to exactly one of compound_fees or claim_rewards. Scoping one to a subset without covering the rest is rejected, and no token may be in both.

  • A wallet or custom-recipient payout requires a pure as-earned claim: nothing converted, and every yielding token claimed. Converts settle in the account.

  • convert_tokens must be a subset of the claimed tokens, and buy_token cannot be a compounded token, a converted token, or an add_to_lp folded token.

  • Each intent kind may appear only once, and a token list must not be empty or name a token the position does not yield.

Returns { valid, errors, warnings, human_summary, plan, diff, transaction }. When a compatibility rule fires the call returns an error and no transaction: read errors[].reason, adjust the intents and retry. There is deliberately no transaction when the account already matches the request (no_changes_needed), when the Tenderly simulation predicts a revert (an error), or in preview mode (preview_only). Call read_asset_manager_intents first to see which intents this account can enable.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
modeNosave diffs against on-chain state and returns a signable transaction that also disables anything omitted. preview resolves and validates only, returning a plan and no transaction.save
ownerNoAccount owner EOA. Used to resolve wallet payout targets.
token0NoPool token0 address.
token1NoPool token1 address.
intentsYesComplete desired automation state. In save mode anything omitted is disabled, so include every automation to keep. A single intent with enabled: false disables all automations.
chain_idNoChain ID: 8453 (Base), 130 (Unichain), 10 (Optimism), or 4663 (Robinhood)
protocolNoPosition's DEX protocol. Only needed when position_id is omitted. Accepts the dex_protocol values the read tools return (slipstream, staked_slipstream_v3, uniV3, ...), which imply is_staked, as well as the canonical slipstream_v1 / uniswap_v3 spellings.
is_stakedNoWhether the LP position is staked. Implied by a staked_* protocol value.
position_idNoLP position (NFT) id, as listed in assets[] by read.account.info. Supply this and the backend fetches protocol, staked flag, tokens and reward tokens for you. Strongly preferred over passing the position fields by hand.
reward_tokensNoStaking reward token addresses.
account_addressYesArcadia account address

Output Schema

TableJSON Schema
NameRequiredDescriptionDefault
diffNo
planYes
validYes
errorsYes
warningsYes
descriptionYes
transactionNo
preview_onlyNo
human_summaryYes
simulation_urlNo
no_changes_neededNo
tenderly_sim_statusNo

TDQS

A4.9/5.0
Behavior5/5

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

The description discloses critical behavioral traits beyond the annotations: in save mode the intents array is the complete desired state and omitted automations are disabled, preview mode returns no transaction, and no transaction is returned for no_changes_needed, simulation reverts, or preview_only. It also explains error handling and that compatibility violations are returned as errors rather than written on-chain. This aligns with the idempotentHint and non-destructive semantics.

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?

Although long, the description is dense and front-loaded: the core purpose and mode semantics appear first, then intents, then rules, then return behavior. Every section earns its place for a tool this complex, and the structure lets an agent quickly locate the most decision-relevant information.

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?

The description fully covers prerequisites (read_asset_manager_intents, position_id), mode differences, return fields (valid, errors, warnings, human_summary, plan, diff, transaction), cases with no transaction, and enforcement rules. With an output schema present, the description does not need to restate return shapes, and it still adds the edge-case behavior an agent must know to call the tool safely.

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?

Schema coverage is 100% and the schema already documents parameters richly, so the baseline is 3. The description adds meaningful semantic context by explaining how the backend resolves asset managers, that position_id causes protocol, is_staked, token0, token1 and reward_tokens to be auto-filled, and that explicit values win. It also clarifies intent-kind behaviors and cross-intent compatibility rules, going beyond the schema's per-field descriptions.

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 states a specific verb and resource: 'Configure an account's automations from a list of intents and return the unsigned setAssetManagers transaction.' It also distinguishes itself from write_account_automations_delta and read_asset_manager_intents, making sibling differentiation clear even before reading the schema.

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?

The description gives explicit when-to-use/when-not-to-use guidance: use 'preview' to validate and show a plan, use 'save' to get a signable transaction, and use write_account_automations_delta to toggle a single automation without restating the rest. It also instructs the agent to call read_asset_manager_intents first to discover which intents are available.

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.

TDQS

A4.2/5.0
Disambiguation5/5

Each tool targets a distinct resource and action, with clear read/write separation and detailed descriptions that specify exact use cases. Overlapping tools like write_account_deposit vs write_account_add_liquidity explicitly cross-reference to avoid misuse, and the asset-manager variants are clearly differentiated by staking/compounding/CowSwap behaviors.

Naming Consistency5/5

All tools follow a consistent read_* / write_* prefix with snake_case resource and action naming. Subgroup patterns are uniform (e.g., write_account_*, write_asset_manager_*), and the only outlier, dev_send, is intentionally marked as a dev-only exception.

Tool Count2/5

Forty tools is a very large surface, well above the typical 3-15 range for a well-scoped server. The seven separate write_asset_manager_* intent tools are highly granular and could likely be consolidated into a single parameterized automation tool, reducing cognitive load.

Completeness5/5

The tool set covers the full Arcadia lifecycle: account creation, collateral deposit/withdrawal, borrowing/repayment, LP add/remove/close, staking, automations, lending pool deposits/redeems, and comprehensive read operations. No obvious workflow dead ends exist, and all necessary supporting reads (prices, allowances, balances) are present.