get_liquidity_sources
Retrieve available liquidity sources for a specific blockchain to identify trading opportunities and execute DeFi transactions.
Instructions
Get list of liquidity sources available on a specific chain
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": {
"chainId": "<chainId>"
},
"name": "get_liquidity_sources"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| chainId | Yes | Blockchain ID to get sources for |
Implementation Reference
- src/services/agService.js:97-115 (handler)Core AgService handler implementing the HTTP fetch to the aggregator API endpoint /api/swap/sources.
async getLiquiditySources(chainId) { try { const response = await fetch(`${this.baseUrl}/api/swap/sources?chainId=${chainId}`); if (!response.ok) { throw new Error(`HTTP ${response.status}: ${response.statusText}`); } const data = await response.json(); if (!data.success) { throw new Error(data.error || 'API request failed'); } return data.data; } catch (error) { throw new Error(`Failed to get liquidity sources: ${error.message}`); } }