Skip to main content
Glama

prepare_autonomous_swap

Prepares an autonomous spot swap within signed delegation bounds by verifying policy invariants, locking an atomic budget reservation, and computing the locked calldata digest for local agent signing.

Instructions

[Capability: available_with_tier_gate; tier: scout_plus; API: /api/v1/agent/authority; authority: /api/v1/agent/status] Prepare an autonomous spot swap within signed delegation bounds from authoritative quote and simulation records. FarmDash verifies 13 policy invariants, locks an atomic budget reservation, and computes the locked calldata digest. The agent signs and broadcasts in its local runtime.

Input Schema

NameRequiredDescriptionDefault
actionNoAction type, defaults to SWAPSWAP
amountNoOptional input amount in token base units
chainIdNoOptional EVM Chain ID
grantIdNoActive delegation grant ID (optional; looked up automatically if omitted)
toTokenNoOptional output token symbol or address
intentIdYesAuthoritative swap intent ID from get_swap_quote
protocolNoTarget protocol router address
fromTokenNoOptional input token symbol or address
slippageBpsNoOptional slippage tolerance in basis points
ownerAddressYesWallet owner EVM address
simulationIdYesAuthoritative preflight simulation ID from simulate_swap_intent
agentSessionIdYesAuthenticated agent session ID
sessionPublicKeyYesAgent local signer public address (must equal ownerAddress for EOA V1)

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv5.0.0

TDQS

A4.1/5.0
Behavior5/5

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

Goes well beyond the annotations (readOnly=false, openWorld=true, idempotent=false, destructive=false) by disclosing the internal sequence: 13 policy invariants verified, an atomic budget reservation locked, and a calldata digest computed before local signing. The locked reservation is exactly the kind of side effect an agent needs to know about to avoid or clean up after.

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?

Three dense sentences that front-load the gating metadata then the action and its effects; little waste. The bracketed capability/tier/API-path header is metadata noise for the calling agent but is at least placed first and kept short.

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 13-parameter, non-idempotent preparation tool with no output schema, the description conveys the key state transitions (policy check, budget lock, digest) and clarifies signing is out-of-band. It does not cover reservation lifetime/expiry or what must happen if the swap is never confirmed, which matters given the atomic lock.

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 the schema already documents intentId, simulationId, grantId, sessionPublicKey and the optional swap fields. The description adds only directional context (inputs must come from authoritative quote/simulation records and from a signed delegation), which maps loosely onto intentId/simulationId/grantId but contributes no new syntax or format detail.

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+resource with scope: 'Prepare an autonomous spot swap within signed delegation bounds.' It also bounds the side effect explicitly ('The agent signs and broadcasts in its local runtime'), which distinguishes it from execute_swap/confirm_autonomous_swap without needing to name them.

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

Usage Guidelines3/5

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

Prerequisites are implied ('from authoritative quote and simulation records'), and the tier gate ('scout_plus') is stated, but there is no explicit when-to-use/when-not or pointer to the follow-up tools (confirm_autonomous_swap, release_autonomous_reservation) that an agent must pick after this call. Usage is inferred rather than directed.

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

Deploy Server

Other Tools