Skip to main content
Glama
nonnname

T-Invest MCP Server

by nonnname

get_max_lots

Read-only

Calculate the maximum number of lots you can buy or sell in T-Invest by providing account ID, ticker, and optional price.

Instructions

Рассчитать максимальное количество лотов для покупки/продажи в Т-Инвестициях

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
accountIdYesИдентификатор счёта
tickerYesТикер инструмента
priceNoЦена для расчёта (по умолчанию — рыночная)

Implementation Reference

  • The tool registration and handler implementation for "get_max_lots".
    export function registerGetMaxLots(server: McpServer, client: TInvestClient): void {
      server.tool(
        'get_max_lots',
        'Рассчитать максимальное количество лотов для покупки/продажи в Т-Инвестициях',
        {
          accountId: z.string().describe('Идентификатор счёта'),
          ticker: z.string().describe('Тикер инструмента'),
          price: z.number().positive().optional().describe('Цена для расчёта (по умолчанию — рыночная)'),
        },
        READ_ONLY,
        async ({ accountId, ticker, price }) => {
          try {
            const item = await resolveTickerToInstrument(client, ticker);
            if (!item) {
              return { content: [{ type: 'text' as const, text: `Инструмент "${ticker}" не найден.` }], isError: true };
            }
    
            const body: Record<string, unknown> = { accountId, instrumentId: item.uid };
            if (price !== undefined) {
              body.price = toQuotation(price);
            }
    
            const response = await client.post<GetMaxLotsResponse>(
              API_PATHS.ORDERS.GET_MAX_LOTS,
              body,
            );
    
            const lines = [
              `${ticker}:`,
              `  Макс. покупка (рынок): ${response.buyMarketMax ?? 'н/д'} лот(ов)`,
              `  Макс. покупка (лимит): ${response.buyLimitMax ?? 'н/д'} лот(ов)`,
              `  Макс. продажа (рынок): ${response.sellMarketMax ?? 'н/д'} лот(ов)`,
              `  Макс. продажа (лимит): ${response.sellLimitMax ?? 'н/д'} лот(ов)`,
              `  Валюта: ${response.currency}`,
            ];
    
            return { content: [{ type: 'text' as const, text: lines.join('\n') }] };
          } 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 valuable domain context (T-Investments platform specificity) and clarifies the calculation applies to both buying and selling, but omits behavioral details like error conditions (e.g., invalid ticker), caching, or calculation methodology.

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 purpose without redundancy. Front-loaded with the action verb, zero wasted words, appropriate length for a focused calculation tool.

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 focused scope (3 simple parameters, read-only operation, no output schema), the description adequately covers the calculation intent. Lacks only explicit connection to order placement workflow (relevant given post_order sibling exists) and return value details (though no output schema exists to require this).

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% (all 3 parameters documented). The description does not duplicate parameter details but implies their usage through the calculation context. With full schema coverage, baseline 3 is appropriate as the schema carries the semantic burden.

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?

Description clearly states the tool calculates maximum lot quantities for buy/sell operations, with specific domain context (Т-Инвестиции/T-Investments). Verb ('Рассчитать') and resource ('лоты') are explicit, distinguishing this from sibling retrieval tools like get_orders or get_portfolio.

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

Usage Guidelines3/5

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

No explicit when-to-use or when-not-to-use guidance is provided. While the purpose implies use before trading (likely prior to post_order), the description does not state prerequisites, alternatives, or workflow positioning relative to sibling tools like get_margin_attributes.

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