Skip to main content
Glama

t2000_rebalance

Automatically rebalances savings to optimize yield by finding better rates across assets and protocols, previewing gains before execution.

Instructions

Optimize savings yield — automatically finds the best rate across ALL assets and protocols, then handles everything: withdraw → swap → re-deposit. Works across different assets (e.g. USDC → USDe for higher APY). Always previews first — set dryRun: false to execute. Shows plan with APY gain, annual earnings increase, and break-even period. This is the ONE tool to use when the user asks "am I getting the best yield?" or "rebalance my savings".

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
dryRunNoPreview without executing (default: true)
minYieldDiffNoMin APY difference to rebalance (default: 0.5%)
maxBreakEvenNoMax break-even days (default: 30)

Implementation Reference

  • Tool definition and handler implementation for t2000_rebalance.
    server.tool(
      't2000_rebalance',
      'Optimize savings yield — automatically finds the best rate across ALL assets and protocols, then handles everything: withdraw → swap → re-deposit. Works across different assets (e.g. USDC → USDe for higher APY). Always previews first — set dryRun: false to execute. Shows plan with APY gain, annual earnings increase, and break-even period. This is the ONE tool to use when the user asks "am I getting the best yield?" or "rebalance my savings".',
      {
        dryRun: z.boolean().optional().describe('Preview without executing (default: true)'),
        minYieldDiff: z.number().optional().describe('Min APY difference to rebalance (default: 0.5%)'),
        maxBreakEven: z.number().optional().describe('Max break-even days (default: 30)'),
      },
      async ({ dryRun, minYieldDiff, maxBreakEven }) => {
        try {
          const result = await mutex.run(() =>
            agent.rebalance({
              dryRun: dryRun ?? true,
              minYieldDiff,
              maxBreakEven,
            }),
          );
          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 key behaviors: it automatically finds the best rate across assets/protocols, handles the full rebalancing process (withdraw, swap, deposit), always previews first unless dryRun is false, and shows a plan with APY gain, earnings increase, and break-even period. It doesn't mention rate limits, auth needs, or error handling, but covers the core operational flow adequately.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is appropriately sized and front-loaded with the core purpose in the first sentence. Every sentence adds value: the second explains the process, the third clarifies the dryRun behavior and output details, and the fourth provides usage guidelines. It could be slightly more concise by combining some clauses, but overall it's efficient with zero waste.

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 tool's complexity (automated rebalancing across assets/protocols) and no annotations or output schema, the description does a good job of explaining what the tool does, when to use it, and key behaviors. It covers the operational flow, preview/execute mode, and output metrics. However, it lacks details on error conditions, specific asset/protocol constraints, or response format, which could be important for a tool with no output schema.

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 all three parameters (dryRun, minYieldDiff, maxBreakEven). The description adds minimal value beyond the schema by mentioning dryRun's preview behavior and implying minYieldDiff and maxBreakEven relate to APY gain and break-even period, but doesn't provide additional syntax or format details. This meets the baseline of 3 when schema coverage is high.

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 tool's purpose with specific verbs ('optimize savings yield', 'finds the best rate', 'handles everything: withdraw → swap → re-deposit') and distinguishes it from siblings by emphasizing it's the 'ONE tool' for yield optimization and rebalancing, unlike other tools like t2000_balance or t2000_rates that focus on different aspects.

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

Usage Guidelines5/5

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

The description explicitly states when to use this tool: when users ask 'am I getting the best yield?' or 'rebalance my savings'. It also implies when not to use it by contrasting with other tools (e.g., t2000_all_rates might show rates without rebalancing), though it doesn't name specific alternatives, the context is clear.

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