Skip to main content
Glama

Prepare a loan

build_borrow
Read-onlyIdempotent

Returns the unsigned transactions to open a loan: an approval (only if needed) then openLoan. Includes the quote and warnings. The user's wallet must sign and send each step in order.

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": {
      "asset": "<asset>",
      "collateral_amount": "<collateral_amount>",
      "term": "<term>",
      "borrower": "<borrower>"
    },
    "name": "build_borrow"
  }
}

Input Schema

NameRequiredDescriptionDefault
termYesLoan term: short, medium or long (or 0/1/2). Durations and costs come from get_protocol_info.
assetYesToken contract address on Base (preferred) or its symbol, e.g. WETH, VIRTUAL, esALB
borrowerYesWallet that will sign; used to skip unneeded approvals and check balances
loan_amount_usdcNo
collateral_amountYes
max_shortfall_bpsNoMax gap between requested and funded amount in basis points. Omit for the protocol default.

Schema Changelog

Changes observed during successful MCP inspections.

  1. First observed

TDQS

A3.6/5.0
Behavior4/5

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

Annotations already establish readOnlyHint=true, idempotentHint=true and destructiveHint=false, so the safety profile is covered. The description still adds real behavioral context beyond them: the return is unsigned transactions rather than effects, the approval step is conditional ('only if needed'), warnings may be present, and the caller must sign in order. It omits any mention of what happens if a step fails or is skipped.

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?

Two sentences, front-loaded with the return value and ending with the critical operational constraint. Every clause carries information; nothing is padded.

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?

Annotations cover safety and there is no output schema, so the description reasonably must explain the return — which it does as unsigned transactions plus quote and warnings. What's thin, given six parameters and a multi-step signing flow, is the parameter layer and the exact shape of the returned transaction list.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds no meaning for any of the six parameters — nothing about asset addressing, term values, borrower usage, or max_shortfall_bps. With only 67% schema description coverage (and an odd aliasing of loan_amount_usdc to collateral_amount that the description does not clarify), the description leaves real ambiguity unaddressed.

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 names a specific verb and resource — it returns unsigned transactions (approval then openLoan) to open a loan, and states what is bundled (quote and warnings). That is far more specific than the title 'Prepare a loan', though it never names quote_borrow, which is the closest sibling an agent would weigh it against.

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?

It gives a clear downstream workflow rule — the user's wallet must sign and send each step in order — which tells the agent this is a preparation step, not a state change. However, it never says when to call it versus quote_borrow or simulate_transaction, so the selection guidance is only implied.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.