Skip to main content
Glama

evm_execute_flash_loan

Borrow uncollateralized assets from Aave, dYdX, Balancer, or Uniswap V3 to run arbitrage or liquidations, then repay in the same atomic transaction.

Instructions

Execute flash loan from Aave, dYdX, Balancer, or other providers.

Borrow large amounts without collateral, execute arbitrage/liquidations, repay in same transaction. Validates atomicity - transaction reverts if loan isn't repaid.

PARAMETERS:

  • chain: Target EVM chain

  • provider: Flash loan provider (aave, dydx, balancer, uniswapV3, etc.) - optional, auto-selects best

  • asset: Token address to borrow

  • amount: Amount to borrow in token units

  • callbackContract: Your contract that receives/repays loan

  • callbackData: Encoded data for callback (optional)

  • privateKey: Private key for signing

  • profitEstimate: Expected profit for cost analysis (optional)

FLASH LOAN PROVIDERS: • Aave: 0.09% fee, most chains • dYdX: 0% fee, Ethereum only • Balancer: 0% fee, select chains • Uniswap V3: 0.05-0.3% fee

ATOMICITY GUARANTEE: • Pre-flight gas estimation validates repayment • Transaction fails if callback doesn't repay • No risk of unpaid flash loans

Returns tx hash, fees paid, and profit analysis.

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": {
      "chain": "<chain>",
      "asset": "<asset>",
      "amount": "<amount>",
      "callbackContract": "<callbackContract>",
      "privateKey": "<privateKey>"
    },
    "name": "evm_execute_flash_loan"
  }
}

Input Schema

NameRequiredDescriptionDefault
assetYesToken address to borrow
chainYes
amountYesBorrow amount in token units
providerNoFlash loan provider (optional, auto-selects)
privateKeyYesPrivate key for signing
callbackDataNoEncoded data for callback
profitEstimateNoExpected profit in token units
callbackContractYesContract that receives and repays loan

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observedv1.0.0

TDQS

A4.2/5.0
Behavior4/5

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

With no annotations present, the description carries the full behavioral burden and does so well: it discloses atomicity semantics, that the transaction reverts if the callback fails to repay, that pre-flight gas estimation validates repayment, and what is returned (tx hash, fees paid, profit analysis). It stops short of stating what the private key parameter implies for security or whether the signing key is transmitted, which is a meaningful omission for a tool that takes a raw private key.

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?

The content is front-loaded with the core action and scope in the first two lines, then organized into labeled sections (providers, atomicity, returns) that an agent can scan rather than parse as prose. Every block contributes distinct information — fee table supports provider choice, atomicity block supports risk assessment — with no filler or repetition of the name.

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 an 8-parameter, 5-required mutating tool with no annotations and no output schema, the description covers the essential gaps: what the operation does mechanically, how failure is handled, provider trade-offs, and the shape of the return value. The notable remaining gap is the absence of any guidance on the privateKey and callbackContract requirements — the two parameters most likely to cause a failed or unsafe call.

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 already 88%, so the baseline is 3; the description adds real decision value beyond it by annotating which parameters are optional (provider, callbackData, profitEstimate), explaining that provider auto-selects the best option, and supplying a per-provider fee table that lets the agent reason about the provider enum values. The remaining parameters (chain, asset, amount, callbackContract) are only glossed in ways that mirror the schema, keeping this from a 5.

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 names a specific verb and resource ('Execute flash loan') and immediately constrains scope: borrowing without collateral, funding arbitrage or liquidations, repaid in the same transaction. That is clearly distinguishable from siblings like evm_execute_swap or evm_calculate_arbitrage, which do not carry the borrow-repay-same-tx semantics.

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?

The description implies when this tool is appropriate ('execute arbitrage/liquidations') and gives useful provider-selection guidance through the fee table and the note that provider is optional and auto-selects. However, it never states when NOT to use it or points to relevant siblings such as evm_calculate_arbitrage for pre-trade analysis or evm_execute_swap for non-leveraged trades, so the agent must infer the routing.

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