Skip to main content
Glama
nonnname

T-Invest MCP Server

by nonnname

get_accounts

Read-only

Retrieve a list of user investment accounts from T-Invest to view portfolio holdings and manage trading activities.

Instructions

Получить список счетов пользователя в Т-Инвестициях

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function for the 'get_accounts' tool. It fetches accounts using the TInvestClient and formats the response.
      async () => {
        try {
          const response = await client.post<GetAccountsResponse>(
            API_PATHS.USERS.GET_ACCOUNTS,
            { status: 2 },
          );
    
          if (!response.accounts || response.accounts.length === 0) {
            return { content: [{ type: 'text' as const, text: 'Счета не найдены.' }] };
          }
    
          const lines = response.accounts.map((account) => {
            return [
              `ID: ${account.id}`,
              `Название: ${account.name}`,
              `Уровень доступа: ${account.accessLevel}`,
            ].join('\n');
          });
    
          return { content: [{ type: 'text' as const, text: lines.join(SEPARATOR) }] };
        } 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_accounts' tool within the MCP server.
    export function registerGetAccounts(server: McpServer, client: TInvestClient): void {
      server.tool(
        'get_accounts',
        'Получить список счетов пользователя в Т-Инвестициях',
        {},
        READ_ONLY,
        async () => {
          try {
            const response = await client.post<GetAccountsResponse>(
              API_PATHS.USERS.GET_ACCOUNTS,
              { status: 2 },
            );
    
            if (!response.accounts || response.accounts.length === 0) {
              return { content: [{ type: 'text' as const, text: 'Счета не найдены.' }] };
            }
    
            const lines = response.accounts.map((account) => {
              return [
                `ID: ${account.id}`,
                `Название: ${account.name}`,
                `Уровень доступа: ${account.accessLevel}`,
              ].join('\n');
            });
    
            return { content: [{ type: 'text' as const, text: lines.join(SEPARATOR) }] };
          } catch (error) {
            return {
              content: [{ type: 'text' as const, text: `Ошибка: ${error instanceof Error ? error.message : String(error)}` }],
              isError: true,
            };
          }
        },
      );
Behavior3/5

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

Annotations declare readOnlyHint=true, covering the safety profile. The description adds minimal behavioral context beyond this—it doesn't mention if accounts are filtered by status (active/inactive), whether this includes archived accounts, or rate limiting considerations.

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?

Single sentence efficiently conveys the tool's purpose with no redundant information. Perfectly sized for a parameter-less read operation.

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?

Adequate for a simple read-only tool with no parameters. While the output schema is missing, the description indicates a 'list' is returned, which provides sufficient context for tool selection despite not detailing the account object structure.

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?

Zero parameters present, which per guidelines warrants a baseline score of 4. The description implies no filtering is possible (list all accounts), which aligns with the empty schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'Получить' (Get) with resource 'счетов' (accounts) and domain context 'Т-Инвестициях' (T-Investments). It distinguishes from siblings like get_portfolio (holdings) and get_positions (positions) by focusing on account metadata.

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

Usage Guidelines2/5

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

No explicit when-to-use guidance, prerequisites, or alternatives mentioned. While the tool's purpose is inferable from the name and lack of parameters, there is no guidance on when to prefer this over get_user_info or how it relates to the trading workflow.

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

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