Skip to main content
Glama

waiaas_get_defi_positions

Retrieve DeFi lending positions with health factors and USD values to monitor wallet exposure and risk levels.

Instructions

Get DeFi lending positions with health factor and USD amounts.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wallet_idNoTarget wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.

Implementation Reference

  • The handler logic for the 'waiaas_get_defi_positions' tool, which fetches data from the API endpoint '/v1/wallet/positions'.
    async (args) => {
      const params = new URLSearchParams();
      if (args.wallet_id) params.set('wallet_id', args.wallet_id);
      const qs = params.toString();
      const result = await apiClient.get('/v1/wallet/positions' + (qs ? '?' + qs : ''));
      return toToolResult(result);
    },
  • The registration function for the 'waiaas_get_defi_positions' tool within the MCP server.
    export function registerGetDefiPositions(server: McpServer, apiClient: ApiClient, walletContext?: WalletContext): void {
      server.tool(
        'waiaas_get_defi_positions',
        withWalletPrefix('Get DeFi lending positions with health factor and USD amounts.', walletContext?.walletName),
        {
          wallet_id: z.string().optional().describe('Target wallet ID. Required for multi-wallet sessions; auto-resolved when session has a single wallet.'),
        },
        async (args) => {
          const params = new URLSearchParams();
          if (args.wallet_id) params.set('wallet_id', args.wallet_id);
          const qs = params.toString();
          const result = await apiClient.get('/v1/wallet/positions' + (qs ? '?' + qs : ''));
          return toToolResult(result);
        },
      );
    }

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/minhoyoo-iotrust/WAIaaS'

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