Skip to main content
Glama

t2000_repay

Repay borrowed USDC debt in a bank account for AI agents. Specify dollar amount or "all" to clear entire debt, with optional preview mode.

Instructions

Repay borrowed USDC. Amount is in dollars. Use "all" to repay entire debt. Set dryRun: true to preview.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
amountYesDollar amount to repay, or "all"
dryRunNoPreview without signing (default: false)

Implementation Reference

  • The 't2000_repay' tool registration and implementation, handling both dry run previews and the actual repayment logic via the agent.
    server.tool(
      't2000_repay',
      'Repay borrowed USDC. Amount is in dollars. Use "all" to repay entire debt. Set dryRun: true to preview.',
      {
        amount: z.union([z.number(), z.literal('all')]).describe('Dollar amount to repay, or "all"'),
        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 positions = await agent.positions();
            const totalDebt = positions.positions
              .filter(p => p.type === 'borrow')
              .reduce((sum, p) => sum + p.amount, 0);
    
            return {
              content: [{
                type: 'text',
                text: JSON.stringify({
                  preview: true,
                  amount: amount === 'all' ? totalDebt : amount,
                  currentDebt: totalDebt,
                  currentHealthFactor: health.healthFactor,
                }),
              }],
            };
          }
    
          const result = await mutex.run(() => agent.repay({ amount }));
          return { content: [{ type: 'text', text: JSON.stringify(result) }] };
        } catch (err) {
          return errorResult(err);
        }
      },
Behavior3/5

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

No annotations are provided, so the description carries the full burden. It discloses that this is a repayment action (implying a mutation/write operation) and mentions a preview mode with 'dryRun', which adds useful behavioral context. However, it lacks details on permissions needed, rate limits, transaction finality, error conditions, or what happens if the amount exceeds the debt. For a financial tool with no annotations, this leaves gaps in safety and operational transparency.

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 extremely concise and front-loaded, with three short sentences that each serve a clear purpose: stating the action, explaining a key parameter option, and describing a behavioral feature. There is no wasted verbiage, and it efficiently conveys essential information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/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 repayment tool with no annotations and no output schema, the description is minimally adequate. It covers the basic purpose and parameter usage but lacks details on return values, error handling, security requirements, or side effects. The high schema coverage helps, but for a mutation tool, more contextual information would be beneficial to ensure safe and correct usage.

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

Parameters4/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 value by clarifying that 'amount' is in dollars (not USDC units) and explaining the semantic meaning of 'all' and 'dryRun' beyond the schema's technical descriptions. This enhances understanding but doesn't fully compensate for the lack of output schema or deeper behavioral context.

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 specific action ('Repay borrowed USDC'), identifies the resource (USDC debt), and distinguishes it from sibling tools like 't2000_borrow' (which would be for borrowing) and 't2000_pay' (which might be for other payments). It specifies the currency context (dollars) and the optional 'all' repayment.

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?

The description provides clear context on when to use certain parameter values ('Use "all" to repay entire debt' and 'Set dryRun: true to preview'), which implicitly guides usage for full repayment vs. partial and for testing vs. execution. However, it does not explicitly state when to choose this tool over alternatives like 't2000_withdraw' or other financial tools, nor does it mention prerequisites (e.g., having an existing debt).

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