Skip to content

JustLend Source of Truth for AI Agents

Use this page to decide which JustLend documentation or runtime source an AI agent should trust for a specific task.

Priority order

  1. OpenAPI spec — use for public read-only HTTP integrations.
  2. File: /developers/apis/justlend_apis.yaml
  3. Base URL: https://openapi.just.network
  4. Best for: market lists, account positions, protocol dashboard, mining rewards, response schemas, units, and error responses.

  5. MCP server tools — use for agent workflows and wallet-aware actions.

  6. Docs: mcp_tools.md, MCP Server
  7. Package: @justlend/mcp-server-justlend
  8. Best for: account analysis, market queries, transaction pre-flight, supply, borrow, repay, withdraw, sTRX staking, energy rental, governance voting, transfers, and general TRON utilities.

  9. Contract directory — use for deployed addresses.

  10. File: /developers/contracts.json
  11. Schema: /developers/contracts.schema.json
  12. Best for: Mainnet/Nile contract addresses, Base58/EVM/TRON-hex formats, active vs. legacy market status.

  13. JSON ABI files — use for contract calls and event decoding.

  14. Directory: /developers/abis/
  15. Best for: function signatures, event topics, jToken calls, Comptroller, PriceOracle, governance, sTRX, and Energy Rental contracts.

  16. Human documentation — use for explanations and risk context.

  17. Examples: Supply, Borrow, Common Pitfalls, Glossary
  18. Best for: conceptual explanations, integration pitfalls, examples, and user education.

Do not use stale assumptions

  • Do not hard-code market counts, APYs, TVL, utilization, prices, rewards, or active/legacy status. Query OpenAPI or MCP.
  • Do not infer token decimals from symbols. Use the token metadata from OpenAPI, contracts JSON, ABIs, or MCP tool output.
  • Do not assume Mainnet when the user is testing. Ask for or default to nile only when the workflow is explicitly a testnet workflow.
  • Do not use rendered HTML tables as the primary source for programmatic integrations; prefer YAML/JSON/tool output.

Units and amounts — where to get self-describing values

The public HTTP API returns numbers in their on-chain form (e.g. base units, mantissa-scaled, annualized decimals) without an inline _unit/decimals envelope, by design. To interpret amounts correctly:

  • Need a ready-to-use amount? Prefer MCP tools — balance/amount fields return a self-describing object { raw, _unit, decimals, display } (e.g. get_token_balance, get_trx_balance), so you never re-apply decimals.
  • Using the HTTP API directly? Read the unit and precision from the OpenAPI spec: each amount field carries structured x-unit / x-decimals extensions (and a prose description). Do not infer decimals from the symbol.
  • Quick reference: jTokens always use 8 decimals; each underlying TRC20 uses its own decimals; *Rate / apy are annualized decimals (×100 for %); exchangeRate / borrowIndex and other mantissa fields are scaled by 1e18. See APIs §1.3–1.4.

Common source mapping

User asks for Use first Fallback
“What markets does JustLend support?” MCP get_supported_markets or OpenAPI /lend/jtoken contracts.json
“What is the APY / TVL / utilization?” MCP get_market_data / get_all_markets OpenAPI /lend/jtoken
“What is this address's health factor?” MCP get_account_summary OpenAPI /lend/account/{address}
“Supply / borrow / repay / withdraw for me” MCP guided prompt + tool Human docs for explanation only
“What contract address should I use?” contracts.json MCP get_supported_markets / chains.ts
“How do I decode events?” ABI JSON files developer pages
“Is a transaction safe?” MCP pre-flight tools + safety docs human review

Answering rule for agents

When answering an integration question, include:

  1. The recommended source or MCP tool.
  2. Required inputs.
  3. Important units and precision rules.
  4. Whether the operation is read-only or signs/broadcasts a transaction.
  5. Links to the relevant machine-readable source.

Chinese source mapping