Skip to main content
Glama

prepare_autonomous_swap

Prepares an autonomous spot swap within signed delegation limits by validating policy invariants, reserving budget atomically, and computing locked calldata 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.

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": {
      "intentId": "<intentId>",
      "simulationId": "<simulationId>",
      "agentSessionId": "<agentSessionId>",
      "ownerAddress": "<ownerAddress>",
      "sessionPublicKey": "<sessionPublicKey>"
    },
    "name": "prepare_autonomous_swap"
  }
}

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
sessionTokenNo
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. Changed1 schema field changed
    • addedInput schema / properties / sessionToken
      Added value: +{
      +  "maxLength": 256,
      +  "minLength": 32,
      +  "type": "string"
      +}
  2. First observedv5.0.0

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=false and idempotentHint=false, but the description adds real state-side-effect detail the annotations cannot convey: it verifies 13 policy invariants and locks an atomic budget reservation, and it computes a calldata digest for the agent to sign locally. It also discloses the tier gate (scout_plus). It stops short of saying how the reservation is released or what happens if signing fails.

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?

Four tight sentences with no filler; the workflow sequence (verify, reserve, compute digest, sign locally) is easy to follow. Minor weakness: the bracketed capability/API metadata block precedes and partly buries the actual purpose statement, pushing the core verb into the second chunk of text.

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 14-parameter mutation tool with no output schema, the description covers the policy checks and budget reservation well, but omits what the response contains (presumably the digest and reservation ID) and how a held reservation is later released or abandoned. Those are meaningful gaps for an agent coordinating the prepare/confirm lifecycle.

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 93%, so the schema already documents nearly every parameter including the provenance of intentId and simulationId. The description adds no format, constraint, or interaction detail beyond the schema, so the baseline of 3 applies.

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?

The description states a specific verb and resource ('Prepare an autonomous spot swap') and adds meaningful scope: 'within signed delegation bounds from authoritative quote and simulation records'. The closing sentence ('The agent signs and broadcasts in its local runtime') distinguishes this preparation step from execution-oriented siblings like execute_swap or confirm_autonomous_swap, though no sibling is ever named explicitly.

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?

Usage is only implied by the workflow narrative and by parameter descriptions that cite get_swap_quote and simulate_swap_intent as the sources of intentId and simulationId. There is no explicit statement of when to call this rather than confirm_autonomous_swap, prepare_solana_swap, or release_autonomous_reservation, and no exclusion for the Solana variant despite a sibling that clearly covers it.

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