# Agent Integration Guide — Euler

## Overview

On-chain contract: Euler. 4 functions, 35 events.

**MCP endpoint:** `https://euler.mcp.junct.dev/mcp`
**Domain:** lending
**Source type:** On-chain smart contract

## Authentication

No authentication required.

## Available Tools

### Read / Query

| Tool | Description |
|------|-------------|
| `moduleIdToImplementation` | Get moduleIdToImplementation(moduleId: string). Read-only — does not modify cont… |
| `moduleIdToProxy` | Get moduleIdToProxy(moduleId: string). Read-only — does not modify contract stat… |
| `name` | Get name(). Read-only — does not modify contract state. Unrestricted — any addre… |
| `AssetStatus` | Event emitted by the contract. Indexed fields (filterable): underlying. Subscrib… |
| `Borrow` | Event emitted by the contract. Indexed fields (filterable): underlying, account.… |
| `DelegateAverageLiquidity` | Event emitted by the contract. Indexed fields (filterable): account, delegate. S… |
| `Deposit` | Event emitted by the contract. Indexed fields (filterable): underlying, account.… |
| `EnterMarket` | Event emitted by the contract. Indexed fields (filterable): underlying, account.… |
| `ExitMarket` | Event emitted by the contract. Indexed fields (filterable): underlying, account.… |
| `Genesis` | Event emitted by the contract. Subscribe via log filters. |
| `GovConvertReserves` | [DISCOVERY] Event emitted by the contract. Indexed fields (filterable): underlyi… |
| `GovSetAssetConfig` | Event emitted by the contract. Indexed fields (filterable): underlying. Subscrib… |
| `GovSetIRM` | Event emitted by the contract. Indexed fields (filterable): underlying. Subscrib… |
| `GovSetPricingConfig` | Event emitted by the contract. Indexed fields (filterable): underlying. Subscrib… |
| `GovSetReserveFee` | Event emitted by the contract. Indexed fields (filterable): underlying. Subscrib… |
| `InstallerInstallModule` | Event emitted by the contract. Indexed fields (filterable): moduleId, moduleImpl… |
| `InstallerSetGovernorAdmin` | Event emitted by the contract. Indexed fields (filterable): newGovernorAdmin. Su… |
| `InstallerSetUpgradeAdmin` | Event emitted by the contract. Indexed fields (filterable): newUpgradeAdmin. Sub… |
| `Liquidation` | Event emitted by the contract. Indexed fields (filterable): liquidator, violator… |
| `MarketActivated` | Event emitted by the contract. Indexed fields (filterable): underlying, eToken, … |
| `PTokenActivated` | Event emitted by the contract. Indexed fields (filterable): underlying, pToken. … |
| `PTokenUnWrap` | Event emitted by the contract. Indexed fields (filterable): underlying, account.… |
| `PTokenWrap` | Event emitted by the contract. Indexed fields (filterable): underlying, account.… |
| `ProxyCreated` | Event emitted by the contract. Indexed fields (filterable): proxy. Subscribe via… |
| `Repay` | Event emitted by the contract. Indexed fields (filterable): underlying, account.… |
| `RequestBorrow` | Event emitted by the contract. Indexed fields (filterable): account. Subscribe v… |
| `RequestBurn` | Event emitted by the contract. Indexed fields (filterable): account. Subscribe v… |
| `RequestDeposit` | Event emitted by the contract. Indexed fields (filterable): account. Subscribe v… |
| `RequestLiquidate` | Event emitted by the contract. Indexed fields (filterable): liquidator, violator… |
| `RequestMint` | Event emitted by the contract. Indexed fields (filterable): account. Subscribe v… |
| `RequestRepay` | Event emitted by the contract. Indexed fields (filterable): account. Subscribe v… |
| `RequestSwap` | Event emitted by the contract. Indexed fields (filterable): accountIn, accountOu… |
| `RequestTransferDToken` | Event emitted by the contract. Indexed fields (filterable): from, to. Subscribe … |
| `RequestTransferEToken` | Event emitted by the contract. Indexed fields (filterable): from, to. Subscribe … |
| `RequestWithdraw` | Event emitted by the contract. Indexed fields (filterable): account. Subscribe v… |
| `TrackAverageLiquidity` | Event emitted by the contract. Indexed fields (filterable): account. Subscribe v… |
| `UnTrackAverageLiquidity` | Event emitted by the contract. Indexed fields (filterable): account. Subscribe v… |
| `Withdraw` | Event emitted by the contract. Indexed fields (filterable): underlying, account.… |

### Write / Action

| Tool | Description |
|------|-------------|
| `dispatch` | Call dispatch(). Write function — may have access control restrictions (e.g. onl… |

## Example Workflow

1. Call `moduleIdToImplementation` to fetch current contract state.
2. Call `dispatch` with required parameters to get calldata.
3. Sign and broadcast the returned `{ to, data, value }` payload via your wallet/RPC.
4. Confirm the transaction on-chain and call read tools again to verify state.

## Error Handling

- All tools throw descriptive errors on failure — catch and surface to the user.
- Write tools return calldata objects (`to`, `data`, `value`) — the agent must sign and broadcast.
- Check read tools first before any write/action operation.