Skip to main content
Glama
nonnname

T-Invest MCP Server

by nonnname

get_withdraw_limits

Retrieve available withdrawal limits for a T-Invest account to understand fund accessibility and plan transactions accordingly.

Instructions

Получить доступные лимиты вывода средств со счёта в Т-Инвестициях

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountIdYesИдентификатор счёта (можно получить через get_accounts)

Implementation Reference

  • The handler logic for the 'get_withdraw_limits' tool, which fetches withdrawal limits via the TInvestClient.
    server.tool(
      'get_withdraw_limits',
      'Получить доступные лимиты вывода средств со счёта в Т-Инвестициях',
      {
        accountId: z.string().describe('Идентификатор счёта (можно получить через get_accounts)'),
      },
      READ_ONLY,
      async ({ accountId }) => {
        try {
          const response = await client.post<GetWithdrawLimitsResponse>(
            API_PATHS.OPERATIONS.GET_WITHDRAW_LIMITS,
            { accountId },
          );
    
          const lines: string[] = [];
    
          if (response.money && response.money.length > 0) {
            lines.push('Доступно к выводу:');
            for (const m of response.money) lines.push(`  ${formatMoney(m)}`);
          }
    
          if (response.blocked && response.blocked.length > 0) {
            lines.push('\nЗаблокировано:');
            for (const m of response.blocked) lines.push(`  ${formatMoney(m)}`);
          }
    
          if (response.blockedGuarantee && response.blockedGuarantee.length > 0) {
            lines.push('\nЗаблокировано под гарантийное обеспечение:');
            for (const m of response.blockedGuarantee) lines.push(`  ${formatMoney(m)}`);
          }
    
          return {
            content: [{ type: 'text' as const, text: lines.length > 0 ? lines.join('\n') : 'Данные недоступны.' }],
          };
        } catch (error) {
          return {
            content: [{ type: 'text' as const, text: `Ошибка: ${error instanceof Error ? error.message : String(error)}` }],
            isError: true,
          };
        }
      },
    );
  • The registration function that defines the 'get_withdraw_limits' tool on the McpServer.
    export function registerGetWithdrawLimits(server: McpServer, client: TInvestClient): void {
      server.tool(
        'get_withdraw_limits',
        'Получить доступные лимиты вывода средств со счёта в Т-Инвестициях',
        {
          accountId: z.string().describe('Идентификатор счёта (можно получить через get_accounts)'),
        },
        READ_ONLY,
        async ({ accountId }) => {
          try {
            const response = await client.post<GetWithdrawLimitsResponse>(
              API_PATHS.OPERATIONS.GET_WITHDRAW_LIMITS,
              { accountId },
            );
    
            const lines: string[] = [];
    
            if (response.money && response.money.length > 0) {
              lines.push('Доступно к выводу:');
              for (const m of response.money) lines.push(`  ${formatMoney(m)}`);
            }
    
            if (response.blocked && response.blocked.length > 0) {
              lines.push('\nЗаблокировано:');
              for (const m of response.blocked) lines.push(`  ${formatMoney(m)}`);
            }
    
            if (response.blockedGuarantee && response.blockedGuarantee.length > 0) {
              lines.push('\nЗаблокировано под гарантийное обеспечение:');
              for (const m of response.blockedGuarantee) lines.push(`  ${formatMoney(m)}`);
            }
    
            return {
              content: [{ type: 'text' as const, text: lines.length > 0 ? lines.join('\n') : 'Данные недоступны.' }],
            };
          } catch (error) {
            return {
              content: [{ type: 'text' as const, text: `Ошибка: ${error instanceof Error ? error.message : String(error)}` }],
              isError: true,
            };
          }
        },
      );
    }

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/nonnname/t-invest-mcp-server'

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