Skip to main content
Glama

t2000_borrow

Borrow USDC using savings as collateral. Check health factor to avoid liquidation risks. Preview transactions before signing.

Instructions

Borrow USDC against savings collateral. Check health factor first — below 1.0 risks liquidation. Amount is in dollars. Set dryRun: true to preview.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesDollar amount to borrow
dryRunNoPreview without signing (default: false)

Implementation Reference

  • Implementation of the 't2000_borrow' tool handler.
    server.tool(
      't2000_borrow',
      'Borrow USDC against savings collateral. Check health factor first — below 1.0 risks liquidation. Amount is in dollars. Set dryRun: true to preview.',
      {
        amount: z.number().describe('Dollar amount to borrow'),
        dryRun: z.boolean().optional().describe('Preview without signing (default: false)'),
      },
      async ({ amount, dryRun }) => {
        try {
          if (dryRun) {
            agent.enforcer.assertNotLocked();
            const health = await agent.healthFactor();
            const maxBorrow = await agent.maxBorrow();
    
            return {
              content: [{
                type: 'text',
                text: JSON.stringify({
                  preview: true,
                  amount,
                  maxBorrow: maxBorrow.maxAmount,
                  currentHealthFactor: health.healthFactor,
                  estimatedHealthFactorAfter: maxBorrow.healthFactorAfter,
                }),
              }],
            };
          }
    
          const result = await mutex.run(() => agent.borrow({ amount }));
          return { content: [{ type: 'text', text: JSON.stringify(result) }] };
        } catch (err) {
          return errorResult(err);
        }
      },
    );
Behavior4/5

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

With no annotations provided, the description carries the full burden and does well by disclosing critical behavioral traits: it involves financial risk (liquidation if health factor is low), specifies that 'Amount is in dollars', and explains the dryRun parameter for previewing without signing. It lacks details on rate limits or auth needs, but covers key operational aspects.

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 description is front-loaded with the core purpose, followed by essential warnings and parameter guidance in three concise sentences. Every sentence earns its place by adding critical information without redundancy.

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?

Given the complexity of a financial borrowing tool with no annotations and no output schema, the description is fairly complete: it explains the purpose, risks, and parameter usage. However, it could improve by detailing the return format or error conditions, which are missing but not strictly required for basic understanding.

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

Parameters3/5

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

Schema description coverage is 100%, so the schema already documents both parameters thoroughly. The description adds minimal value beyond the schema by clarifying that 'Amount is in dollars' and explaining dryRun for previewing, but does not provide additional syntax or format details. Baseline 3 is appropriate as the schema does the heavy lifting.

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 clearly states the action ('Borrow USDC against savings collateral'), specifies the resource (USDC), and distinguishes it from siblings like t2000_repay or t2000_save by focusing on borrowing against collateral rather than repaying or saving funds.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It provides clear context by advising to 'Check health factor first — below 1.0 risks liquidation', which indicates when to use caution. However, it does not explicitly mention when not to use this tool or name alternatives among siblings, such as t2000_repay for debt management.

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

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mission69b/t2000'

If you have feedback or need assistance with the MCP directory API, please join our Discord server